From 58375a9e59701026e16c51b503c10e21a328bd69 Mon Sep 17 00:00:00 2001 From: Jan Jasek Date: Mon, 28 Jul 2025 23:36:00 +0200 Subject: [PATCH] pytest-based tests fix login fixture Change-Id: Ifa7a35036e98d3801840a8326e33959c355d4328 Signed-off-by: Jan Jasek --- openstack_dashboard/test/integration_tests/config.py | 2 +- openstack_dashboard/test/selenium/conftest.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/test/integration_tests/config.py b/openstack_dashboard/test/integration_tests/config.py index 962d29b3bd..ee66cd22a7 100644 --- a/openstack_dashboard/test/integration_tests/config.py +++ b/openstack_dashboard/test/integration_tests/config.py @@ -194,7 +194,7 @@ PluginGroup = [ ThemeGroup = [ cfg.StrOpt('project_name_xpath', - default='.//*[@class="context-project"]', + default='.//*[@class="context-project"]//ancestor::ul', help='Default xpath for project name dropdown button'), cfg.ListOpt('help_sequence', default=['.//*[@class="dropdown user-menu"]', diff --git a/openstack_dashboard/test/selenium/conftest.py b/openstack_dashboard/test/selenium/conftest.py index d7579cd120..b17ff5b5d4 100644 --- a/openstack_dashboard/test/selenium/conftest.py +++ b/openstack_dashboard/test/selenium/conftest.py @@ -78,6 +78,8 @@ class Session: self.project_name_xpath) self.current_project = project_element.text if self.current_project != project: + project_element = self.driver.find_element_by_xpath( + self.project_name_xpath) project_element.click() selection = project_element.find_element_by_xpath( f'.//*[normalize-space()="{project}"]')