Exemplo n.º 1
0
def click_the_start_automatically_ssh_checkbox_and_enable_the_ssh_service(
        driver):
    """click the Start Automatically SSH checkbox and enable the SSH service."""
    assert wait_on_element(driver, 5, '//td[contains(text(),"Dynamic DNS")]')
    # Scroll to SSH service
    element = driver.find_element_by_xpath(
        '//td[contains(text(),"Dynamic DNS")]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(0.5)
    assert wait_on_element(driver, 5, '//tr[contains(.,"SSH")]//mat-checkbox')
    value_exist = attribute_value_exist(
        driver, '//tr[contains(.,"SSH")]//mat-checkbox', 'class',
        'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//tr[contains(.,"SSH")]//mat-checkbox').click()
    assert wait_on_element(driver, 5,
                           '//tr[contains(.,"SSH")]//mat-slide-toggle/label',
                           'clickable')
    value_exist = attribute_value_exist(
        driver, '//tr[contains(.,"SSH")]//mat-slide-toggle', 'class',
        'mat-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//tr[contains(.,"SSH")]//mat-slide-toggle/label').click()
Exemplo n.º 2
0
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')
    # Scroll to SSH service
    assert wait_on_element(driver, 5,
                           '//button[@ix-auto="action__Configure_S3"]')
    element = driver.find_element_by_xpath(
        '//button[@ix-auto="action__Configure_S3"]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(1)
    assert wait_on_element(driver, 5,
                           '//mat-checkbox[@ix-auto="checkbox__enable__SSH"]')
    value_exist = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__enable__SSH"]', 'class',
        'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__enable__SSH"]').click()
    assert wait_on_element(driver, 5, '//div[@ix-auto="overlay__stateSSH"]',
                           'clickable')
    value_exist = attribute_value_exist(
        driver, '//mat-slide-toggle[@ix-auto="slider__state__SSH"]', 'class',
        'mat-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//div[@ix-auto="overlay__stateSSH"]').click()
    time.sleep(1)
Exemplo n.º 3
0
def create_smb_share_with_path_tankrtacltest1share(driver, path):
    """Create SMB share with path tank/rt-acl-test-1/share."""
    assert wait_on_element(driver, 10,
                           '//mat-list-item[@ix-auto="option__Shares"]',
                           'clickable')
    driver.find_element_by_xpath(
        '//mat-list-item[@ix-auto="option__Shares"]').click()
    assert wait_on_element(driver, 5, '//div[contains(.,"Shares")]')
    assert wait_on_element(
        driver, 7,
        '//mat-card[contains(.,"Windows (SMB) Shares")]//button[contains(.,"Add")]',
        'clickable')
    driver.find_element_by_xpath(
        '//mat-card[contains(.,"Windows (SMB) Shares")]//button[contains(.,"Add")]'
    ).click()
    assert wait_on_element(driver, 5, '//h3[contains(text(),"Add SMB")]')
    global smb_path
    smb_path = path
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__path"]',
                           'inputable')
    driver.find_element_by_xpath('//input[@ix-auto="input__path"]').clear()
    driver.find_element_by_xpath('//input[@ix-auto="input__path"]').send_keys(
        path)
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__Name"]',
                           'inputable')
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').clear()
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').send_keys(
        "rt-test")
    assert wait_on_element(driver, 5,
                           '//mat-checkbox[@ix-auto="checkbox__Enabled"]',
                           'clickable')
    checkbox_checked = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
    if not checkbox_checked:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__Enabled"]').click()
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
    time.sleep(1)
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__Description"]',
                           'inputable')
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__Description"]').clear()
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__Description"]').send_keys("rt-test")
    assert wait_on_element(driver, 5, '//button[@ix-auto="button__SAVE"]',
                           'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
    assert wait_on_element_disappear(driver, 15,
                                     '//h6[contains(.,"Please wait")]')
    if is_element_present(driver, '//h1[contains(., "Enable service")]'):
        driver.find_element_by_xpath(
            '//button[@ix-auto="button__ENABLE SERVICE"]').click()
        assert wait_on_element(driver, 5, '//h1[contains(., "SMB Service")]')
        driver.find_element_by_xpath(
            '//button[@ix-auto="button__CLOSE"]').click()
Exemplo n.º 4
0
def set_path_to_the_ldap_dataset_mnttankwheel_dataset_input_wheelsmbshare_as_name_click_to_enable_input_test_wheel_smb_share_as_description_and_click_summit(
        driver, path, smbname, description):
    """Set Path to the LDAP dataset {path}, Input {smbname} as name, Click to enable, Input {description} as description, and Click Summit."""
    assert wait_on_element(driver, 5, '//h3[contains(text(),"Add SMB")]')
    global smb_path
    smb_path = path
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__path"]',
                           'inputable')
    driver.find_element_by_xpath('//input[@ix-auto="input__path"]').clear()
    driver.find_element_by_xpath('//input[@ix-auto="input__path"]').send_keys(
        path)
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__Name"]',
                           'inputable')
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').clear()
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').send_keys(
        smbname)
    assert wait_on_element(driver, 5,
                           '//mat-checkbox[@ix-auto="checkbox__Enabled"]',
                           'clickable')
    checkbox_checked = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
    if not checkbox_checked:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__Enabled"]').click()
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
    time.sleep(1)
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__Description"]',
                           'inputable')
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__Description"]').clear()
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__Description"]').send_keys(description)
    assert wait_on_element(driver, 5, '//button[@ix-auto="button__SAVE"]',
                           'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
    assert wait_on_element_disappear(driver, 15,
                                     '//h6[contains(.,"Please wait")]')
    if is_element_present(driver,
                          '//button[@ix-auto="button__ENABLE SERVICE"]'):
        wait_on_element(driver, 5,
                        '//button[@ix-auto="button__ENABLE SERVICE"]',
                        'clickable')
        driver.find_element_by_xpath(
            '//button[@ix-auto="button__ENABLE SERVICE"]').click()
    if is_element_present(driver, '//button[@ix-auto="button__CLOSE"]'):
        wait_on_element(driver, 5, '//button[@ix-auto="button__CLOSE"]',
                        'clickable')
        driver.find_element_by_xpath(
            '//button[@ix-auto="button__CLOSE"]').click()
Exemplo n.º 5
0
def input_mysmbshare_as_name_click_to_enable(driver, smbname):
    """Input "mysmbshare" as name, Click to enable."""
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__Name"]')
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').clear()
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').send_keys(
        smbname)
    checkbox_checked = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
    if not checkbox_checked:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__Enabled"]').click()
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
Exemplo n.º 6
0
def reopen_the_user_edit_page_and_verify_sshkey_was_saved(driver, ssh_key):
    """reopen the user edit page and verify sshkey was saved.."""
    time.sleep(4)
    assert wait_on_element(driver, 7, '//div[contains(.,"Users")]')
    assert wait_on_element(driver, 10, '//tr[@ix-auto="expander__root"]/td',
                           'clickable')
    driver.find_element_by_xpath('//tr[@ix-auto="expander__root"]/td').click()
    time.sleep(2)
    assert wait_on_element(driver, 10,
                           '//button[@ix-auto="button__EDIT_root"]',
                           'clickable')
    driver.find_element_by_xpath(
        '//button[@ix-auto="button__EDIT_root"]').click()
    time.sleep(2)
    assert wait_on_element(
        driver, 5, '//div[@ix-auto="textarea__SSH Public Key"]/div/textarea',
        'inputable')
    assert attribute_value_exist(
        driver, '//div[@ix-auto="textarea__SSH Public Key"]/div/textarea',
        'value', ssh_key)
    ## return to dashboard
    time.sleep(1)
    assert wait_on_element(driver, 10, '//*[@id="close-icon"]', 'clickable')
    driver.find_element_by_xpath('//*[@id="close-icon"]').click()
    time.sleep(1)
    assert wait_on_element(driver, 10,
                           '//mat-list-item[@ix-auto="option__Dashboard"]',
                           'clickable')
    driver.find_element_by_xpath(
        '//mat-list-item[@ix-auto="option__Dashboard"]').click()
    time.sleep(1)
