Beispiel #1
0
def test_userportal(
    ovirt_driver,
    nonadmin_username,
    nonadmin_password,
    user_login,
    engine_webadmin_url,
    save_screenshot,
):
    welcome_screen = WelcomeScreen(ovirt_driver)
    welcome_screen.wait_for_displayed()
    welcome_screen.open_user_portal()

    user_login(nonadmin_username, nonadmin_password)

    vm_portal = VmPortal(ovirt_driver)
    vm_portal.wait_for_displayed()

    # using vm0 requires logic from 002 _bootstrap::test_add_vm_permissions_to_user
    assert assert_utils.equals_within_short(vm_portal.get_vm_count, 1)
    vm0_status = vm_portal.get_vm_status('vm0')
    assert vm0_status == 'Powering up' or vm0_status == 'Running'
    save_screenshot('userportal')

    vm_portal.logout()
    save_screenshot('userportal-logout')

    welcome_screen = WelcomeScreen(ovirt_driver)
    welcome_screen.wait_for_displayed()
    assert welcome_screen.is_user_logged_out()
Beispiel #2
0
def test_logout(ovirt_driver, engine_webadmin_url):
    webadmin_menu = WebAdminTopMenu(ovirt_driver)
    webadmin_menu.wait_for_displayed()
    webadmin_menu.logout()

    webadmin_left_menu = WebAdminLeftMenu(ovirt_driver)
    webadmin_left_menu.wait_for_not_displayed()

    webadmin_top_menu = WebAdminTopMenu(ovirt_driver)
    webadmin_top_menu.wait_for_not_displayed()

    # navigate directly to welcome page to prevent problems with redirecting to login page instead of welcome page
    ovirt_driver.driver.get(engine_webadmin_url)

    welcome_screen = WelcomeScreen(ovirt_driver)
    welcome_screen.wait_for_displayed()
    assert welcome_screen.is_user_logged_out()
Beispiel #3
0
def test_non_admin_login_to_webadmin(
    ovirt_driver,
    nonadmin_username,
    nonadmin_password,
    engine_webadmin_url,
    user_login,
):
    welcome_screen = WelcomeScreen(ovirt_driver)
    welcome_screen.wait_for_displayed()
    welcome_screen.open_administration_portal()
    user_login(nonadmin_username, nonadmin_password)

    assert welcome_screen.is_error_message_displayed()
    assert 'not authorized' in welcome_screen.get_error_message()
    assert welcome_screen.is_user_logged_in(nonadmin_username)
    welcome_screen.logout()
    assert welcome_screen.is_user_logged_out()