Repository navigation
test(e2e): keep axe from crashing Playwright's Firefox build - #845
Merged
Merged
Conversation
Playwright 1.65 ships Firefox 159 (build 1572), which crashes the page when both the page's own scripts and Playwright read an element's ARIA reference properties, such as `ariaLabelledByElements`. Axe 4.13 reads them in the page, and Playwright reads them for `get_by_role(name=...)` and `get_by_label`, so the Firefox tests that ran axe and then found an element by name lost the page. The axe helpers now remove those properties from the page's `Element.prototype` in Firefox before axe runs. Axe then reads the `aria-*` attributes, which give the same answer because Citry UI sets no references from JavaScript. A new test checks that axe still follows `aria-labelledby` after the guard and that the page survives. Refs #843 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #843 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 23, 2026
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.
Refs #843 (group 1: the Firefox page crashes). The other groups in the issue are handled separately.
What crashed
Playwright 1.65 ships Firefox 159 (build 1572). That build crashes the page's content process (signal 11) when both the page's own scripts and Playwright read the same element's ARIA reference properties, such as
ariaLabelledByElements. The order of the two reads does not matter.get_by_role(..., name=...)orget_by_label.So every Firefox test that ran axe and then found an element by name, or the other way round, crashed the page. The smallest reproduction is a
<div role="dialog" aria-labelledby="t">: callpage.get_by_role("dialog", name=...), then evaluateel.ariaLabelledByElementsin the page.Evidence
uv.lockmoved Playwright from 1.64.1 to 1.65.0 (cd45608). The 2026-11-09 weekly run, on Firefox build 1555, had no crashes. The 2026-11-16 and 2026-11-23 runs, on build 1572, crashed in the same five tests each time. So the crash happens on every run, not now and then.ariaLabelledByElementsread./dev/shmand too many open pages, are ruled out: the examples job crashed with a single page in a single browser.Fix
The axe helpers now delete every
aria*Element(s)property from the page'sElement.prototypebefore axe runs, in Firefox only. Axe then falls back to thearia-*attributes, which give the same answer because Citry UI never sets these references from JavaScript. Playwright works in its own copy of the DOM classes, so its role queries are not affected.citry_ui/quality/accessibility.py: the guard runs insideaxe_rule_exclusions_script(), which every Citry UI axe test already runs beforeaxe.run.examples/_internal/qualify.py: the examples axe helper gets the same guard. That tool environment does not installcitry_ui, so the script is copied there.aria-labelledby, and the page survives a name query by role. In Firefox the test fails without the guard.The comments say to remove the guard once Playwright's Firefox build no longer crashes.
Verification
e2e (firefox): 0 page crashes. Result: 4 failed, 1838 passed. The 2026-11-23 run had 5 crashes: 10 failed, 1831 passed.test_script_order_e2ebelong to the other groups in Weekly cross-browser e2e has failed four weeks in a row #843.examples._internal.qualify --project demo-project-board --browser firefoxcrashes without the change and passes with it. CI cannot check that path in Firefox before the next scheduled run, because a manual run of the examples workflow uses Chromium only.ruff check,ruff format --check, andmypypass on the changed files.Not fixed here
test_csplitbutton_examples_e2e.py::test_layers_example_logs_menu_actions_and_opens_the_dialog_for_provenance[firefox]is listed under group 1 in the issue, but it is aLocator.clicktimeout, not a crash. It also failed on 2026-11-09, before the Playwright upgrade. In Firefox the CMenu submenu picksdata-citry-menu-side="inline-start"and opens at x = -618, outside the viewport. In Chromium it opens on the inline-end side at x = 418. The side comes fromchoosePlacementincmenu.py. This is a component placement bug and needs its own change.Versioning
Test tooling only.
citry_ui.qualityis excluded from the published wheel andexamples/_internalis not published, so this needs no changelog entry and touches nothing the 1.x promise covers.🤖 Generated with Claude Code