From e98a1e56b706735c6812fb220f9059ac2ed1e326 Mon Sep 17 00:00:00 2001 From: Aman Agrawal <84079241+am-agrawa@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:05:27 +0530 Subject: [PATCH] Fix kebab menu locator for add capacity UI test (#10066) Signed-off-by: am-agrawa --- ocs_ci/ocs/ui/add_replace_device_ui.py | 3 +++ ocs_ci/ocs/ui/views.py | 2 +- ocs_ci/utility/localstorage.py | 2 +- .../z_cluster/cluster_expansion/test_add_capacity.py | 7 +++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ocs_ci/ocs/ui/add_replace_device_ui.py b/ocs_ci/ocs/ui/add_replace_device_ui.py index 951b95dea47..d651c64cded 100644 --- a/ocs_ci/ocs/ui/add_replace_device_ui.py +++ b/ocs_ci/ocs/ui/add_replace_device_ui.py @@ -30,9 +30,12 @@ def add_capacity_ui(self): self.do_click(self.add_capacity_ui_loc["ocs_operator"]) self.do_click(self.add_capacity_ui_loc["storage_cluster_tab"]) time.sleep(1) + logger.info("Click on kebab menu of Storage Systems") self.do_click( self.add_capacity_ui_loc["kebab_storage_cluster"], avoid_stale=True ) + self.take_screenshot() + logger.info("Click on Add Capacity button under the kebab menu") self.wait_until_expected_text_is_found( locator=self.add_capacity_ui_loc["add_capacity_button"], timeout=10, diff --git a/ocs_ci/ocs/ui/views.py b/ocs_ci/ocs/ui/views.py index 99c6eb2f7f2..bbfd6b5b07f 100644 --- a/ocs_ci/ocs/ui/views.py +++ b/ocs_ci/ocs/ui/views.py @@ -1063,7 +1063,7 @@ 'a[data-test-id="horizontal-link-Storage System"]', By.CSS_SELECTOR, ), - "kebab_storage_cluster": ('button[data-test-id="kebab-button"', By.CSS_SELECTOR), + "kebab_storage_cluster": ("//button[@data-test-id='kebab-button']", By.XPATH), "add_capacity_button": ('button[data-test-action="Add Capacity"]', By.CSS_SELECTOR), "select_sc_add_capacity": ( 'button[data-test="add-cap-sc-dropdown"]', diff --git a/ocs_ci/utility/localstorage.py b/ocs_ci/utility/localstorage.py index 2f0d3b5f99d..dab1cfabc12 100644 --- a/ocs_ci/utility/localstorage.py +++ b/ocs_ci/utility/localstorage.py @@ -152,7 +152,7 @@ def check_local_volume_local_volume_set(): return lv_or_lvs_dict -@retry(AssertionError, 12, 10, 1) +@retry(AssertionError, 15, 15, 5) def check_pvs_created(num_pvs_required): """ Verify that exact number of PVs were created and are in the Available state diff --git a/tests/functional/z_cluster/cluster_expansion/test_add_capacity.py b/tests/functional/z_cluster/cluster_expansion/test_add_capacity.py index 5b21ce07bb2..63f84cebdf8 100644 --- a/tests/functional/z_cluster/cluster_expansion/test_add_capacity.py +++ b/tests/functional/z_cluster/cluster_expansion/test_add_capacity.py @@ -16,6 +16,7 @@ skipif_stretch_cluster, skipif_hci_provider_and_client, brown_squad, + black_squad, ) from ocs_ci.framework.testlib import ( ignore_leftovers, @@ -115,7 +116,6 @@ def add_capacity_test(ui_flag=False): check_ceph_health_after_add_capacity(ceph_rebalance_timeout=5400) -@brown_squad @ignore_leftovers @polarion_id("OCS-1191") @pytest.mark.second_to_last @@ -134,6 +134,7 @@ class TestAddCapacity(ManageTest): """ @acceptance + @brown_squad def test_add_capacity_cli(self, reduce_and_resume_cluster_load): """ Add capacity on non-lso cluster via cli on Acceptance suite @@ -141,6 +142,7 @@ def test_add_capacity_cli(self, reduce_and_resume_cluster_load): add_capacity_test(ui_flag=False) @tier1 + @black_squad def test_add_capacity_ui(self, reduce_and_resume_cluster_load): """ Add capacity on non-lso cluster via UI on tier1 suite @@ -148,7 +150,6 @@ def test_add_capacity_ui(self, reduce_and_resume_cluster_load): add_capacity_test(ui_flag=True) -@brown_squad @ignore_leftovers @polarion_id("OCS-4647") @pytest.mark.second_to_last @@ -167,6 +168,7 @@ class TestAddCapacityLSO(ManageTest): """ @acceptance + @brown_squad def test_add_capacity_lso_cli(self, reduce_and_resume_cluster_load): """ Add capacity on lso cluster via CLI on Acceptance suite @@ -174,6 +176,7 @@ def test_add_capacity_lso_cli(self, reduce_and_resume_cluster_load): storage_cluster.add_capacity_lso(ui_flag=False) @tier1 + @black_squad def test_add_capacity_lso_ui(self, reduce_and_resume_cluster_load): """ Add capacity on lso cluster via UI on tier1 suite