Skip to content

test: make four e2e checks pass on Firefox - #460

Merged
JuroOravec merged 1 commit into
mainfrom
fix/firefox-e2e
Oct 28, 2026
Merged

JuroOravec merged 1 commit into
mainfrom
fix/firefox-e2e

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Why

The scheduled cross-browser run (run 40310909616 on main) fails four e2e tests on Firefox. All four pass on Chromium. Each failure comes from an assumption in the test, not from a Citry bug. Test-only change; no product code and no changelog entry.

Causes and fixes

  1. test_i18n_vue_plugin_e2e.py::test_browser_isolates_fallback_text_exactly_as_the_server_does: the test served a bare fragment (no doctype, no charset) and counted every console warning as a hydration fault. Firefox warns "This page is in Quirks Mode" and "The character encoding of the document was not declared", about the test page. The test now serves <!doctype html><meta charset="utf-8"> plus the body with text/html; charset=utf-8. It is the only route.fulfill in that file whose page also collects console warnings, so the others are unchanged.
  2. test_vue_transparent_root_e2e.py::test_fragment_manager_loads_and_mounts_python_composed_component, aborted request: Chromium logs "Failed to load resource: net::ERR_FAILED" for the aborted script route and the test required exactly one. Firefox logs nothing. The test now allows zero or one and removes it when present.
  3. Same test, a second Firefox-only failure found while verifying: the expected "expected fragment dispose failure" error is logged as an Error object. Chromium's message.text includes its message; Firefox prints JSHandle@object.
  4. test_fragment_startup_styles_survive_other_unmount_and_release_on_own_cancel: same Error-object logging for [Citry] discarded Vue fragment:. Causes 3 and 4 share a helper, _logged_error_text, which reads the message from the last console argument (args[-1].evaluate("error => String(error?.message ?? error)")) outside the event handler.
  5. test_cmenu_e2e.py::test_a_key_scrolls_the_page_to_an_item_below_the_screen (both cases), now test_a_key_shows_an_item_that_starts_below_the_screen: it asserted window.scrollY > 0. Chromium keeps a menu that does not fit below its trigger below it, overflowing the screen, so the page scrolls. Firefox shifts the menu up so it fits on screen (overlapping the trigger), so the item is already visible. This is a browser placement difference, and both keep the focused item visible, which is the real contract. The test asserts a scroll only when the menu sat below its trigger when the key focused the item; otherwise it asserts the menu is inside the viewport. The final check that the focused item is inside the viewport stays for both. Verified that Chromium takes the scroll branch and Firefox takes the fits-on-screen branch.

Evidence

Changed tests, Firefox and Chromium: 10 passed (4 tests, cmenu has two cases).
Whole changed files on Chromium (-n 2): 94 passed.
ruff check and ruff format --check: clean.
WebKit: could not be run here. WebKit launch hangs in this environment, including for a test this PR does not touch on unmodified code, so the WebKit result is unknown and nothing was changed for it.

🤖 Generated with Claude Code

These tests failed on Firefox in the scheduled cross-browser run. Each
failure came from an assumption in the test, not from a Citry bug.

- The i18n fallback-text test served a bare fragment with no doctype
  and no charset, and counted every console warning as a hydration
  fault. Firefox warns about Quirks Mode and the undeclared encoding
  of the test page. The test now serves a real UTF-8 document.
- The fragment manager test expected Chromium's "net::ERR_FAILED"
  console message for an aborted script request. Firefox logs nothing
  for an aborted request, so the message may now be absent.
- The same test and the startup-styles test read a logged Error from
  the console text. Chromium includes the error's message there and
  Firefox prints "JSHandle@object". Both now read the message from
  the console message's last argument.
- The CMenu test required the page to scroll to an item below the
  screen. Chromium keeps a menu that does not fit below its trigger
  below it, so the page must scroll. Firefox moves the menu up so it
  fits on screen, so the item is already visible. This is a browser
  difference, and both keep the focused item visible, which is the
  contract. The test now requires a scroll only when the menu sat
  below its trigger, and renames to say what it checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec merged commit 83bf07c into main Oct 28, 2026
31 of 39 checks passed
@JuroOravec
JuroOravec deleted the fix/firefox-e2e branch October 28, 2026 10:37
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