Exemplo n.º 1
0
def the_service_should_be_enabled_with_no_errors(driver):
    """the service should be enabled with no errors."""
    assert wait_on_element_disappear(driver, 30,
                                     '//mat-spinner[@role="progressbar"]')
    assert wait_for_attribute_value(
        driver, 20, '//tr[contains(.,"SSH")]//mat-slide-toggle', 'class',
        'mat-checked')
Exemplo n.º 2
0
def the_service_should_be_enabled_with_no_errors(driver):
    """the service should be enabled with no errors."""
    wait_for_value = wait_for_attribute_value(
        driver, 7, '//mat-slide-toggle[@ix-auto="slider__state__SSH"]',
        'class', 'mat-checked')
    assert wait_for_value
    driver.find_element_by_xpath(
        '//mat-list-item[@ix-auto="option__Dashboard"]').click()
    time.sleep(1)
Exemplo n.º 3
0
def verify_the_checkbox_works_and_click_save(driver):
    """verify the checkbox works and click Save."""
    wait_for_value = wait_for_attribute_value(
        driver, 5, '//ix-checkbox[@formcontrolname="rootlogin"]//mat-checkbox',
        'class', 'mat-checkbox-checked')
    assert wait_for_value
    assert wait_on_element(driver, 5, '//span[contains(text(),"Save")]',
                           'clickable')
    driver.find_element_by_xpath('//span[contains(text(),"Save")]').click()
    wait_on_element_disappear(driver, 10, '//h6[contains(.,"Please wait")]')
Exemplo n.º 4
0
def verify_the_checkbox_works_and_click_save(driver):
    """verify the checkbox works and click Save."""
    wait_for_value = wait_for_attribute_value(
        driver, 5,
        '//mat-checkbox[@ix-auto="checkbox__Log in as Root with Password"]',
        'class', 'mat-checkbox-checked')
    assert wait_for_value
    assert wait_on_element(driver, 5, '//button[@ix-auto="button__SAVE"]',
                           'clickable')
    driver.find_element_by_xpath('//button[@ix-auto="button__SAVE"]').click()
    wait_on_element_disappear(driver, 10, '//h6[contains(.,"Please wait")]')
Exemplo n.º 5
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()
    wait_for_value = wait_for_attribute_value(
        driver, 0.5, 5,
        '//mat-checkbox[@ix-auto="checkbox__Log in as Root with Password"]',
        'class', 'mat-checkbox-checked')
    assert wait_for_value
Exemplo n.º 6
0
def change_should_be_saved_reopen_the_edit_page_root_group_value_should_be_visible(
        driver):
    """change should be saved, reopen the edit page, root group value should be visible."""
    assert wait_on_element_disappear(driver, 15,
                                     '//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")]')
    assert wait_on_element(
        driver, 7, '//ix-select[@formcontrolname="groups"]//mat-select',
        'clickable')
    element = driver.find_element_by_xpath(
        '//ix-select[@formcontrolname="groups"]//mat-select')
    # Scroll to root
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(0.5)
    driver.find_element_by_xpath(
        '//ix-select[@formcontrolname="groups"]//mat-select').click()
    assert wait_on_element(driver, 7,
                           '//mat-option[span[contains(., "root")]]',
                           'clickable')
    element = driver.find_element_by_xpath('//span[contains(.,"root")]')
    # Scroll to root
    driver.execute_script("arguments[0].scrollIntoView();", element)
    time.sleep(0.5)
    wait_for_value = wait_for_attribute_value(
        driver, 5, '//mat-option[span[contains(., "root")]]', 'class',
        'mat-selected')
    assert wait_for_value
    # return to dashboard
    driver.find_element_by_xpath(
        '//mat-option[span[contains(., "root")]]').send_keys(Keys.TAB)
    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.º 7
0
def change_should_be_saved_reopen_the_edit_page_root_group_value_should_be_visible(
        driver):
    """change should be saved, reopen the edit page, root group value should be visible."""
    wait_on_element_disappear(driver, 1, '//h6[contains(.,"Please wait")]')
    time.sleep(3)
    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(3)
    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()
    assert wait_on_element(driver, 10, '//h3[contains(.,"Edit User")]')
    time.sleep(3)
    assert wait_on_element(
        driver, 7, '//mat-select[@ix-auto="select__Auxiliary Groups"]',
        'clickable')
    driver.find_element_by_xpath(
        '//mat-select[@ix-auto="select__Auxiliary Groups"]').click()
    assert wait_on_element(driver, 10, '//span[contains(.,"root")]')
    #assert wait_on_element(driver, 10, '//mat-selected[@ix-auto="option__Auxiliary Groups_root"]')
    wait_for_value = wait_for_attribute_value(
        driver, 5, '//mat-option[@ix-auto="option__Auxiliary Groups_root"]',
        'class', 'mat-selected')
    assert wait_for_value

    ## return to dashboard
    driver.find_element_by_xpath(
        '//mat-option[@ix-auto="option__Auxiliary Groups_root"]').send_keys(
            Keys.TAB)
    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.º 8
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.º 9
0
def the_service_should_be_enabled_with_no_errors(driver):
    """the service should be enabled with no errors."""
    wait_for_value = wait_for_attribute_value(
        driver, 7, '//mat-slide-toggle[@ix-auto="slider__state__SSH"]',
        'class', 'mat-checked')
    assert wait_for_value