Skip to content

Commit c025b0f

Browse files
Fix flaky expected build test (#3622)
The expected build test has become extremely flaky recently due to unrelated test scheduling changes. The original source of the flakiness is #3366. This PR attempts to improve the robustness of this test by adding a hack to ensure that the page has reloaded properly before moving on from actions which call `window.reload()`.
1 parent 926c2ed commit c025b0f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/cypress/e2e/expected-build.cy.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ describe('expected_build', () => {
6767
cy.contains('2 build(s) selected').should('be.visible');
6868

6969
// click the "Mark as Expected" button in the bulk actions toolbar
70+
cy.window().then(w => w.beforeReload1 = true);
7071
cy.get('[data-cy="bulk-mark-expected-btn"]').click();
7172

7273
// wait for page reload
74+
cy.window().should('not.have.property', 'beforeReload1');
7375
cy.url().should('contain', 'index.php?project=InsightExample&date=2010-07-07');
7476

7577
// verify first build is now expected
@@ -96,9 +98,11 @@ describe('expected_build', () => {
9698
cy.get('#project_5_13').find('tbody').find('tr').eq(1).find('[data-cy="build-selection-checkbox"]').check();
9799

98100
// mark them as not expected
101+
cy.window().then(w => w.beforeReload2 = true);
99102
cy.get('[data-cy="bulk-mark-not-expected-btn"]').click();
100103

101104
// wait for page reload
105+
cy.window().should('not.have.property', 'beforeReload2');
102106
cy.url().should('contain', 'index.php?project=InsightExample&date=2010-07-07');
103107

104108
// verify first build is now not expected

0 commit comments

Comments
 (0)