]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: resolve e2e cephfs snapshot test flakyness 70234/head
authorPedro Gonzalez Gomez <pegonzal@ibm.com>
Wed, 15 Jul 2026 15:57:32 +0000 (17:57 +0200)
committerPedro Gonzalez Gomez <pegonzal@ibm.com>
Wed, 15 Jul 2026 16:30:56 +0000 (18:30 +0200)
Signed-off-by: Pedro Gonzalez Gomez <pegonzal@ibm.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature

index b82916fb68a9651e31e4c0d187097f0a55ffeecd..6d23de80017c57cba49d7625ff19122f7fd149c2 100644 (file)
@@ -1,5 +1,7 @@
 import { And, Then, When } from 'cypress-cucumber-preprocessor/steps';
 
+const expandedRow = () => cy.get('[data-testid="datatable-row-detail"]');
+
 // When you are clicking on an action in the table actions dropdown button
 When('I click on {string} button from the table actions', (button: string) => {
   cy.get(`[aria-label="${button}"]`).click({ force: true });
@@ -38,9 +40,20 @@ When('I select a row {string}', (row: string) => {
 });
 
 When('I select a row {string} in the expanded row', (row: string) => {
-  cy.get('[data-testid="datatable-row-detail"]').within(() => {
+  expandedRow().within(() => {
     cy.get('.cds--search-input').first().clear().type(row);
-    cy.contains(`[cdstablerow] [cdstabledata]`, row).click();
+    cy.contains('[cdstablerow] [cdstabledata]', row).should('exist').click();
+  });
+});
+
+/**
+ * Waits for an expanded-row cd-table to finish loading before row search/selection.
+ */
+And('the table in the expanded row is ready', () => {
+  expandedRow().within(() => {
+    cy.get('cd-loading-panel').should('not.exist');
+    cy.get('cd-table').should('exist');
+    cy.get('.cds--search-input').should('be.visible');
   });
 });
 
@@ -62,7 +75,10 @@ Then('I should see a table in the expanded row', () => {
 });
 
 Then('I should not see a row with {string} in the expanded row', (row: string) => {
-  cy.get('[data-testid="datatable-row-detail"]').within(() => {
+  expandedRow().within(() => {
+    cy.get('cd-loading-panel').should('not.exist');
+    cy.get('cds-icon-button.toolbar-action').first().click();
+    cy.get('cd-loading-panel').should('not.exist');
     cy.get('.cds--search-input').first().clear().type(row);
     cy.contains(`[cdstablerow] [cdstabledata]`, row).should('not.exist');
   });
index f2f80e8cc08f2846c9cc8c437c7cc172afb7460e..0b0d51133320b6b4018744e3547f22aaf3396c42 100644 (file)
@@ -37,6 +37,7 @@ Feature: CephFS Snapshot Management
         Given I am on the "cephfs" page
         When I expand the row "test_cephfs"
         And I go to the "Snapshots" tab
+        And the table in the expanded row is ready
         And I click on "Create" button from the expanded row
         And enter "snapshotName" "test_snapshot" in the carbon modal
         And I click on "Create Snapshot" button
@@ -46,7 +47,9 @@ Feature: CephFS Snapshot Management
         Given I am on the "cephfs" page
         When I expand the row "test_cephfs"
         And I go to the "Snapshots" tab
-        And I select a row "test_snapshot" in the expanded row
+        And the table in the expanded row is ready
+        Then I should see a row with "test_snapshot" in the expanded row
+        When I select a row "test_snapshot" in the expanded row
         And I click on "Clone" button from the table actions in the expanded row
         And enter "cloneName" "test_clone" in the carbon modal
         And I click on "Create Clone" button
@@ -58,6 +61,7 @@ Feature: CephFS Snapshot Management
         Given I am on the "cephfs" page
         When I expand the row "test_cephfs"
         And I go to the "Subvolumes" tab
+        And the table in the expanded row is ready
         And I select a row "test_clone" in the expanded row
         And I click on "Remove" button from the table actions in the expanded row
         And I confirm the resource "test_clone"
@@ -69,7 +73,8 @@ Feature: CephFS Snapshot Management
         Given I am on the "cephfs" page
         When I expand the row "test_cephfs"
         And I go to the "Snapshots" tab
-        And I select a row "test_snapshot" in the expanded row
+        And the table in the expanded row is ready
+        When I select a row "test_snapshot" in the expanded row
         And I click on "Remove" button from the table actions in the expanded row
         And I confirm the resource "test_snapshot"
         And I click on "Remove Snapshot" button