Exemplo n.º 7
0
def reopen_the_user_edit_page_and_verify_sshkey_was_saved(driver, ssh_key):
    """reopen the user edit page and verify sshkey was saved.."""
    assert wait_on_element(driver, 7, '//div[contains(.,"Users")]')
    assert wait_on_element(driver, 10, '//tr[contains(.,"ericbsd")]//mat-icon',
                           'clickable')
    driver.find_element_by_xpath(
        '//tr[contains(.,"ericbsd")]//mat-icon').click()
    assert wait_on_element(
        driver, 10,
        '(//tr[contains(.,"ericbsd")]/following-sibling::ix-user-details-row)[1]//button[contains(.,"Edit")]',
        'clickable')
    driver.find_element_by_xpath(
        '(//tr[contains(.,"ericbsd")]/following-sibling::ix-user-details-row)[1]//button[contains(.,"Edit")]'
    ).click()
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    assert wait_on_element_disappear(driver, 10,
                                     '//h6[contains(.,"Please wait")]')
    assert wait_on_element(
        driver, 5, '//ix-textarea[@formcontrolname = "sshpubkey"]//textarea',
        'inputable')
    assert attribute_value_exist(
        driver, '//ix-textarea[@formcontrolname = "sshpubkey"]//textarea',
        'value', ssh_key)
    time.sleep(0.5)
    assert wait_on_element(driver, 10, '//*[@id="ix-close-icon"]', 'clickable')
    driver.find_element_by_xpath('//*[@id="ix-close-icon"]').click()
