-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure we have marked things as stable prior to after/afterEach …
…hooks running (#30536) * fix: ensure we have marked things as stable prior to failing tests -- run ci * fix: ensure we have marked things as stable prior to failing tests -- run ci * add a test -- run ci * clean up * add changelog * Update CHANGELOG.md * Apply suggestions from code review * Update cli/CHANGELOG.md Co-authored-by: Matt Schile <mschile@cypress.io> * allow failure --------- Co-authored-by: Jennifer Shehane <jennifer@cypress.io> Co-authored-by: Matt Schile <mschile@cypress.io>
- Loading branch information
1 parent
b0b28d3
commit a8a3cb9
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
after(() => { | ||
// ensure that we're stable in the after hooks | ||
expect(cy.state('isStable')).to.be.true | ||
|
||
// ensure we can enqueue a command without timing out | ||
cy.then(() => { | ||
expect(true).to.be.true | ||
}) | ||
}) | ||
|
||
afterEach(() => { | ||
// ensure that we're stable in the after hooks | ||
expect(cy.state('isStable')).to.be.true | ||
|
||
// ensure that we can enqueue a command without timing out | ||
cy.then(() => { | ||
expect(true).to.be.true | ||
}) | ||
}) | ||
|
||
it('runs an after block without timing out when the page load times out', { pageLoadTimeout: 500 }, () => { | ||
cy.on('fail', (error) => { | ||
expect(error.message).to.include('Timed out after') | ||
|
||
return false | ||
}) | ||
|
||
cy.on('window:before:load', (win) => { | ||
// Stop the page from loading so that the page load times out | ||
win.stop() | ||
}) | ||
|
||
cy.visit('/fixtures/generic.html') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a8a3cb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
a8a3cb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux arm64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
a8a3cb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin arm64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
a8a3cb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
win32 x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
a8a3cb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally: