Skip to content

Commit ee52d72

Browse files
dmcintyr-akamaibnussman-akamai
authored andcommitted
tests [M3-10513] Fix for flakey test in alerts-listing-page.spec.ts (linode#12736)
* limit cypress scope to fix test * Added changeset: Fix for flakey test in alerts-listing-page.spec.ts
1 parent 6564feb commit ee52d72

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tests
3+
---
4+
5+
Fix for flakey test in alerts-listing-page.spec.ts ([#12736](https://github.com/linode/manager/pull/12736))

packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -260,24 +260,27 @@ describe('Integration Tests for CloudPulse Alerts Listing Page', () => {
260260
});
261261

262262
it('should validate UI elements and alert details', () => {
263-
// Validate navigation links and buttons
264-
cy.findByText('Alerts').should('be.visible');
263+
// filter to main content area to avoid confusion w/ 'Alerts' nav link in left sidebar
264+
cy.get('main').within(() => {
265+
// Validate breadcrumb and buttons
266+
cy.findByText('Alerts', { exact: false }).should('be.visible');
265267

266-
cy.findByText('Definitions')
267-
.should('be.visible')
268-
.and('have.attr', 'href', alertDefinitionsUrl);
269-
ui.buttonGroup.findButtonByTitle('Create Alert').should('be.visible');
268+
cy.findByText('Definitions')
269+
.should('be.visible')
270+
.and('have.attr', 'href', alertDefinitionsUrl);
271+
ui.buttonGroup.findButtonByTitle('Create Alert').should('be.visible');
270272

271-
// Validate table headers
272-
cy.get('[data-qa="alert-table"]').within(() => {
273-
expectedHeaders.forEach((header) => {
274-
cy.findByText(header).should('have.text', header);
273+
// Validate table headers
274+
cy.get('[data-qa="alert-table"]').within(() => {
275+
expectedHeaders.forEach((header) => {
276+
cy.findByText(header).should('have.text', header);
277+
});
275278
});
276-
});
277279

278-
// Validate alert details
279-
mockAlerts.forEach((alert) => {
280-
validateAlertDetails(alert);
280+
// Validate alert details
281+
mockAlerts.forEach((alert) => {
282+
validateAlertDetails(alert);
283+
});
281284
});
282285
});
283286

0 commit comments

Comments
 (0)