]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Replace `data-cy` to `data-testid` 62922/head
authorsaif <samdto987@gmail.com>
Mon, 21 Apr 2025 18:47:12 +0000 (18:47 +0000)
committersaif <samdto987@gmail.com>
Fri, 25 Apr 2025 16:10:50 +0000 (16:10 +0000)
Issue: There was some inconsistency in naming attributes of cypress test IDs,  both `data-testid` and `data-cy` were being used across the code.

Changes: Replaces all `data-cy` attributes with `data-testid` to keep it consistent across the codebase.

Fixes: https://tracker.ceph.com/issues/70986
Signed-off-by: Mohammad saif <samdto987@gmail.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/configuration.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/role-mgmt.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/user-mgmt.po.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.html

index cdf7d7cb531ddef2f74ec50df4890c4ceebef69f..704f922fb548885aadbc06494b728db7985be17b 100644 (file)
@@ -22,7 +22,7 @@ export class ImagesPageHelper extends PageHelper {
     cy.get('#size').type(size);
 
     // Click the create button and wait for image to be made
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
     this.getFirstTableCell(name).should('exist');
   }
 
@@ -35,7 +35,7 @@ export class ImagesPageHelper extends PageHelper {
     cy.get('#name').clear().type(newName);
     cy.get('#size').clear().type(newSize); // click the size box and send new size
 
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
 
     this.getExpandCollapseElement(newName).click();
     cy.get('[data-testid=rbd-details-table]').contains('td', newSize);
@@ -53,7 +53,7 @@ export class ImagesPageHelper extends PageHelper {
     cy.get('[data-testid="table-action-btn"]').click({ multiple: true });
     cy.get('button.move-to-trash').click({ force: true });
 
-    cy.get('[data-cy=submitBtn] button').should('be.visible').click({ force: true });
+    cy.get('[data-testid=submitBtn] button').should('be.visible').click({ force: true });
 
     // Clicks trash tab
     cy.contains('.nav-link', 'Trash').click();
@@ -80,7 +80,7 @@ export class ImagesPageHelper extends PageHelper {
       cy.get('cds-modal #name').clear().type(newName);
     }
 
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
 
     // clicks images tab
     cy.contains('.nav-link', 'Images').click();
@@ -103,7 +103,7 @@ export class ImagesPageHelper extends PageHelper {
       this.selectOption('poolName', pool);
       cy.get('#poolName').should('have.class', 'ng-valid'); // check if pool is selected
     }
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
     // Wait for image to delete and check it is not present
 
     this.getFirstTableCell(name).should('not.exist');
index 4132387d0f1a5683ac8643d300a878c996a3884b..920d118be87e47c818fb146da103b89a58ed0ed5 100644 (file)
@@ -21,7 +21,7 @@ export class ConfigurationPageHelper extends PageHelper {
       cy.get(`#${i}`).clear();
     }
     // Clicks save button and checks that values are not present for the selected config
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
 
     cy.wait(3 * 1000);
 
@@ -64,7 +64,7 @@ export class ConfigurationPageHelper extends PageHelper {
 
     // Clicks save button then waits until the desired config is visible, clicks it,
     // then checks that each desired value appears with the desired number
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
     cy.wait(3 * 1000);
 
     // Enter config setting name into filter box
index dcc1a15921061478a760ee6e4fd269fb8dba628d..7f0617920eaa4b5b266aa0bcd87d0d5167513e79 100644 (file)
@@ -67,7 +67,7 @@ And('{string} option {string}', (action: string, labels: string) => {
 });
 
 And('I click on submit button', () => {
-  cy.get('[data-cy=submitBtn]').click();
+  cy.get('[data-testid=submitBtn]').click();
 });
 
 /**
index f7734a0e7cf03b0a5c005dd2d54c56bbbca93b21..f6bfc7f1d6e1e9fa192bd1fdfa40cf553cca0995 100644 (file)
@@ -16,7 +16,7 @@ export class RoleMgmtPageHelper extends PageHelper {
     cy.get('#description').type(description);
 
     // Click the create button and wait for role to be made
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
     cy.get('[data-testid="active-breadcrumb-item"]').should('not.have.text', 'Create');
 
     this.getFirstTableCell(name).should('exist');
@@ -31,7 +31,7 @@ export class RoleMgmtPageHelper extends PageHelper {
     cy.get('#description').clear().type(description);
 
     // Click the edit button and check new values are present in table
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
     cy.get('[data-testid="active-breadcrumb-item"]').should('not.have.text', 'Edit');
 
     this.getFirstTableCell(name).should('exist');
index fb2b791294432d294aa6444a58c3565cf66a1a5d..76679806a8835c2b602d462286c8507a09c0cc26 100644 (file)
@@ -17,7 +17,7 @@ export class UserMgmtPageHelper extends PageHelper {
     cy.get('#email').type(email);
 
     // Click the create button and wait for user to be made
-    cy.get('[data-cy=submitBtn]').click();
+    cy.get('[data-testid=submitBtn]').click();
     this.getFirstTableCell(username).should('exist');
   }
 
@@ -31,7 +31,7 @@ export class UserMgmtPageHelper extends PageHelper {
     cy.get('#email').clear().type(email);
 
     // Click the edit button and check new values are present in table
-    const editButton = cy.get('[data-cy=submitBtn]');
+    const editButton = cy.get('[data-testid=submitBtn]');
     editButton.click();
     this.getFirstTableCell(email).should('exist');
     this.getFirstTableCell(name).should('exist');
index 70a368cf71d749b25b7b51be343ee84192dc7b9d..aa161811b12289c359763f50293d39cbbe3f5392 100644 (file)
@@ -8,7 +8,7 @@
                       [disabled]="disabled"
                       [form]="form"
                       [ariaLabel]="submitText"
-                      data-cy="submitBtn"
+                      data-testid="submitBtn"
                       [buttonType]="submitBtnType">{{ submitText }}</cd-submit-button>
   </div>
 </ng-container>
@@ -26,7 +26,7 @@
                       [disabled]="disabled"
                       [form]="form"
                       [ariaLabel]="submitText"
-                      data-cy="submitBtn"
+                      data-testid="submitBtn"
                       [modalForm]="modalForm"
                       [buttonType]="submitBtnType"
                       class="w-100">{{ submitText }}</cd-submit-button>