def click_agree(driver): """Click Agree.""" assert wait_on_element(driver, 0.5, 30, '//button[@ix-auto="button__I AGREE"]') driver.find_element_by_xpath( '//button[@ix-auto="button__I AGREE"]').click()
def you_should_see_the_dashboard(driver): """You should see the dashboard.""" assert wait_on_element(driver, 1, 10, '//h1[contains(.,"Dashboard")]') assert wait_on_element(driver, 1, 10, '//span[contains(.,"System Information")]')
def the_users_page_should_open(driver): """The Users page should open.""" assert wait_on_element(driver, 1, 7, '//div[contains(.,"Users")]')
def click_on_add_acl_item(driver): """Click on Add ACL Item.""" assert wait_on_element(driver, 1, 5, '//button[@ix-auto="button__ADD ACL ITEM"]') driver.find_element_by_xpath('//button[@ix-auto="button__ADD ACL ITEM"]').click()
def click_on_who_select_user(driver): """Click on who select User.""" driver.find_element_by_xpath('//mat-select[@ix-auto="select__Who"]/div/div/span[contains(.,"Who")]').click() assert wait_on_element(driver, 0.5, 5, '//mat-option[@ix-auto="option__Who_User"]') driver.find_element_by_xpath('//mat-option[@ix-auto="option__Who_User"]').click()
def you_should_see_the_dashboard_and_system_information(driver): """You should see the dashboard and "System Information".""" assert wait_on_element(driver, 0.5, 5, '//span[contains(.,"System Information")]')
def on_the_dozer_pool_click_on_my_acl_dataset_3_dots_button_select_edit_permissions(driver): """On the dozer pool click on "my_acl_dataset" 3 dots button, select Edit Permissions.""" assert wait_on_element(driver, 1, 5, '//mat-icon[@id="actions_menu_button__my_acl_dataset"]') driver.find_element_by_xpath('//mat-icon[@id="actions_menu_button__my_acl_dataset"]').click() assert wait_on_element(driver, 1, 5, '//button[@ix-auto="action__my_acl_dataset_Edit Permissions"]') driver.find_element_by_xpath('//button[@ix-auto="action__my_acl_dataset_Edit Permissions"]').click()
def navigate_to_system_and_click_support(driver): """Navigate to System and click Support.""" driver.find_element_by_xpath('//a[@name="System-menu"]').click() assert wait_on_element(driver, 0.5, 30, '//a[contains(.,"Support")]') driver.find_element_by_xpath('//a[contains(.,"Support")]').click()
def the_support_page_license_information_should_load(driver): """The Support page License Information should load.""" assert wait_on_element(driver, 0.5, 30, '//p[contains(.,"License Information")]') driver.find_element_by_xpath('//p[contains(.,"License Information")]')
def interface_settings_should_appear(driver): """Interface Settings should appear.""" assert wait_on_element(driver, 0.5, 30, '//h4[contains(.,"Interface Settings")]') driver.find_element_by_xpath('//h4[contains(.,"Interface Settings")]')
def you_should_see_the_dashboard_and_serial_number_should_show_serial1( driver, serial1): """You should see the dashboard and serial number should show "serial1".""" assert wait_on_element(driver, 1, 5, f'//span[contains(.,"{serial1}")]') driver.find_element_by_xpath(f'//span[contains(.,"{serial1}")]')
def after_settings_are_applied_you_should_see_settings_applied(driver): """After settings are applied you should see "Settings applied".""" assert wait_on_element(driver, 0.5, 30, '//h1[contains(.,"Settings saved")]') driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click()
def click_save_when_finished(driver): """click save when finished.""" assert wait_on_element(driver, 0.5, 30, '//button[@ix-auto="button__SAVE"]') driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
def we_should_be_returned_to_license_information(driver): """We should be returned to license information.""" assert wait_on_element(driver, 0.5, 30, '//p[contains(.,"License Information")]') driver.find_element_by_xpath('//p[contains(.,"License Information")]')
def verify_the_new_acl_item_for_user_name_still_exist(driver, user): """Verify the new ACL item for user "{user}" still exist.""" assert wait_on_element(driver, 1, 5, '//h4[contains(.,"File Information")]') assert wait_on_element(driver, 1, 5, '(//input[@placeholder="User"])[2]') assert attribute_value_exist(driver, '(//input[@placeholder="User"])[2]', 'value', user)
def the_update_license_widget_should_open(driver): """The "Update License" widget should open.""" assert wait_on_element(driver, 0.5, 30, '//h1[contains(.,"Update License")]') driver.find_element_by_xpath('//h1[contains(.,"Update License")]')
def navigate_to_dashboard(driver): """Navigate to Dashboard.""" driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() assert wait_on_element(driver, 0.5, 10, '//span[contains(.,"System Information")]')
def change_should_be_saved(driver): """Change should be saved.""" assert wait_on_element_disappear(driver, 1, 20, '//h6[contains(.,"Please wait")]') assert wait_on_element(driver, 1, 7, '//div[contains(.,"Users")]')
def the_pools_page_should_open(driver): """The Pools page should open.""" assert wait_on_element(driver, 0.5, 5, '//div[contains(.,"Pools")]')
def reopen_the_user_edit_page_and_ensure_that_the_additional_group_was_saved(driver): """reopen the user edit page and ensure that the additional group was saved.""" driver.find_element_by_xpath('//tr[@ix-auto="expander__ericbsd"]/td').click() driver.find_element_by_xpath('//button[@ix-auto="button__EDIT_ericbsd"]').click() assert wait_on_element(driver, 1, 7, '//h3[contains(.,"Edit User")]') assert wait_on_element(driver, 0.5, 7, '//h4[contains(.,"Identification")]')
def the_edit_acl_page_should_open(driver): """The Edit ACL page should open.""" if wait_on_element(driver, 1, 2, '//button[@ix-auto="button__USE ACL MANAGER"]'): driver.find_element_by_xpath('//button[@ix-auto="button__USE ACL MANAGER"]').click() assert wait_on_element(driver, 1, 5, '//h4[contains(.,"File Information")]')
def on_the_right_side_of_the_table_click_the_expand_arrow_for_one_of_the_users(driver): """On the right side of the table, click the expand arrow for one of the users.""" assert wait_on_element(driver, 0.5, 7, '//tr[@ix-auto="expander__ericbsd"]/td') driver.find_element_by_xpath('//tr[@ix-auto="expander__ericbsd"]/td').click()
def the_new_acl_item_should_be_added(driver): """The new ACL item should be added.""" assert wait_on_element(driver, 1, 5, '//mat-select[@ix-auto="select__Who"]/div/div/span[contains(.,"Who")]')
def the_user_input_should_appear(driver): """The User input should appear.""" assert wait_on_element(driver, 1, 5, '(//input[@placeholder="User"])[2]')
def the_user_edit_page_should_open(driver): """The User Edit Page should open.""" assert wait_on_element(driver, 1, 7, '//h3[contains(.,"Edit User")]')
def in_user_input_enter_eric_and_select_ericbsd(driver, input, user): """In User Input enter "{input}" and select "{user}".""" driver.find_element_by_xpath('(//input[@placeholder="User"])[2]').send_keys(input) assert wait_on_element(driver, 0.5, 5, f'//mat-option[@ix-auto="option__{user}"]') driver.find_element_by_xpath(f'//mat-option[@ix-auto="option__{user}"]').click()
def the_credentials_menu_should_expand_to_the_right(driver): """The Credentials menu should expand to the right.""" assert wait_on_element(driver, 1, 7, '//mat-list-item[@ix-auto="option__Local Users"]')
def click_the_save_button_should_be_return_to_pool_page(driver): """Click the Save button, should be return to pool page.""" wait_on_element(driver, 0.5, 5, '//button[@ix-auto="button__SAVE"]') driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click() assert wait_on_element(driver, 1, 5, '//mat-panel-title[contains(.,"dozer")]') driver.find_element_by_xpath('//td[@ix-auto="value__dozer_name"]')
def the_user_field_should_expand_down_to_list_further_details(driver): """The User Field should expand down to list further details.""" assert wait_on_element(driver, 0.5, 7, '//button[@ix-auto="button__EDIT_ericbsd"]')
def end_user_license_agreement_truenas_should_appear(driver, agreement): """"End User License Agreement - TrueNAS" should appear.""" assert wait_on_element(driver, 0.5, 30, f'//h1[contains(.,"{agreement}")]') driver.find_element_by_xpath(f'//h1[contains(.,"{agreement}")]')