Exemplo n.º 8
0
def the_user_edit_page_should_open_change_disable_password_to_yes_and_click_save(
        driver):
    """the User Edit Page should open, change "Disable Password" to Yes and click save."""
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    assert wait_on_element_disappear(driver, 10,
                                     '//h6[contains(.,"Please wait")]')
    #driver.find_element_by_xpath('//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle/label').click()
    assert wait_on_element(
        driver, 3,
        '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle/label',
        'clickable')
    driver.find_element_by_xpath(
        '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle/label'
    ).click()
    value_exist = attribute_value_exist(
        driver,
        '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle',
        'class', 'mat-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle/label'
        ).click()
    wait_on_element(driver, 10, '//button[span[contains(.,"Save")]]',
                    'clickable')
    driver.find_element_by_xpath('//button[span[contains(.,"Save")]]').click()
Exemplo n.º 9
0
def click_advanced_options_then_click_enable_checkbox_then_check_samba_schema_select_on_for_encryption_mode_then_click_save(
        driver):
    """click Advanced Options, then click Enable checkbox, then check Samba Schema, select ON for Encryption Mode, then click save."""
    assert wait_on_element(driver, 10,
                           '//mat-checkbox[@ix-auto="checkbox__Enable"]',
                           'clickable')
    driver.find_element_by_xpath(
        '//mat-checkbox[@ix-auto="checkbox__Enable"]').click()
    assert wait_on_element(driver, 10,
                           '//span[contains(text(),"Advanced Options")]',
                           'clickable')
    driver.find_element_by_xpath(
        '//span[contains(text(),"Advanced Options")]').click()
    assert wait_on_element(
        driver, 5, '//mat-checkbox[contains(@ix-auto, "Samba Schema")]',
        'clickable')
    checkbox_checked = attribute_value_exist(
        driver, '//mat-checkbox[contains(@ix-auto, "Samba Schema")]', 'class',
        'mat-checkbox-checked')
    if not checkbox_checked:
        driver.find_element_by_xpath(
            '//mat-checkbox[contains(@ix-auto, "Samba Schema")]').click()
    time.sleep(5)
    driver.find_element_by_xpath(
        '//mat-select[@ix-auto="select__Encryption Mode"]').click()
    assert wait_on_element(driver, 10, '//span[contains(.,"ON")]', 'clickable')
    driver.find_element_by_xpath(
        '//mat-option[@ix-auto="option__Encryption Mode_ON"]').click()
    element = driver.find_element_by_xpath(
        '//span[contains(text(),"Basic Options")]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    assert wait_on_element(driver, 5, '//button[@ix-auto="button__SAVE"]',
                           'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
Exemplo n.º 10
0
def the_user_edit_page_should_open_change_disable_password_to_no_and_click_save(
        driver):
    """the User Edit Page should open, change "Disable Password" to No and click save."""
    assert wait_on_element_disappear(driver, 10,
                                     '//h6[contains(.,"Please wait")]')
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    assert wait_on_element(
        driver, 3,
        '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle/label',
        'clickable')
    driver.find_element_by_xpath(
        '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle/label'
    ).click()
    value_exist = attribute_value_exist(
        driver,
        '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle',
        'class', 'mat-checked')
    if value_exist:
        driver.find_element_by_xpath(
            '//ix-slide-toggle[@formcontrolname="password_disabled"]//mat-slide-toggle/label'
        ).click()
    element = driver.find_element_by_xpath(
        '//button[span[contains(.,"Save")]]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    assert wait_on_element(driver, 10, '//button[span[contains(.,"Save")]]',
                           'clickable')
    driver.find_element_by_xpath('//button[span[contains(.,"Save")]]').click()
    time.sleep(1)
Exemplo n.º 11
0
def click_the_interface_field_uncheck_dhcp_and_click_add_and_enter_ip_and_click_apply(
        driver, nas_ip):
    """click the interface field, uncheck dhcp and click add and enter IP and click Apply.."""
    driver.find_element_by_xpath('//mat-icon[@id="enp0s8"]').click()
    assert wait_on_element(driver, 7,
                           '//mat-checkbox[@ix-auto="checkbox__DHCP"]',
                           'clickable')
    if attribute_value_exist(driver,
                             '//mat-checkbox[@ix-auto="checkbox__DHCP"]',
                             'class', 'mat-checkbox-checked'):
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__DHCP"]').click()
    assert wait_on_element(driver, 7,
                           '//button[@ix-auto="button__add-box_aliases"]',
                           'clickable')
    driver.find_element_by_xpath(
        '//button[@ix-auto="button__add-box_aliases"]').click()
    assert wait_on_element(driver, 7, '//div[contains(.,"IP Address")]')
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__IP Address"]').clear()
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__IP Address"]').send_keys(nas_ip)
    driver.find_element_by_xpath(
        '//mat-select[@ix-auto="input__IP Address"]').click()
    assert wait_on_element(driver, 10, '//span[contains(.,"22")]')
    driver.find_element_by_xpath('//mat-option[@ix-auto="option__22"]').click()
    assert wait_on_element(driver, 7, '//button[@ix-auto="button__APPLY"]',
                           'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__APPLY"]').click()
Exemplo n.º 12
0
def public_key_should_be_on_the_root_user_page(driver, ssh_key):
    """Public key should be on the root user page."""
    assert wait_on_element(driver, 1, 5, '//h4[contains(.,"Identification")]')
    assert wait_on_element(driver, 0.5, 5,
                           '//textarea[@placeholder="SSH Public Key"]')
    assert attribute_value_exist(driver,
                                 '//textarea[@placeholder="SSH Public Key"]',
                                 'value', ssh_key)
Exemplo n.º 13
0
def public_key_should_be_on_the_root_user_page(driver, ssh_key):
    """Public key should be on the root user page."""
    assert wait_on_element(driver, 1, 5, '//div[@ix-auto="textarea__SSH Public Key"]/div/textarea')
    assert attribute_value_exist(driver, '//div[@ix-auto="textarea__SSH Public Key"]/div/textarea', 'value', ssh_key)
    assert wait_on_element(driver, 1, 5, '//mat-icon[contains(.,"cancel")]')
    driver.find_element_by_xpath('//mat-icon[contains(.,"cancel")]').click()
    assert wait_on_element(driver, 1, 7, '//div[contains(.,"Users")]')
    assert wait_on_element(driver, 0.5, 10, '//td[contains(.,"root")]')
Exemplo n.º 14
0
def the_changed_permissions_should_be_what_they_were_changed_to(driver):
    """The changed permissions should be what they were changed to."""
    assert wait_on_element(
        driver, 5, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]',
        'clickable')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerWrite"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerRead"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerExec"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupRead"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupExec"]',
        'class', 'mat-checkbox-checked') is False
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherRead"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherWrite"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherExec"]',
        'class', 'mat-checkbox-checked') is False
    # setting back the original permission for future test
    assert wait_on_element(
        driver, 5, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]',
        'clickable')
    driver.find_element_by_xpath(
        '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]').click()
    driver.find_element_by_xpath(
        '//mat-checkbox[@ix-auto="checkbox__home_mode_groupExec"]').click()
    driver.find_element_by_xpath(
        '//mat-checkbox[@ix-auto="checkbox__home_mode_otherWrite"]').click()
    driver.find_element_by_xpath(
        '//mat-checkbox[@ix-auto="checkbox__home_mode_otherExec"]').click()
    assert wait_on_element(driver, 5, '//button[@ix-auto="button__SAVE"]')
    driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
    assert wait_on_element_disappear(driver, 20,
                                     '//h6[contains(.,"Please wait")]')
    assert wait_on_element(driver, 5, '//div[contains(.,"Users")]')
    assert wait_on_element(driver, 10, '//td[contains(.,"ericbsd")]')
