misc: rerun tests on unloadEvent instead of on beforeunload#33456
Open
misc: rerun tests on unloadEvent instead of on beforeunload#33456
Conversation
cypress
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
mabel/issue-12584-unsaved-changes-on-refresh
|
| Run status |
|
| Run duration | 19m 23s |
| Commit |
|
| Committer | Mabel Amaya |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
16
|
|
|
1112
|
|
|
0
|
|
|
27190
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
61.04%
|
|
|---|---|
|
|
28
|
|
|
47
|
Accessibility
98.98%
|
|
|---|---|
|
|
0 critical
3 serious
1 moderate
0 minor
|
|
|
18
|
…nsaved-changes-on-refresh' into mabel/issue-12584-unsaved-changes-on-refresh
astone123
reviewed
Mar 11, 2026
Contributor
astone123
left a comment
There was a problem hiding this comment.
This works for me in the context of the services ticket for the unsaved changes dialog when reloading studio. Going to defer to someone who is more familiar with the app for an approval on this since it seems like a pretty fundamental change
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…nsaved-changes-on-refresh' into mabel/issue-12584-unsaved-changes-on-refresh
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/cypress-io/cypress-services/issues/12584
Additional details
Note
Medium Risk
Changes browser lifecycle handling around
beforeunload/unload/pagehide, which can affect when specs rerun and when cookies/unload state are cleared (and differs by browser family). Risk is moderate due to timing-sensitive behavior and interaction with Studio unsaved-change dialogs.Overview
Updates the runner’s unload handling so spec reruns/cleanup happen on actual page teardown (
pagehidein Chromium,unloadelsewhere) rather than onbeforeunload.Adds a deferred-cleanup path for Studio unsaved changes: when a
beforeunloadconfirmation is shown, cleanup is postponed until the unload event only if navigation proceeds, avoiding unintended reruns when the dialog is cancelled. Also documents the behavior incli/CHANGELOG.mdfor15.13.0.Written by Cursor Bugbot for commit d2ff4ee. This will update automatically on new commits. Configure here.
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation?type definitions?