From c7b116f33cb68356cc61c82884084399e139616b Mon Sep 17 00:00:00 2001 From: Elena Bondarenko Date: Tue, 10 Sep 2024 15:55:32 +0200 Subject: [PATCH 1/2] Update PVC access mode choice Signed-off-by: Elena Bondarenko --- ocs_ci/ocs/ui/pvc_ui.py | 9 +++++++-- ocs_ci/ocs/ui/views.py | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ocs_ci/ocs/ui/pvc_ui.py b/ocs_ci/ocs/ui/pvc_ui.py index 8dcab5c9b01..e0097f50550 100644 --- a/ocs_ci/ocs/ui/pvc_ui.py +++ b/ocs_ci/ocs/ui/pvc_ui.py @@ -51,13 +51,18 @@ def create_pvc_ui( logger.info(f"Enter PVC name: '{pvc_name}'") self.do_send_keys(self.pvc_loc["pvc_name"], pvc_name) + ocs_version = version.get_semantic_ocs_version_from_config() logger.info("Select Access Mode") - self.do_click(self.pvc_loc[access_mode]) + if ocs_version >= version.VERSION_4_17: + if access_mode == "ReadWriteMany": + self.do_click(self.pvc_loc["access_mode_button"]) + self.do_click(self.pvc_loc["access_rwx"]) + else: + self.do_click(self.pvc_loc[access_mode]) logger.info("Select PVC size") self.do_send_keys(self.pvc_loc["pvc_size"], text=pvc_size) - ocs_version = version.get_semantic_ocs_version_from_config() if ( not self.ocp_version_full == version.VERSION_4_6 and not ocs_version == version.VERSION_4_6 diff --git a/ocs_ci/ocs/ui/views.py b/ocs_ci/ocs/ui/views.py index a3569be445f..2959a9ab445 100644 --- a/ocs_ci/ocs/ui/views.py +++ b/ocs_ci/ocs/ui/views.py @@ -566,6 +566,8 @@ "//dd[contains(text(),'{}') and @data-test-id='pvc-capacity']", By.XPATH, ), + "access_mode_button": ("button[class='pf-v5-c-menu-toggle']", By.CSS_SELECTOR), + "access_rwx": ("//li//button//*[contains(text(), 'RWX')]", By.XPATH), } pvc_4_6 = { From 3222eac0ebf18ff33f788f61b5d2d46feeeca143 Mon Sep 17 00:00:00 2001 From: Elena Bondarenko Date: Tue, 10 Sep 2024 17:56:17 +0200 Subject: [PATCH 2/2] Include 4.16 version Signed-off-by: Elena Bondarenko --- ocs_ci/ocs/ui/pvc_ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocs_ci/ocs/ui/pvc_ui.py b/ocs_ci/ocs/ui/pvc_ui.py index e0097f50550..6734d740f4c 100644 --- a/ocs_ci/ocs/ui/pvc_ui.py +++ b/ocs_ci/ocs/ui/pvc_ui.py @@ -53,7 +53,7 @@ def create_pvc_ui( ocs_version = version.get_semantic_ocs_version_from_config() logger.info("Select Access Mode") - if ocs_version >= version.VERSION_4_17: + if ocs_version >= version.VERSION_4_16: if access_mode == "ReadWriteMany": self.do_click(self.pvc_loc["access_mode_button"]) self.do_click(self.pvc_loc["access_rwx"])