Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TE-1700 / Fixed disk name in UI tests #9980

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/bdd/core/test_NAS_T0985.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@


@scenario('features/NAS-T985.feature', 'Create a pool call tank')
def test_create_a_pool_call_tank_with_2_disk(driver):
"""Create a pool call tank with 2 disk."""
def test_create_a_pool_call_tank(driver):
"""Create a pool call tank."""


@given('the browser is open, the FreeNAS URL and logged in')
Expand Down Expand Up @@ -96,9 +96,9 @@ def when_the_pool_manager_appears_enter_the_tank_for_pool_name(driver):
@then('click ada1 checkbox, press the right arrow under Data VDevs')
def click_ada1_checkbox_press_the_right_arrow_under_data_vdevs(driver):
"""click ada1 checkbox, press the right arrow under Data VDevs."""
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__disks-ada1"]', 'clickable')
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__disks-ada2"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-ada1"]').click()
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__disks-da1"]', 'clickable')
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__disks-da2"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-da1"]').click()
assert wait_on_element(driver, 7, '//button[@id="vdev__add-button"]', 'clickable')
driver.find_element_by_xpath('//button[@id="vdev__add-button"]').click()
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__force-submit-checkbox"]', 'clickable')
Expand Down
21 changes: 11 additions & 10 deletions tests/bdd/core/test_NAS_T1001.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,36 @@ def when_the_disks_page_appears_click_name_to_sort_in_alphabetical_order(driver)
"""when the Disks page appears, click name to sort in alphabetical order."""
assert wait_on_element(driver, 7, '//div[contains(.,"Disks")]')
assert wait_on_element(driver, 7, '//span[contains(.,"Name")]')
ada0 = ''
while ada0 != 'ada0':
disk0 = driver.find_element_by_xpath('(//datatable-body-cell[2]/div/div)[1]').text
if disk0 != 'da0':
driver.find_element_by_xpath('//span[contains(.,"Name")]').click()
ada0 = driver.find_element_by_xpath('(//datatable-body-cell[2]/div/div)[1]').text
disk0 = driver.find_element_by_xpath('(//datatable-body-cell[2]/div/div)[1]').text
assert disk0 == 'da0'


@then('when all disks appear in alphabetical order, click on the ada3 disk arrow')
def when_all_disks_appear_in_alphabetical_order_click_on_the_ada3_disk_arrow(driver):
"""when all disks appear in alphabetical order, click on the ada3 disk arrow."""
# Verify disk are sorted
disk_list = {1: 'ada0', 2: 'ada1', 3: 'ada2', 4: 'ada3'}
disk_list = {1: 'da0', 2: 'da1', 3: 'da2', 4: 'da3', 5: 'da4'}
for num in list(disk_list.keys()):
disk = driver.find_element_by_xpath(f'(//datatable-body-cell[2]/div/div)[{num}]').text
assert disk == disk_list[num]
assert wait_on_element(driver, 7, '//a[@ix-auto="expander__ada3"]')
driver.find_element_by_xpath('//a[@ix-auto="expander__ada3"]').click()
assert wait_on_element(driver, 7, '//a[@ix-auto="expander__da3"]')
driver.find_element_by_xpath('//a[@ix-auto="expander__da3"]').click()


@then('click the WIPE button')
def click_the_wipe_button(driver):
"""click the WIPE button."""
assert wait_on_element(driver, 7, '//button[@ix-auto="button__WIPE_ada3_ada3"]')
driver.find_element_by_xpath('//button[@ix-auto="button__WIPE_ada3_ada3"]').click()
assert wait_on_element(driver, 7, '//button[@ix-auto="button__WIPE_da3_da3"]')
driver.find_element_by_xpath('//button[@ix-auto="button__WIPE_da3_da3"]').click()


@then('The Wipe Disk ada3 widget should appear')
def the_wipe_disk_ada3_widget_should_appear(driver):
"""The Wipe Disk ada3 widget should appear."""
assert wait_on_element(driver, 7, '//h1[contains(.,"Wipe Disk ada3")]')
assert wait_on_element(driver, 7, '//h1[contains(.,"Wipe Disk da3")]')


@then('select the Quick Method and click WIPE')
Expand All @@ -110,7 +111,7 @@ def select_the_quick_method_and_click_wipe(driver):
@then('check to confirm, and click continue')
def check_to_confirm_and_click_continue(driver):
"""check to confirm, and click continue."""
assert wait_on_element(driver, 7, '//h1[contains(.,"Wipe Disk ada3")]')
assert wait_on_element(driver, 7, '//h1[contains(.,"Wipe Disk da3")]')
driver.find_element_by_xpath('//mat-checkbox[@ix-auto="checkbox__CONFIRM"]').click()
driver.find_element_by_xpath('//button[@ix-auto="button__CONTINUE"]').click()

Expand Down
4 changes: 2 additions & 2 deletions tests/bdd/core/test_NAS_T1002.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def when_the_pool_manager_page_open_input_system_for_pool_name(driver):
@then('click the checkbox next to ada3, and press the right arrow under data vdev, click create')
def click_the_checkbox_next_to_ada3_and_press_the_right_arrow_under_data_vdev_click_create(driver):
"""click the checkbox next to ada3, and press the right arrow under data vdev, click create."""
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__disks-ada3"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-ada3"]').click()
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__disks-da3"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-da3"]').click()
assert wait_on_element(driver, 7, '//button[@id="vdev__add-button"]', 'clickable')
driver.find_element_by_xpath('//button[@id="vdev__add-button"]').click()
assert wait_on_element(driver, 7, '//mat-checkbox[@id="pool-manager__force-submit-checkbox"]', 'clickable')
Expand Down
4 changes: 2 additions & 2 deletions tests/bdd/core/test_NAS_T1080.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def click_on_the_encryption_checkbox_then_confirm(driver):
@then('click the ada2 checkbox, press the right arrow under Data VDevs')
def click_the_ada2_checkbox_press_the_right_arrow_under_data_vdevs(driver):
"""click the ada2 checkbox, press the right arrow under Data VDevs."""
assert wait_on_element(driver, 5, '//mat-checkbox[@id="pool-manager__disks-ada2"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-ada2"]').click()
assert wait_on_element(driver, 5, '//mat-checkbox[@id="pool-manager__disks-da2"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-da2"]').click()
assert wait_on_element(driver, 5, '//button[@id="vdev__add-button"]')
driver.find_element_by_xpath('//button[@id="vdev__add-button"]').click()

Expand Down
4 changes: 2 additions & 2 deletions tests/bdd/core/test_NAS_T1085.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def click_on_the_encryption_checkbox_then_confirm(driver):
@then('click the ada2 checkbox, press the right arrow under Data VDevs')
def click_the_ada2_checkbox_press_the_right_arrow_under_data_vdevs(driver):
"""click the ada2 checkbox, press the right arrow under Data VDevs."""
assert wait_on_element(driver, 5, '//mat-checkbox[@id="pool-manager__disks-ada2"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-ada2"]').click()
assert wait_on_element(driver, 5, '//mat-checkbox[@id="pool-manager__disks-da2"]', 'clickable')
driver.find_element_by_xpath('//mat-checkbox[@id="pool-manager__disks-da2"]').click()
assert wait_on_element(driver, 5, '//button[@id="vdev__add-button"]')
driver.find_element_by_xpath('//button[@id="vdev__add-button"]').click()

Expand Down
11 changes: 1 addition & 10 deletions tests/bdd/ha-bhyve02/test_NAS_T0904.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ def the_service_page_should_open(driver):
@then('press on configure(pencil) SSH')
def press_on_configure_ssh(driver):
"""press on configure(pencil) SSH."""
assert wait_on_element(driver, 5, '//button[@ix-auto="button__S3_Actions"]')
# Scroll to SSH service
element = driver.find_element_by_xpath('//button[@ix-auto="button__S3_Actions"]')
driver.execute_script("arguments[0].scrollIntoView();", element)
time.sleep(1)
assert wait_on_element(driver, 5, '//button[@ix-auto="button__SSH_Actions"]', 'clickable')
driver.find_element_by_xpath('//button[@ix-auto="button__SSH_Actions"]').click()


Expand Down Expand Up @@ -107,11 +103,6 @@ def click_save(driver):
def click_start_automatically_ssh_checkbox_and_enable_the_ssh_service(driver):
"""click Start Automatically SSH checkbox and enable the SSH service."""
assert wait_on_element(driver, 5, '//services')
assert wait_on_element(driver, 5, '//button[@ix-auto="button__S3_Actions"]')
# Scroll to SSH service
element = driver.find_element_by_xpath('//button[@ix-auto="button__S3_Actions"]')
driver.execute_script("arguments[0].scrollIntoView();", element)
time.sleep(1)
assert wait_on_element(driver, 5, '//mat-checkbox[@ix-auto="checkbox__SSH_Start Automatically"]', 'clickable')
value_exist = attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__SSH_Start Automatically"]', 'class', 'mat-checkbox-checked')
if not value_exist:
Expand Down
Loading