Skip to content

Commit

Permalink
Refactored some User test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbsd committed Apr 23, 2024
1 parent 938886a commit 970b9a1
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 99 deletions.
7 changes: 3 additions & 4 deletions tests/bdd/core/test_NAS_T0986.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ def you_should_be_on_the_dashboard(driver):
@then('click on the Accounts on the side menu, click on Users')
def click_on_the_accounts_on_the_side_menu_click_on_users(driver):
"""click on the Accounts on the side menu, click on Users."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Accounts"]', 'clickable')
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
assert wait_on_element(driver, 7, xpaths.sideMenu.accounts, 'clickable')
driver.find_element_by_xpath(xpaths.sideMenu.accounts).click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('when the Users page should open, click on the "Add" Button')
Expand Down
6 changes: 3 additions & 3 deletions tests/bdd/core/test_NAS_T1014.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def you_should_be_on_the_dashboard(driver):
@then('click on the Accounts on the side menu, click on Users')
def click_on_the_accounts_on_the_side_menu_click_on_users(driver):
"""click on the Accounts on the side menu, click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
driver.find_element_by_xpath(xpaths.sideMenu.accounts).click()
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('when the Users page should open, click on the "Add" Button')
Expand Down
6 changes: 3 additions & 3 deletions tests/bdd/core/test_NAS_T1041.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ def on_windows_shares_page_verify_the_smbuser_share_exist(driver):
@then('click on Accounts on the side menu, click on Users')
def click_on_accounts_on_the_side_menu_click_on_users(driver):
"""click on Accounts on the side menu, click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
driver.find_element_by_xpath(xpaths.sideMenu.accounts).click()
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('on the Users page click Add')
Expand Down
6 changes: 3 additions & 3 deletions tests/bdd/core/test_NAS_T1043.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def you_are_on_the_dashboard(driver):
@then('click on the Accounts on the side menu, click on Users')
def click_on_the_accounts_on_the_side_menu_click_on_users(driver):
"""click on the Accounts on the side menu, click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
driver.find_element_by_xpath(xpaths.sideMenu.accounts).click()
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('on the Users page, click the foo user right arrow')
Expand Down
6 changes: 3 additions & 3 deletions tests/bdd/core/test_NAS_T1044.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def you_are_on_the_dashboard(driver):
@then('click on the Accounts on the side menu, click on Users')
def click_on_the_accounts_on_the_side_menu_click_on_users(driver):
"""click on the Accounts on the side menu, click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
driver.find_element_by_xpath(xpaths.sideMenu.accounts).click()
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('on the Users page, click the foo user right arrow')
Expand Down
7 changes: 3 additions & 4 deletions tests/bdd/core/test_NAS_T1060.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa
def on_the_dashboard_click_on_accounts_on_the_side_menu_click_on_users(driver):
"""on the dashboard, click on Accounts on the side menu, click on Users."""
assert wait_on_element(driver, 10, '//li[contains(.,"Dashboard")]')
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Accounts"]')
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]')
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
assert wait_on_element(driver, 7, xpaths.dashboard.system_information)
rsc.click_on_element(driver, xpaths.sideMenu.accounts)
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('on the Users page should open, click on the Add Button')
Expand Down
8 changes: 4 additions & 4 deletions tests/bdd/ha-bhyve02/test_NAS_T0908.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ def you_should_see_the_dashboard_and_system_information(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
assert wait_on_element(driver, 10, '//mat-list-item[@ix-auto="option__Accounts"]', 'clickable')
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
assert wait_on_element(driver, 10, xpaths.sideMenu.accounts, 'clickable')
driver.find_element_by_xpath(xpaths.sideMenu.accounts).click()


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0909.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0910.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, '//mat-list-item[@ix-auto="option__Users"]')


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0911.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0912.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0913.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0914.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0915.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0916.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
9 changes: 3 additions & 6 deletions tests/bdd/ha-bhyve02/test_NAS_T0917.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,22 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts item in the left side menu')
def click_on_the_accounts_item_in_the_left_side_menu(driver):
"""Click on the Accounts item in the left side menu."""
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
class_attribute = element.get_attribute('class')
if 'open' not in class_attribute:
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.accounts)


@then('The Accounts menu should expand down')
def the_accounts_menu_should_expand_down(driver):
"""The Accounts menu should expand down."""
assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
element = driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]')
element = driver.find_element_by_xpath(xpaths.sideMenu.accounts)
class_attribute = element.get_attribute('class')
assert 'open' in class_attribute, class_attribute


@then('Click on Users')
def click_on_users(driver):
"""Click on Users."""
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
6 changes: 3 additions & 3 deletions tests/bdd/ha-bhyve02/test_NAS_T0927.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def you_should_see_the_dashboard(driver):
@then('Click on the Accounts, Click on Users')
def click_on_the_accounts_click_on_users(driver):
"""Click on the Accounts, Click on Users."""
assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Accounts"]', 'clickable')
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Accounts"]').click()
assert wait_on_element(driver, 5, xpaths.sideMenu.accounts, 'clickable')
driver.find_element_by_xpath(xpaths.sideMenu.accounts).click()
assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Users"]', 'clickable')
driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Users"]').click()
rsc.click_on_element(driver, xpaths.sideMenu.users)


@then('The Users page should open')
Expand Down
Loading

0 comments on commit 970b9a1

Please sign in to comment.