Skip to content

misc: rerun tests on unloadEvent instead of on beforeunload#33456

Open
mabela416 wants to merge 12 commits intodevelopfrom
mabel/issue-12584-unsaved-changes-on-refresh
Open

misc: rerun tests on unloadEvent instead of on beforeunload#33456
mabela416 wants to merge 12 commits intodevelopfrom
mabel/issue-12584-unsaved-changes-on-refresh

Conversation

@mabela416
Copy link
Contributor

@mabela416 mabela416 commented Mar 9, 2026

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 (pagehide in Chromium, unload elsewhere) rather than on beforeunload.

Adds a deferred-cleanup path for Studio unsaved changes: when a beforeunload confirmation 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 in cli/CHANGELOG.md for 15.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

@mabela416 mabela416 changed the title chore: rerun tests on unloadEvent instead of on beforeunload misc: rerun tests on unloadEvent instead of on beforeunload Mar 9, 2026
@cypress
Copy link

cypress bot commented Mar 9, 2026

cypress    Run #69333

Run Properties:  status check passed Passed #69333  •  git commit d2ff4ee0f6: update changelog entry
Project cypress
Branch Review mabel/issue-12584-unsaved-changes-on-refresh
Run status status check passed Passed #69333
Run duration 19m 23s
Commit git commit d2ff4ee0f6: update changelog entry
Committer Mabel Amaya
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 16
Tests that did not run due to a developer annotating a test with .skip  Pending 1112
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 27190
View all changes introduced in this branch ↗︎
UI Coverage  61.04%
  Untested elements 28  
  Tested elements 47  
Accessibility  98.98%
  Failed rules  0 critical   3 serious   1 moderate   0 minor
  Failed elements 18  

…nsaved-changes-on-refresh' into mabel/issue-12584-unsaved-changes-on-refresh
@mabela416 mabela416 self-assigned this Mar 9, 2026
@mabela416 mabela416 requested review from astone123 and mschile March 9, 2026 20:46
@mschile mschile requested a review from cacieprins March 9, 2026 20:48
Copy link
Contributor

@astone123 astone123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants