Repository navigation
test(e2e): fix the named-element, script-order and i18n tests in Firefox and WebKit - #847
Merged
Merged
Conversation
…s pass in Firefox and WebKit - The named-element test clicks the button with a plain mouse click at its position. In WebKit, Playwright's own click code runs in the page and calls `document.querySelectorAll` and `document.dispatchEvent`, which the test's data-chosen names hide. Citry's runtime still starts and finishes the Events call in WebKit. - The script-order test counts the preload hint the runtime adds before the script tag. Firefox and WebKit ask again for the tag when the hint has already failed; the test now checks that the runtime adds one tag and one hint, and that the browser asks at most once for each. - Browser tests that serve a page through `route.fulfill` send `text/html; charset=utf-8`, so Firefox does not log that the page's encoding was not declared. Refs #843 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…me the click in the failure message Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes groups 2 and 3 of #843: the weekly Cross-browser e2e run fails in WebKit and Firefox on three test problems. Group 1 (Firefox page crashes) is handled separately.
What failed and why
WebKit:
test_vue_named_elements_e2e::test_data_chosen_ids_and_names_leave_the_runtime_working(all six variants). The page holds forms and other elements whosenamehidesdocumentmembers such asquerySelectorAllanddispatchEvent. Citry's runtime still started (wait_for_citry_readypassed), but in WebKit Playwright's own click code runs in the page and calls thosedocumentmembers, sopage.clickthrew before the click was sent. The test now reads the button's position throughElement.prototypeand sends a plainpage.mouse.clickthere. The click still reaches the button as a real mouse click, and the test still requires the Events call to finish and Citry's globals to be intact. With this change the test passes in WebKit, which shows Citry's runtime is not affected.Firefox and WebKit:
test_script_order_e2e::test_failed_other_origin_file_listed_twice_in_a_server_render_is_requested_once. On a server render the runtime adds a<link rel="preload">hint for each script and then one<script>tag. Chromium hands the hint's failed result to the tag. Firefox and WebKit reuse a hint only while it is still loading, so when the hint has already failed they ask for the file again: locally WebKit always made 2 requests and Firefox 1 or 2 depending on timing. The runtime added only one tag, so the test was counting the hint. The test now records the script tags and preload hints the runtime adds and requires exactly one of each, keepsrequests == 1in Chromium, and allows 1 or 2 requests in Firefox and WebKit.Firefox:
test_i18n_vue_plugin_e2e::test_null_values_keep_the_server_text_through_runtime_transitions(both variants). The test served a page with non-ASCII text throughroute.fulfill(content_type="text/html"), with no charset, and Firefox logged "The character encoding of the document was not declared", which the test's console check counts. Citry's own responses already name the charset (RouteResponseadds; charset=utf-8to a text body), so only the test page was affected. Everyroute.fulfillinpackages/py/citry/tests/e2enow sendstext/html; charset=utf-8.Checks
An independent reviewer checked that each test still proves what it was written to prove. With the runtime's duplicate-file check removed, the new script-order assertions fail in all three browsers.
Locally (Python 3.14, Playwright 1.65.0): all 13 changed files pass in Chromium, Firefox and WebKit (253 tests each). The fixed script-order test passed 5 runs in a row in each browser. The original i18n test reproduces the Firefox failure; the changed one passes.
ruff formatandruff checkpass on the changed files.Cross-browser e2e on this branch, first commit (the second commit changes only comments and a failure message): https://github.com/citry-dev/citry/actions/runs/45250350510. WebKit and Chromium pass. Firefox passes every test this PR fixes; its 6 remaining failures are the group 1 page crashes and the split-button timeout from the same group, which this PR leaves alone.
Versioning and changelog
Test-only change. Nothing the 1.x promise covers changes, and no changelog entry is needed.
Refs #843
🤖 Generated with Claude Code