Skip to content

Spike: investigate navigation and page-load gaps for experimentalWebKitSupport #34871

Description

@AtofStryker

Summary

Child of #34870.

About 39 driver tests and 5 system tests for navigation and page load are skipped on WebKit. We don't know why any of them fail. Most of the driver skips were added together in #23232 (Aug 2022) to make the new WebKit CI job pass. Nobody recorded a root cause.

These specs have not run on WebKit in our CI since January 2025. #30770 changed the WebKit driver job to a narrow specPattern that leaves them out. So the first step is to run them and see what still fails.

Related: #34869 owns cy.origin(), cross-origin navigation, and the missing reload:aut:frame / navigate:aut:history automation handlers. #24600 (flaky navigation) was closed by the stale bot in 2023. It was never fixed.

What's skipped

Driver (not run on WebKit in CI):

  • packages/driver/cypress/e2e/commands/navigation.cy.js:1911 — the #page load context, 4 tests. These check the driver's page-load machinery: the __cypress.initial cookie is set during beforeunload and cleared after load; command timeouts reset on beforeunload; the page load log goes from pending to passed; pageLoadTimeout errors fire. The cookie part overlaps the cookies spike. Find out early whether this is a cookie failure or a lifecycle failure.
  • navigation.cy.js:2312 — the #url:changed context, 15 tests. These check navigation:changed events for page navigation, hashchange, pushState, and replaceState. One test (Extra load events when AUT navigates on hashchange in latest Chrome Beta #19230) walks history.back() and forward() and asserts the exact event order. The detection code is in packages/driver/src/cy/commands/navigation.ts:63 and listeners.ts. None of it is browser-specific.
  • packages/driver/cypress/e2e/issues/1244.cy.js:25 — 12 tests. A <form> submit and an <a> click, each trying to escape the AUT frame with target=_top. The comment says only 4 of the 12 fail on WebKit. Nobody wrote down which four.
  • packages/driver/cypress/e2e/issues/base_target.cy.ts:5 — 7 tests for <base target> stripping. The gate was added in fix: strip unsafe target from <base> tags to keep AUT inside Cypress frame #33667. Neither the commit nor the PR mentions WebKit. The implementation is not browser-specific. The gate was probably copied from 1244.cy.js. Run the file. If it passes, delete the gate.
  • packages/driver/cypress/e2e/cy/timers.cy.js:416 — 1 test. A timer queued before location.reload() must not fire. Same for a timer queued across cy.reload().

System tests (do run on WebKit in CI):

  • system-tests/test/form_submissions_spec.js:150,160webkit is 404ing on redirects after the form submit on the default clientRoute /__/. Only skip in the row with a stated symptom; points at the server, not the driver.
  • system-tests/test/visit_spec.js:135 (visit.cy.js: anchors, huge DOM, TLSv1, UA propagation, POST redirect codes) and :228 (source_rewriting.cy.js: obstructive code, Incorrect redirect to malformed url within AUT - adding _/ in url #3975 relative redirects).
  • system-tests/test/web_security_spec.js:76 (cross-origin navigation error surface) and :102 (chromeWebSecurity warning, pinned to firefox — may be a product decision whether WebKit emits it).

User-reported, no test coverage — confirm on current playwright-webkit, then fix, file, or close:

One hypothesis worth testing first

The driver listens for unload on the AUT window in every browser (packages/driver/src/cy/listeners.ts:97). Two other places switch to pagehide, but only for Chromium: cross-origin/events/spec_window.ts:8 and app/src/runner/event-manager.ts:357. WebKit's back/forward cache can suppress unload. If it does that for AUT navigations, it would explain both the #page load and #url:changed failures at once. This is unverified.

Method

cd packages/driver && yarn cypress:run --browser webkit --spec cypress/e2e/commands/navigation.cy.js,cypress/e2e/issues/1244.cy.js,cypress/e2e/issues/base_target.cy.ts,cypress/e2e/cy/timers.cy.js
yarn test-system -- --browser webkit visit_spec.js form_submissions_spec.js web_security_spec.js

Run as-is, then with the guards removed on a PoC branch. Run failures more than once to separate deterministic from flake.

Non-goals

Deliverables

Timebox

TBD after the first run.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    browser: webkitIssue related to Webkit (Safari) browserexperiment: webkitIssues when using experimentalWebkitSupport

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions