Skip to content

Run the browser tests in Firefox and WebKit - #2593

Open
Flo0807 wants to merge 8 commits into
developfrom
claude/e2e-webkit-firefox
Open

Flo0807 wants to merge 8 commits into
developfrom
claude/e2e-webkit-firefox

Conversation

@Flo0807

@Flo0807 Flo0807 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Runs the browser tests (mix test --only e2e) in Firefox and WebKit on CI as well, so engine differences show up before users report them in Safari or Firefox.

Changes

  • The CI job test-integration becomes a matrix over chromium, firefox and webkit, so one step runs the browser tests in every engine. Only the Chromium entry runs the unit and integration tests and checks and uploads the coverage; it keeps the name "Integration tests and coverage (backpex)", which the branch protection of develop requires. The other entries are named "Browser tests in firefox (backpex)" and "Browser tests in webkit (backpex)". Each entry caches its own browser and uploads the traces of failed tests under its name.
  • PW_BROWSER (chromium, firefox or webkit) picks the browser in config/test.exs. The default browser pool of PhoenixTest.Playwright has a browser option of its own, so the config passes the browser to the pool too. With only the top-level option, the tests still ran in Chromium.
  • Firefox and WebKit get a Playwright timeout of 5 seconds instead of 2: on CI they often took longer to open a context or page, or to show an element (tests that failed passed when run again one at a time). Chromium keeps 2 seconds.
  • assert_a11y/1 skips the axe audit in Firefox; Chromium and WebKit keep auditing the markup. See "Firefox and axe" below.
  • CONTRIBUTING.md explains how to run the tests in another browser.

Firefox and axe

  • Firefox does not support the customizable select yet. It shows the native dropdown and leaves the <selectedcontent> of the selects' <button> empty, so axe flagged a button without a name on every page with a select.

  • Firefox also crashed the page ("Page crashed") during axe runs on some forms. Reproduced in Linux Firefox (mcr.microsoft.com/playwright:v1.65.0-noble) with 40 tests that run axe three times on /admin/users/:id/edit:

    • unchanged page: 6–15 of 40 crashed, also with one test at a time; /admin/tags/new: 0
    • only one of the fields Posts (HasMany), Social links or Emergency contact (InlineCRUD) kept: 8–10; only Age, Role or Addresses: 0
    • every aria-labelledby removed, or shortened to one id: 0
    • a page with only <label><input aria-labelledby="a b"></label>: 0

    So inputs with an aria-labelledby of two ids (field label and column label) are part of the trigger, but not all of it. A page crash is a Firefox bug; the markup is valid ARIA, so it stays as it is. Narrowing it down to a minimal page for a Mozilla bug report is left open.

Notes

  • The Firefox and WebKit checks are not required yet. That is a branch protection setting for a maintainer, once the jobs have proven stable.
  • On macOS, Playwright's WebKit moves the focus with Tab only between text fields, like Safari by default. Locally, the keyboard tests that tab to a button or radio fail there (4 on develop: theme selector, filter preset, HasMany select all, InlineCRUD rows). WebKit on Linux, which CI runs, passes them.
  • Running WebKit locally against Add combobox component #2522 found two combobox bugs in Safari: the focus left the combobox after "Show more", and a server patch moved the scroll position of the listbox. They are fixed on that branch in 18f627e.
  • Firefox did not start on macOS 27 locally (Playwright's Firefox exits with "Could not find profile folder"), so the Firefox results come from CI only.

A new CI job runs `mix test --only e2e` in Firefox and WebKit next to
`test-integration`, which keeps running them in Chromium with coverage and
keeps its name for the required status check.

`PW_BROWSER` picks the browser of the tests. The default browser pool has a
`browser` option of its own, so it gets the browser as well; setting only the
top-level option still launched Chromium.
@Flo0807 Flo0807 added the ignore-for-release Should not appear in releas notes label Nov 27, 2026
@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The selects render a `<button>` with `<selectedcontent>` for the customizable
select (`appearance: base-select`). Firefox does not support it yet, shows
the native dropdown and leaves `<selectedcontent>` empty, so axe flagged a
button without a name on every page with a select. Browsers without
`base-select` leave `select > button` out of the audit; the others still
check it.
With ExUnit's default of two tests per core, opening and loading pages in
Firefox and WebKit exceeded the 2 second timeout of Playwright now and then
(5 tests in one run, all of which passed when run again one at a time).
Running one test per core did not stop the timeouts: WebKit still took
longer than the default 2 seconds to open a context or page, or to show an
element, in 5 tests of a run, which all passed when run again. Firefox and
WebKit get a timeout of 5 seconds instead; Chromium keeps 2 seconds. The job
runs the tests with ExUnit's default parallelism again.
In Firefox, about one in four axe audits of a form whose inputs have an
`aria-labelledby` with two ids (`InlineCRUD`, `HasMany`) crashed the page,
also with one test at a time. Removing those attributes or shortening them
to one id stopped the crashes, while a page with only such an input did not
crash, so the trigger is not fully known. Chromium and WebKit keep auditing
the markup, and the other browser tests still run in Firefox.

This replaces leaving `select > button` out of the audit in browsers without
the customizable select, which only Firefox needed.
`test-integration` becomes a matrix over Chromium, Firefox and WebKit instead
of a second job next to it, so one step runs the browser tests. Only the
Chromium entry runs the unit and integration tests and checks the coverage;
it keeps the name that the branch protection of `develop` requires.

This branch has not been deployed

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

Labels

ignore-for-release Should not appear in releas notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant