Skip to content

Commit e8977b3

Browse files
authored
Merge pull request ceph#64680 from afreen23/cypress-suppress
mgr/dashboard: cypress tests do not fail on failures Reviewed-by: Naman Munet <[email protected]>
2 parents 15601f0 + e1366bf commit e8977b3

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Mirroring page', () => {
6060
cy.get('#password').type('admin');
6161
cy.get('[type=submit]').click();
6262

63-
cy.get('input[name=name]').clear().type(name);
63+
cy.get('[data-testid="pool-name"]').clear().type(name);
6464
cy.get(`select[name=poolType]`).select('replicated');
6565
cy.get(`select[name=poolType] option:checked`).contains('replicated');
6666
cy.get('.float-start.me-2.select-menu-edit').click();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ And('I should see row {string} of the expanded row to have a usage bar', (row: s
8888
cy.get('[data-testid="datatable-row-detail"]').within(() => {
8989
cy.get('.cds--search-input').first().clear().type(row);
9090
cy.contains(`[cdstablerow] [cdstabledata]`, row).should('exist');
91-
cy.get('[cdstablerow] [cdstabledata] cd-usage-bar .progress').should('exist');
91+
cy.get('[cdstablerow] [cdstabledata] cd-usage-bar').should('exist');
9292
});
9393
});
9494

src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/09-services.e2e-spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ describe('Services page', () => {
9898
cy.get('cd-service-details').within(() => {
9999
services.checkServiceStatus('snmp-gateway');
100100
});
101-
services.clickServiceTab('snmp-gateway', 'Daemons');
102101

103102
services.deleteService('snmp-gateway');
104103
});
@@ -112,7 +111,6 @@ describe('Services page', () => {
112111
cy.get('cd-service-details').within(() => {
113112
services.checkServiceStatus('snmp-gateway');
114113
});
115-
services.clickServiceTab('snmp-gateway', 'Daemons');
116114

117115
services.deleteService('snmp-gateway');
118116
});

src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.po.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ export class PoolPageHelper extends PageHelper {
1515

1616
@PageHelper.restrictTo(pages.create.url)
1717
create(name: string, placement_groups: number, apps: string[], mirroring = false) {
18-
cy.get('input[name=name]').clear().type(name);
18+
cy.get('[data-testid="pool-name"]').clear().type(name);
1919

2020
this.isPowerOf2(placement_groups);
2121

2222
this.selectOption('poolType', 'replicated');
2323

2424
this.expectSelectOption('pgAutoscaleMode', 'on');
2525
this.selectOption('pgAutoscaleMode', 'off'); // To show pgNum field
26-
cy.get('input[name=pgNum]').clear().type(`${placement_groups}`);
26+
cy.get('[data-testid="pgNum"]').clear().type(`${placement_groups}`);
2727
this.setApplications(apps);
2828
if (mirroring) {
29-
cy.get('#rbdMirroring').check({ force: true });
29+
cy.get('[data-testid="rbd-mirroring-check"]').check({ force: true });
3030
}
3131
cy.get('cd-submit-button').click();
3232
}
@@ -36,10 +36,10 @@ export class PoolPageHelper extends PageHelper {
3636
this.navigateEdit(name);
3737

3838
if (mirroring) {
39-
cy.get('#rbdMirroring').should('be.checked');
39+
cy.get('[data-testid="rbd-mirroring-check"]').should('be.checked');
4040
}
4141

42-
cy.get('input[name=pgNum]').clear().type(`${new_pg}`);
42+
cy.get('[data-testid="pgNum"]').clear().type(`${new_pg}`);
4343
cy.get('cd-submit-button').click();
4444
const str = `${new_pg} active+clean`;
4545
this.getTableRow(name);

src/pybind/mgr/dashboard/frontend/cypress/support/e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Cypress.on('fail', (err: Error) => {
2222
if (err.message.includes('xhr') && err.message.includes('canceled')) {
2323
return false; // Ignore canceled XHR requests
2424
}
25-
return true;
25+
throw err;
2626
});

src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
for="name"
1616
i18n>Name</label>
1717
<div class="cd-col-form-input">
18-
<input id="name"
18+
<input data-testid="pool-name"
19+
id="name"
1920
type="text"
2021
class="form-control"
2122
placeholder="Name..."
@@ -87,6 +88,7 @@
8788
<div class="cd-col-form-input">
8889
<input class="form-control"
8990
id="pgNum"
91+
data-testid="pgNum"
9092
formControlName="pgNum"
9193
min="1"
9294
type="number"
@@ -201,6 +203,7 @@
201203
<div class="custom-control custom-checkbox">
202204
<input class="custom-control-input"
203205
id="rbdMirroring"
206+
data-testid="rbd-mirroring-check"
204207
type="checkbox"
205208
formControlName="rbdMirroring">
206209
<label class="custom-control-label"

0 commit comments

Comments
 (0)