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()
def test_login( ovirt_driver, save_screenshot, engine_username, engine_password, engine_cert, keycloak_enabled, ): save_screenshot('welcome-screen') welcome_screen = WelcomeScreen(ovirt_driver) welcome_screen.wait_for_displayed() welcome_screen.open_administration_portal() login_screen = LoginScreen(ovirt_driver, keycloak_enabled) login_screen.wait_for_displayed() login_screen.set_user_name(engine_username) login_screen.set_user_password(engine_password) login_screen.login() webadmin_left_menu = WebAdminLeftMenu(ovirt_driver) webadmin_left_menu.wait_for_displayed() webadmin_top_menu = WebAdminTopMenu(ovirt_driver) webadmin_top_menu.wait_for_displayed() assert webadmin_left_menu.is_displayed() assert webadmin_top_menu.is_displayed()
def test_grafana(ovirt_driver, save_screenshot, engine_username, engine_password, engine_webadmin_url): ovirt_driver.driver.get(engine_webadmin_url) welcome_screen = WelcomeScreen(ovirt_driver) welcome_screen.wait_for_displayed() welcome_screen.open_monitoring_portal() grafana_login = GrafanaLoginScreen(ovirt_driver) grafana_login.wait_for_displayed() save_screenshot('grafana-login') grafana_login.use_ovirt_engine_auth() grafana = Grafana(ovirt_driver) grafana.wait_for_displayed() save_screenshot('grafana') grafana.open_dashboard('oVirt Executive Dashboards', 'Data Center Dashboard') assert not grafana.is_error_visible() save_screenshot('grafana-dashboard-1') grafana.open_dashboard('oVirt Inventory Dashboards', 'Hosts Inventory Dashboard') assert not grafana.is_error_visible() save_screenshot('grafana-dashboard-2')
def test_userportal(ovirt_driver, engine_username, engine_password): welcome_screen = WelcomeScreen(ovirt_driver) welcome_screen.wait_for_displayed() welcome_screen.open_user_portal() login_screen = LoginScreen(ovirt_driver) login_screen.wait_for_displayed() login_screen.set_user_name(engine_username) login_screen.set_user_password(engine_password) login_screen.login() vm_portal = VmPortal(ovirt_driver) vm_portal.wait_for_displayed() vm0_status = vm_portal.get_vm_status('vm0') assert vm0_status == 'Powering up' or vm0_status == 'Running'
def test_grafana( ovirt_driver, save_screenshot, engine_username, engine_password, engine_webadmin_url, user_login, engine_fqdn, ): ovirt_driver.driver.get(engine_webadmin_url) welcome_screen = WelcomeScreen(ovirt_driver) welcome_screen.wait_for_displayed() welcome_screen.open_monitoring_portal() grafana_login = GrafanaLoginScreen(ovirt_driver) grafana_login.wait_for_displayed() save_screenshot('grafana-login') grafana_login.use_ovirt_engine_auth() user_login(engine_username, engine_password) grafana = Grafana(ovirt_driver) grafana.wait_for_displayed() save_screenshot('grafana') # navigate directly to Grafana Configuration/Data Sources page ovirt_driver.driver.get( f'https://{engine_fqdn}/ovirt-engine-grafana/datasources') assert grafana.db_connection() save_screenshot('grafana-datasource-connection') grafana.open_dashboard('oVirt Executive Dashboards', '02 Data Center Dashboard') assert not grafana.is_error_visible() save_screenshot('grafana-dashboard-1') grafana.open_dashboard('oVirt Inventory Dashboards', '02 Hosts Inventory Dashboard') assert not grafana.is_error_visible() save_screenshot('grafana-dashboard-2')
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()
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()