cypress icon indicating copy to clipboard operation
cypress copied to clipboard

fix: preserve navigation functionality when `unload` event is deprecated

Open cacieprins opened this issue 9 months ago • 1 comments

  • 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 and window: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

cacieprins avatar May 15 '24 19:05 cacieprins

1 flaky test on run #55532 ↗︎

0 5557 77 0 Flakiness 1

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
Flakiness  cypress/e2e/commands/querying/querying.cy.js • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
... > throws when alias property isnt a digit or `all` Test Replay

Review all test suite changes for PR #29525 ↗︎

cypress[bot] avatar May 21 '24 19:05 cypress[bot]