fix(e2e): keep the HTML report when the CI reporter is set to "github"
WHY THIS MATTERS
docs/e2e-ci.md ("Failure artifacts") tells a maintainer debugging a red
nightly run to download the `playwright-report` artifact and open it with
`npx playwright show-report playwright-report`. But the config set
`reporter: "github"` on CI, and naming ANY reporter REPLACES Playwright's
default `html` reporter rather than adding to it - so `playwright-report/`
was never written, the artifact upload had nothing to ship (it only
survived because `if-no-files-found: ignore` hid the gap), and the
documented debugging flow failed at exactly the moment it was needed:
when a nightly run is red and someone needs the per-spec traces.
WHAT IS A PLAYWRIGHT REPORTER (AND WHY "REPLACES", NOT "ADDS")
A reporter is a plugin that consumes test events and renders them
somewhere: `list` prints one line per test to the terminal, `github`
emits workflow annotations (`::error file=...`) that GitHub renders
inline on the PR diff, and `html` writes a browsable report with
screenshots and traces to `playwright-report/`. When no `reporter` is
configured, Playwright uses `html` on CI by default - but the `reporter`
option is a full override, not a merge. Setting it to a single reporter
silently drops the default. To get several outputs you must list them
all explicitly as an array of tuples:
reporter: process.env.CI
? [["github"], ["html", { open: "never" }]]
: "list",
Each entry is `[name]` or `[name, options]`.
HOW THE FIX WORKS
CI now runs BOTH reporters: `github` keeps the inline PR annotations,
and `html` regenerates `playwright-report/` so the workflow's existing
`actions/upload-artifact` step (which already lists `playwright-report/`
in its `path`) has real content to upload. The `open: "never"` option
matters on CI: the html reporter's default (`on-failure`) tries to
launch a local browser to display the report after a red run, which is
useless on a headless runner. The workflow runs `npx playwright test`
from the repo root, so the reporter's default output folder
(`playwright-report/` relative to the config) lands exactly where the
artifact step looks. Local runs keep the terse `list` reporter.
Verified: `npx tsc --noEmit` passes and `CI=1 npx playwright test
--list` loads the config and enumerates all 31 tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| Repository | open-legal-products/mike |
|---|---|
| Author | Amal <mamalanand3@gmail.com> |
| Authored | |
| Committed | |
| Parents | b66c0cbc |
| Stats | 1 file changed , +9 , -2 |
| Part of | Harden e2e checks with accessibility scans |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-4669cc01.md
from inside the repo you want the change in.