Exemplo n.º 15
0
def reopen_the_user_edit_page_and_verify_all_permissions_are_save_properly(
        driver):
    """reopen the user edit page and verify all permissions are save properly."""
    assert wait_on_element_disappear(driver, 60,
                                     '//h6[contains(.,"Please wait")]')
    assert wait_on_element(driver, 7, '//div[contains(.,"Users")]')
    assert wait_on_element(driver, 10, '//tr[contains(.,"ericbsd")]//mat-icon',
                           'clickable')
    driver.find_element_by_xpath(
        '//tr[contains(.,"ericbsd")]//mat-icon').click()
    assert wait_on_element(
        driver, 10,
        '(//tr[contains(.,"ericbsd")]/following-sibling::ix-user-details-row)[1]//button[contains(.,"Edit")]',
        'clickable')
    driver.find_element_by_xpath(
        '(//tr[contains(.,"ericbsd")]/following-sibling::ix-user-details-row)[1]//button[contains(.,"Edit")]'
    ).click()
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    assert wait_on_element_disappear(driver, 10,
                                     '//h6[contains(.,"Please wait")]')
    time.sleep(1)
    assert wait_on_element(
        driver, 2, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerWrite"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerRead"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerExec"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupRead"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupExec"]',
        'class', 'mat-checkbox-checked') is False
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherRead"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherWrite"]',
        'class', 'mat-checkbox-checked')
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherExec"]',
        'class', 'mat-checkbox-checked') is False
