From: Pedro Gonzalez Gomez Date: Wed, 15 Jul 2026 15:57:32 +0000 (+0200) Subject: mgr/dashboard: resolve e2e cephfs snapshot test flakyness X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=253729b9195a75883989db7c584a4c7ecba3ee4c;p=ceph.git mgr/dashboard: resolve e2e cephfs snapshot test flakyness Signed-off-by: Pedro Gonzalez Gomez --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts index b82916fb68a..6d23de80017 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts @@ -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'); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature index f2f80e8cc08..0b0d5113332 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature @@ -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