Skip to content

Commit ebb2f72

Browse files
authored
Merge pull request ceph#62922 from saif-0987/refactor/testid-update-01
mgr/dashboard: Replace data-cy with data-testid for cypress IDs Reviewed-by: Afreen Misbah <[email protected]>
2 parents df6c185 + bb8f0ce commit ebb2f72

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.po.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class ImagesPageHelper extends PageHelper {
2222
cy.get('#size').type(size);
2323

2424
// Click the create button and wait for image to be made
25-
cy.get('[data-cy=submitBtn]').click();
25+
cy.get('[data-testid=submitBtn]').click();
2626
this.getFirstTableCell(name).should('exist');
2727
}
2828

@@ -35,7 +35,7 @@ export class ImagesPageHelper extends PageHelper {
3535
cy.get('#name').clear().type(newName);
3636
cy.get('#size').clear().type(newSize); // click the size box and send new size
3737

38-
cy.get('[data-cy=submitBtn]').click();
38+
cy.get('[data-testid=submitBtn]').click();
3939

4040
this.getExpandCollapseElement(newName).click();
4141
cy.get('[data-testid=rbd-details-table]').contains('td', newSize);
@@ -53,7 +53,7 @@ export class ImagesPageHelper extends PageHelper {
5353
cy.get('[data-testid="table-action-btn"]').click({ multiple: true });
5454
cy.get('button.move-to-trash').click({ force: true });
5555

56-
cy.get('[data-cy=submitBtn] button').should('be.visible').click({ force: true });
56+
cy.get('[data-testid=submitBtn] button').should('be.visible').click({ force: true });
5757

5858
// Clicks trash tab
5959
cy.contains('.nav-link', 'Trash').click();
@@ -80,7 +80,7 @@ export class ImagesPageHelper extends PageHelper {
8080
cy.get('cds-modal #name').clear().type(newName);
8181
}
8282

83-
cy.get('[data-cy=submitBtn]').click();
83+
cy.get('[data-testid=submitBtn]').click();
8484

8585
// clicks images tab
8686
cy.contains('.nav-link', 'Images').click();
@@ -103,7 +103,7 @@ export class ImagesPageHelper extends PageHelper {
103103
this.selectOption('poolName', pool);
104104
cy.get('#poolName').should('have.class', 'ng-valid'); // check if pool is selected
105105
}
106-
cy.get('[data-cy=submitBtn]').click();
106+
cy.get('[data-testid=submitBtn]').click();
107107
// Wait for image to delete and check it is not present
108108

109109
this.getFirstTableCell(name).should('not.exist');

src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/configuration.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class ConfigurationPageHelper extends PageHelper {
2121
cy.get(`#${i}`).clear();
2222
}
2323
// Clicks save button and checks that values are not present for the selected config
24-
cy.get('[data-cy=submitBtn]').click();
24+
cy.get('[data-testid=submitBtn]').click();
2525

2626
cy.wait(3 * 1000);
2727

@@ -64,7 +64,7 @@ export class ConfigurationPageHelper extends PageHelper {
6464

6565
// Clicks save button then waits until the desired config is visible, clicks it,
6666
// then checks that each desired value appears with the desired number
67-
cy.get('[data-cy=submitBtn]').click();
67+
cy.get('[data-testid=submitBtn]').click();
6868
cy.wait(3 * 1000);
6969

7070
// Enter config setting name into filter box

src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ And('{string} option {string}', (action: string, labels: string) => {
6767
});
6868

6969
And('I click on submit button', () => {
70-
cy.get('[data-cy=submitBtn]').click();
70+
cy.get('[data-testid=submitBtn]').click();
7171
});
7272

7373
/**

src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/role-mgmt.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class RoleMgmtPageHelper extends PageHelper {
1616
cy.get('#description').type(description);
1717

1818
// Click the create button and wait for role to be made
19-
cy.get('[data-cy=submitBtn]').click();
19+
cy.get('[data-testid=submitBtn]').click();
2020
cy.get('[data-testid="active-breadcrumb-item"]').should('not.have.text', 'Create');
2121

2222
this.getFirstTableCell(name).should('exist');
@@ -31,7 +31,7 @@ export class RoleMgmtPageHelper extends PageHelper {
3131
cy.get('#description').clear().type(description);
3232

3333
// Click the edit button and check new values are present in table
34-
cy.get('[data-cy=submitBtn]').click();
34+
cy.get('[data-testid=submitBtn]').click();
3535
cy.get('[data-testid="active-breadcrumb-item"]').should('not.have.text', 'Edit');
3636

3737
this.getFirstTableCell(name).should('exist');

src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/user-mgmt.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class UserMgmtPageHelper extends PageHelper {
1717
cy.get('#email').type(email);
1818

1919
// Click the create button and wait for user to be made
20-
cy.get('[data-cy=submitBtn]').click();
20+
cy.get('[data-testid=submitBtn]').click();
2121
this.getFirstTableCell(username).should('exist');
2222
}
2323

@@ -31,7 +31,7 @@ export class UserMgmtPageHelper extends PageHelper {
3131
cy.get('#email').clear().type(email);
3232

3333
// Click the edit button and check new values are present in table
34-
const editButton = cy.get('[data-cy=submitBtn]');
34+
const editButton = cy.get('[data-testid=submitBtn]');
3535
editButton.click();
3636
this.getFirstTableCell(email).should('exist');
3737
this.getFirstTableCell(name).should('exist');

src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[disabled]="disabled"
99
[form]="form"
1010
[ariaLabel]="submitText"
11-
data-cy="submitBtn"
11+
data-testid="submitBtn"
1212
[buttonType]="submitBtnType">{{ submitText }}</cd-submit-button>
1313
</div>
1414
</ng-container>
@@ -26,7 +26,7 @@
2626
[disabled]="disabled"
2727
[form]="form"
2828
[ariaLabel]="submitText"
29-
data-cy="submitBtn"
29+
data-testid="submitBtn"
3030
[modalForm]="modalForm"
3131
[buttonType]="submitBtnType"
3232
class="w-100">{{ submitText }}</cd-submit-button>

0 commit comments

Comments
 (0)