cypress
cypress copied to clipboard
fix: preserve navigation functionality when `unload` event is deprecated
- Closes https://github.com/cypress-io/cypress/issues/29241
Additional details
In order to prepare for Chrome's removal of the unload
event, we are migrating to using pagehide
as a proxy for internal navigation detection. In order to preserve window:unload
, for now, this event is also triggered on pagehide
. Because the event emitted on pagehide
is a superset of Event
, which is emitted on unload
, this is not a breaking change.
Future steps to support deprecation of unload
:
- Add
window:pageshow
andwindow:pagehide
events - Warn when
window:unload
is used
Steps to test
Existing tests should pass with the flags removed. To test full unload
removal, uncomment the indicated flags in packages/server/lib/util/chromium_flags.ts
.
How has the user experience changed?
window:unload
may fire both more reliably and at a slightly different point in the page lifecycle timeline. Otherwise, it should not be impacted.
PR Tasks
- [X] Have tests been added/updated?
- [NA] Has a PR for user-facing changes been opened in
cypress-documentation
? - [NA] Have API changes been updated in the
type definitions
?
1 flaky test on run #55532 ↗︎
![]() |
![]() |
![]() |
![]() |
![]() |
Details:
changelog | |||
Project: cypress | Commit: 25fd58050d |
||
Status: Passed | Duration: 15:48 💡 | ||
Started: May 22, 2024 5:49 PM | Ended: May 22, 2024 6:04 PM |
cypress/e2e/commands/querying/querying.cy.js • 1 flaky test • 5x-driver-chrome:beta
Test | Artifacts | |
---|---|---|
... > throws when alias property isnt a digit or `all` |
Test Replay
|