From 3804e8e21f834184a4686e4f2843aa6c79b5507d Mon Sep 17 00:00:00 2001 From: Jan Jasek Date: Thu, 16 May 2024 11:42:39 +0200 Subject: [PATCH] pytest-based selenium tests add clarification of RC file naming Change-Id: I22be4b7cda5795effc698ee8853e466324a579d5 --- .../test/selenium/integration/test_credentials.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openstack_dashboard/test/selenium/integration/test_credentials.py b/openstack_dashboard/test/selenium/integration/test_credentials.py index f74d6bb29b..1ba18af8a6 100644 --- a/openstack_dashboard/test/selenium/integration/test_credentials.py +++ b/openstack_dashboard/test/selenium/integration/test_credentials.py @@ -44,8 +44,10 @@ def test_download_rc_file_admin(login, driver, config, openstack_admin, widgets.select_from_dropdown(openstack_file_dropdown, "OpenStack RC File") WebDriverWait(driver, config.selenium.page_timeout).until( lambda x: ((len(os.listdir(download_dir)) == 1) and - ("admin-openrc.sh" in os.listdir(download_dir)))) - with open(os.path.join(download_dir, "admin-openrc.sh")) as rc_file: + (f"{config.identity.admin_username}-openrc.sh" in + os.listdir(download_dir)))) + with open(os.path.join(download_dir, f"{config.identity.admin_username}-" + f"openrc.sh")) as rc_file: content = rc_file.read() username = re.search( r'export OS_USERNAME="([^"]+)"', content).group(1) @@ -74,8 +76,10 @@ def test_download_rc_file_demo(login, driver, config, openstack_admin, widgets.select_from_dropdown(openstack_file_dropdown, "OpenStack RC File") WebDriverWait(driver, config.selenium.page_timeout).until( lambda x: ((len(os.listdir(download_dir)) == 1) and - ("demo-openrc.sh" in os.listdir(download_dir)))) - with open(os.path.join(download_dir, "demo-openrc.sh")) as rc_file: + (f"{config.identity.username}-openrc.sh" in + os.listdir(download_dir)))) + with open(os.path.join(download_dir, f"{config.identity.username}-" + f"openrc.sh")) as rc_file: content = rc_file.read() username = re.search( r'export OS_USERNAME="([^"]+)"', content).group(1)