-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix: ensure Cypress.stop fires all end events appropriately #31830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Pull Request Overview
This PR fixes an issue where using Cypress.stop() aborted the run before all expected runner events were fired, ensuring Test Replay works as intended.
- Updates the runner to emit the final 'end' event and remove listeners after stopping
- Adds new system tests to verify Cypress.stop() behaves correctly in before, beforeEach, test, afterEach, and after hooks
- Updates documentation and changelog to reflect the bugfix
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
system-tests/test/cypress-stop.spec.ts | Adds tests to verify proper event firing when Cypress.stop() is invoked |
system-tests/projects/cypres-stop/** | Provides test fixtures for different hook scenarios using Cypress.stop() |
packages/driver/src/cypress/runner.ts | Refactors stop handling to ensure runner events are emitted and listeners removed |
cli/CHANGELOG.md | Documents the bugfix for Cypress.stop() behavior |
Comments suppressed due to low confidence (1)
system-tests/projects/cypres-stop/package.json:1
- [nitpick] The project name 'cypres-stop' might be a typo if the intended name is 'cypress-stop'. If intentional, consider adding a note to avoid potential confusion.
{
cypress
|
Project |
cypress
|
Branch Review |
ryanm/fix/attempt-to-fix-Cypress.stop
|
Run status |
|
Run duration | 19m 23s |
Commit |
|
Committer | Matthew Schile |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
9
|
|
1232
|
|
0
|
|
32182
|
View all changes introduced in this branch ↗︎ |
UI Coverage
45.96%
|
|
---|---|
|
189
|
|
165
|
Accessibility
92.74%
|
|
---|---|
|
3 critical
9 serious
2 moderate
2 minor
|
|
697
|
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.
thank you for adding tests to cover all the hook cases.
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.
Nice job. Glad to get some system tests in there for it!
Additional details
abort
logic until after thetest:after:run:async
event is sent. This will guarantee that the necessary events are received before the run is aborted.Steps to test
Cypress.stop()
How has the user experience changed?
Test Replay is now available for all tests when
Cypress.stop()
is used.PR Tasks
cypress-documentation
?type definitions
?