Skip to content

test: let the dynamic-element tests pass on WebKit - #485

Merged
JuroOravec merged 3 commits into
mainfrom
fix/webkit-route-content-type
Oct 28, 2026
Merged

JuroOravec merged 3 commits into
mainfrom
fix/webkit-route-content-type

Conversation

@JuroOravec

@JuroOravec JuroOravec commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Eight tests in packages/py/citry/tests/e2e/test_vue_dynamic_element_e2e.py fail on WebKit only. This PR fixes both causes. It is a test-only change.

Pages served with no content type

These tests serve their page through a Playwright route that sets no content type. Chromium and Firefox treat such a body as HTML. WebKit does not, so the page never gets its <div id="host">.

The tests now declare content_type="text/html". Seven of them served the same host page, so a small helper, _serve_host_page, now serves it. The eighth test serves a longer page, so it sets the type inline.

Script retries that the route does not see

test_extension_script_loader_retries_and_restarts_same_app_id counts calls to its routes to prove that each retry makes a new request. In WebKit, the route was called only once per URL, even when a debug run added a no-store header to the response. A probe against a real HTTP server shows that WebKit does send each retry to the server, as Chromium and Firefox do, so Playwright's routing is the likely cause. So the count is now checked only in Chromium and Firefox, where the route sees every request. The test's other checks run in every browser.

Evidence

  • WebKit debug runs on the debug/webkit-e2e branch:
  • I checked every other route.fulfill in the repository's e2e tests. Every route that serves HTML, JS, CSS or JSON either declares its type or, in one benchmark test, copies the headers of the real response it forwards. The few routes without a type are error or empty responses, where only the status matters.
  • Locally, test_vue_dynamic_element_e2e.py passes on Chromium and Firefox. ruff and ruff format pass. WebKit hangs on my machine, so it ran only in CI.
  • test_fragment_manager_loads_and_mounts_python_composed_component also fails on WebKit because of Playwright's routing: after the test aborts the routed request for a script, WebKit fails the next load of that URL at once, without calling the route. test: make four e2e checks pass on Firefox #460 changes that test too, so its fix will follow once test: make four e2e checks pass on Firefox #460 merges.

🤖 Generated with Claude Code

JuroOravec added a commit that referenced this pull request Oct 28, 2026
@JuroOravec JuroOravec changed the title test: serve the dynamic-element test pages as text/html test: let the dynamic-element tests pass on WebKit Oct 28, 2026
JuroOravec and others added 3 commits October 28, 2026 12:34
WebKit does not treat a response with no Content-Type as HTML, so eight
routes in test_vue_dynamic_element_e2e.py that served their page body
without a type failed on WebKit only. A helper now serves the shared host
page with content_type="text/html", and the one multi-line page route
declares it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In WebKit, Playwright answers a repeated request for a routed URL from the
first response without calling the route again, even when that response says
no-store. The extension script loader test counted route calls to prove each
retry makes a new request, so it failed on WebKit only. A WebKit run against a
real server shows each retry does reach the server, so the count is now
checked in Chromium and Firefox, where the route sees every request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ee it

The fragment manager test aborts the routed request for a late script, then
loads the fragment again and waits for a second request. In WebKit, Playwright
fails that second load at once without calling the route, so the test timed
out on WebKit only. A WebKit run against a real server shows the retry does
reach the server. The late-script check now lives in its own helper, which the
test runs in Chromium and Firefox.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec force-pushed the fix/webkit-route-content-type branch from 6ba96f7 to 8dc290a Compare October 28, 2026 11:34
@JuroOravec
JuroOravec merged commit f9be7a5 into main Oct 28, 2026
0 of 27 checks passed
@JuroOravec
JuroOravec deleted the fix/webkit-route-content-type branch October 28, 2026 15:47
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.

1 participant