Exemplo n.º 16
0
def click_on_smb_start_automatically_checkbox(driver):
    """Click on SMB Start Automatically checkbox."""
    value_exist = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__SMB_Start Automatically"]',
        'class', 'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__SMB_Start Automatically"]'
        ).click()
Exemplo n.º 17
0
def smb_should_be_added(driver):
    """"smbname should be added."""
    assert wait_on_element(driver, 5,
                           '//mat-panel-title//h5//a[contains(.,"(SMB)")]')
    assert wait_on_element(driver, 5, '//div[contains(.,"wheelsmbshare")]')
    # Make sure SMB is started
    assert wait_on_element(
        driver, 10, '//mat-list-item[@ix-auto="option__System Settings"]',
        'clickable')
    driver.find_element_by_xpath(
        '//mat-list-item[@ix-auto="option__System Settings"]').click()
    time.sleep(1)
    assert wait_on_element(
        driver, 10,
        '//*[contains(@class,"lidein-nav-md")]//mat-list-item[@ix-auto="option__Services"]',
        'clickable')
    driver.find_element_by_xpath(
        '//*[contains(@class,"lidein-nav-md")]//mat-list-item[@ix-auto="option__Services"]'
    ).click()
    assert wait_on_element(driver, 7, '//services')
    assert wait_on_element(driver, 5, '//td[contains(text(),"Dynamic DNS")]')
    # Scroll to SSH service
    element = driver.find_element_by_xpath(
        '//td[contains(text(),"Dynamic DNS")]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(0.5)
    assert wait_on_element(driver, 5, '//tr[contains(.,"SMB")]//mat-checkbox')
    value_exist = attribute_value_exist(
        driver, '//tr[contains(.,"SMB")]//mat-checkbox', 'class',
        'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//tr[contains(.,"SMB")]//mat-checkbox').click()
    assert wait_on_element(driver, 5,
                           '//tr[contains(.,"SMB")]//mat-slide-toggle/label',
                           'clickable')
    value_exist = attribute_value_exist(
        driver, '//tr[contains(.,"SMB")]//mat-slide-toggle', 'class',
        'mat-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//tr[contains(.,"SMB")]//mat-slide-toggle/label').click()
    # This sleep is to make sure that the NAS VM is ready for the step
    time.sleep(2)
Exemplo n.º 18
0
def click_the_checkbox_log_in_as_root_with_password(driver):
    """click the checkbox "Log in as root with password"."""
    value_exist = attribute_value_exist(
        driver,
        '//mat-checkbox[@ix-auto="checkbox__Log in as Root with Password"]',
        'class', 'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__Log in as Root with Password"]'
        ).click()
Exemplo n.º 19
0
def set_path_to_the_acl_dataset_mntsystemkmy_acl_dataset_input_mysmbshare_as_name_click_to_enable_input_my_smb_test_share_as_description_and_click_summit(
        driver, path, smbname, description):
    """Set Path to the ACL dataset "{path}", Input "{smbname}" as name, Click to enable, Input "{description}" as description, and Click Summit."""
    assert wait_on_element(driver, 5, '//h3[contains(text(),"Add SMB")]')
    global smb_path
    smb_path = path
    """Set Path to the ACL dataset "/mnt/system/my_acl_dataset"."""
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__path"]',
                           'inputable')
    driver.find_element_by_xpath('//input[@ix-auto="input__path"]').clear()
    driver.find_element_by_xpath('//input[@ix-auto="input__path"]').send_keys(
        path)
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__Name"]',
                           'inputable')
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').clear()
    driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').send_keys(
        smbname)
    assert wait_on_element(driver, 5,
                           '//mat-checkbox[@ix-auto="checkbox__Enabled"]',
                           'clickable')
    checkbox_checked = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
    if not checkbox_checked:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__Enabled"]').click()
    assert attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Enabled"]', 'class',
        'mat-checkbox-checked')
    time.sleep(1)
    assert wait_on_element(driver, 5, '//input[@ix-auto="input__Description"]',
                           'inputable')
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__Description"]').clear()
    driver.find_element_by_xpath(
        '//input[@ix-auto="input__Description"]').send_keys(description)
    assert wait_on_element(driver, 5, '//button[@ix-auto="button__SAVE"]',
                           'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
    assert wait_on_element_disappear(driver, 15,
                                     '//h6[contains(.,"Please wait")]')
    time.sleep(2)
Exemplo n.º 20
0
def the_edit_permissions_page_should_open_select_eturgeon_for_user_click_on_the_apply_user_checkbox_then_select_eturgeon_for_group_name_click_on_the_apply_group_checkbox_and_click_the_save_button(driver):
    """the Edit Permissions page should open, select eturgeon for User, click on the Apply User checkbox, then select eturgeon for Group name, click on the Apply Group checkbox, and click the Save button."""
    assert wait_on_element(driver, 5, '//mat-card-title[contains(text(),"Unix Permissions Editor")]')
    assert wait_on_element(driver, 5, '//input[@data-placeholder="User"]', 'inputable')
    driver.find_element_by_xpath('//input[@data-placeholder="User"]').clear()
    driver.find_element_by_xpath('//input[@data-placeholder="User"]').send_keys('eturgeon')
    assert wait_on_element(driver, 5, '//span[contains(text(),"eturgeon")]', 'clickable')    
    driver.find_element_by_xpath('//span[contains(text(),"eturgeon")]').click()
    assert wait_on_element(driver, 5, '//input[@data-placeholder="Group"]', 'inputable')
    driver.find_element_by_xpath('//input[@data-placeholder="Group"]').clear()
    driver.find_element_by_xpath('//input[@data-placeholder="Group"]').send_keys('eturgeon')
    assert wait_on_element(driver, 5, '//span[contains(text(),"eturgeon")]', 'clickable')    
    driver.find_element_by_xpath('//span[contains(text(),"eturgeon")]').click()
    checkbox_checked = attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__Apply User"]', 'class', 'mat-checkbox-checked')
    if not checkbox_checked:
        driver.find_element_by_xpath('//mat-checkbox[@ix-auto="checkbox__Apply User"]').click()
    checkbox_checked = attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__Apply Group"]', 'class', 'mat-checkbox-checked')
    if not checkbox_checked:
        driver.find_element_by_xpath('//mat-checkbox[@ix-auto="checkbox__Apply Group"]').click()
    assert wait_on_element(driver, 5, '//span[contains(text(),"Save")]', 'clickable')    
    driver.find_element_by_xpath('//span[contains(text(),"Save")]').click()
Exemplo n.º 21
0
def on_the_services_page_verify_ssh_is_enabled(driver):
    """on the Services page, verify SSH is enabled."""
    assert wait_on_element(driver, 10, '//h1[text()="Services"]')
    assert wait_on_element(driver, 5, '//tr[contains(.,"S3")]//button',
                           'clickable')
    element = driver.find_element_by_xpath('//tr[contains(.,"S3")]//button')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    assert wait_on_element(driver, 5,
                           '//tr[contains(.,"SSH")]//mat-slide-toggle/label',
                           'clickable')
    assert attribute_value_exist(driver,
                                 '//tr[contains(.,"SSH")]//mat-slide-toggle',
                                 'class', 'mat-checked')
Exemplo n.º 22
0
def click_the_checkbox_log_in_as_root_with_password(driver):
    """click the checkbox "Log in as root with password"."""
    assert wait_on_element(
        driver, 10,
        '//ix-checkbox[@formcontrolname="rootlogin"]//mat-checkbox',
        'clickable')
    time.sleep(0.5)
    value_exist = attribute_value_exist(
        driver, '//ix-checkbox[@formcontrolname="rootlogin"]//mat-checkbox',
        'class', 'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//ix-checkbox[@formcontrolname="rootlogin"]//mat-checkbox').click(
            )
Exemplo n.º 23
0
def reopen_the_user_edit_page_and_verify_all_permissions_are_save_properly(driver):
    """reopen the user edit page and verify all permissions are save properly."""
    time.sleep(4)
    assert wait_on_element(driver, 7, '//div[contains(.,"Users")]')
    assert wait_on_element(driver, 10, '//tr[@ix-auto="expander__ericbsd"]/td', 'clickable')
    driver.find_element_by_xpath('//tr[@ix-auto="expander__ericbsd"]/td').click()
    time.sleep(1)
    assert wait_on_element(driver, 10, '//button[@ix-auto="button__EDIT_ericbsd"]', 'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__EDIT_ericbsd"]').click()
    time.sleep(2)
    assert wait_on_element(driver, 2, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerWrite"]', 'class', 'mat-checkbox-checked')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerRead"]', 'class', 'mat-checkbox-checked')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_ownerExec"]', 'class', 'mat-checkbox-checked')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupRead"]', 'class', 'mat-checkbox-checked')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupWrite"]', 'class', 'mat-checkbox-checked')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_groupExec"]', 'class', 'mat-checkbox-checked') is False
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherRead"]', 'class', 'mat-checkbox-checked')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherWrite"]', 'class', 'mat-checkbox-checked')
    assert attribute_value_exist(driver, '//mat-checkbox[@ix-auto="checkbox__home_mode_otherExec"]', 'class', 'mat-checkbox-checked') is False
Exemplo n.º 24
0
def click_enable_permit_sudo_checkbox_and_click_save(driver):
    """click Enable Permit Sudo checkbox and click save."""
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    element = driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(5)
    value_exist = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Permit Sudo"]', 'class',
        'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//mat-checkbox[@ix-auto="checkbox__Permit Sudo"]').click()
    wait_on_element(driver, 10, '//button[@ix-auto="button__SAVE"]',
                    'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
Exemplo n.º 25
0
def updated_value_should_be_visible(driver):
    """updated value should be visible."""
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    assert wait_on_element_disappear(driver, 10,
                                     '//h6[contains(.,"Please wait")]')
    element = driver.find_element_by_xpath(
        '//button[span[contains(.,"Save")]]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(0.5)
    assert attribute_value_exist(
        driver, '//ix-checkbox[@formcontrolname = "sudo"]//mat-checkbox',
        'class', 'mat-checkbox-checked')
    assert wait_on_element(driver, 10, '//*[@id="ix-close-icon"]', 'clickable')
    driver.find_element_by_xpath('//*[@id="ix-close-icon"]').click()
    time.sleep(0.5)
Exemplo n.º 26
0
def updated_value_should_be_visible(driver):
    """updated value should be visible."""
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    element = driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(0.5)
    value_exist = attribute_value_exist(
        driver, '//mat-checkbox[@ix-auto="checkbox__Permit Sudo"]', 'class',
        'mat-checkbox-checked')
    assert wait_on_element(driver, 10, '//*[@id="close-icon"]', 'clickable')
    driver.find_element_by_xpath('//*[@id="close-icon"]').click()
    assert wait_on_element(driver, 10,
                           '//mat-list-item[@ix-auto="option__Dashboard"]',
                           'clickable')
    driver.find_element_by_xpath(
        '//mat-list-item[@ix-auto="option__Dashboard"]').click()
    time.sleep(1)
Exemplo n.º 27
0
def click_enable_permit_sudo_checkbox_and_click_save(driver):
    """click Enable Permit Sudo checkbox and click save."""
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    assert wait_on_element_disappear(driver, 10,
                                     '//h6[contains(.,"Please wait")]')
    element = driver.find_element_by_xpath(
        '//button[span[contains(.,"Save")]]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(5)
    value_exist = attribute_value_exist(
        driver, '//ix-checkbox[@formcontrolname = "sudo"]//mat-checkbox',
        'class', 'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//ix-checkbox[@formcontrolname = "sudo"]//mat-checkbox').click()
    wait_on_element(driver, 10, '//button[span[contains(.,"Save")]]',
                    'clickable')
    driver.find_element_by_xpath('//button[span[contains(.,"Save")]]').click()
Exemplo n.º 28
0
def if_the_smb_serivce_is_not_started_start_the_service(driver):
    """If the SMB serivce is not started start the service."""
    assert wait_on_element(driver, 5, '//services')
    assert wait_on_element(driver, 5,
                           '//button[@ix-auto="button__S3_Actions"]')
    # Scroll to SMB service
    element = driver.find_element_by_xpath(
        '//button[@ix-auto="button__S3_Actions"]')
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(1)
    driver.find_element_by_xpath('//div[@ix-auto="value__SMB"]')
    value_exist = attribute_value_exist(
        driver, '//mat-slide-toggle[@ix-auto="slider__SMB_Running"]', 'class',
        'mat-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//div[@ix-auto="overlay__SMB_Running"]').click()
    time.sleep(2)
Exemplo n.º 29
0
def click_the_checkbox_log_in_as_root_with_password(driver):
    """click the checkbox "Log in as root with password"."""
    assert wait_on_element(
        driver, 5,
        '//mat-checkbox[contains(.,"Log in as Root with Password")]',
        'clickable')
    time.sleep(0.5)
    value_exist = attribute_value_exist(
        driver, '//mat-checkbox[contains(.,"Log in as Root with Password")]',
        'class', 'mat-checkbox-checked')
    if not value_exist:
        driver.find_element_by_xpath(
            '//mat-checkbox[contains(.,"Log in as Root with Password")]'
        ).click()
    wait_for_value = wait_for_attribute_value(
        driver, 7,
        '//mat-checkbox[contains(.,"Log in as Root with Password")]', 'class',
        'mat-checkbox-checked')
    assert wait_for_value
Exemplo n.º 30
0
def the_directory_services_page_should_open_then_click_ldap_settings_button(
        driver):
    """the Directory Services page should open, then click LDAP settings button."""
    # Verify the page is starting to load
    assert wait_on_element(driver, 5, '//h1[text()="Directory Services"]')
    time.sleep(1)
    # First we have to disable AD
    assert wait_on_element(driver, 5,
                           '//mat-card//span[contains(text(),"Settings")]',
                           'clickable')
    driver.find_element_by_xpath(
        '//mat-card//span[contains(text(),"Settings")]').click()
    # Verify the box is starting to load
    assert wait_on_element(driver, 5, '//h3[text()="Active Directory"]')
    assert wait_on_element(
        driver, 5,
        '//mat-checkbox[contains(@ix-auto, "Enable (requires password")]',
        'clickable')
    checkbox_checked = attribute_value_exist(
        driver,
        '//mat-checkbox[contains(@ix-auto, "Enable (requires password")]',
        'class', 'mat-checkbox-checked')
    # The checkbox should be checked
    if checkbox_checked:
        driver.find_element_by_xpath(
            '//mat-checkbox[contains(@ix-auto, "Enable (requires password")]'
        ).click()
    assert wait_on_element(driver, 5, '//span[contains(text(),"Save")]',
                           'clickable')
    driver.find_element_by_xpath('//span[contains(text(),"Save")]').click()
    assert wait_on_element_disappear(driver, 15,
                                     '//h6[contains(.,"Please wait")]')
    # Make sure Active Directory and LDAP are both disabled
    assert wait_on_element(
        driver, 10, '//h3[text()="Active Directory and LDAP are disabled."]')
    assert wait_on_element(driver, 7,
                           '//span[contains(text(),"Configure LDAP")]',
                           'clickable')
    driver.find_element_by_xpath(
        '//span[contains(text(),"Configure LDAP")]').click()
    # Verify the LDAP box is starting to load
    assert wait_on_element(driver, 5, '//h3[text()="LDAP"]')