Skip to content

Upload Playwright report and traces as an artifact when the e2e job fails #190

@arasaka-net

Description

@arasaka-net

On failure, upload playwright-report/ and any recorded traces from the e2e job as a workflow artifact so failures can be diagnosed without re-running locally.

Context
When the e2e job fails in CI today, the only output available is the job log. No HTML report, no trace, no screenshots are preserved. An LLM reviewing a failing run cannot inspect the actual failure — it has to guess from the log. Uploading the Playwright report on failure gives both humans and automated agents a reproducible failure artifact. The Playwright config should also be updated to enable trace capture on retry so the uploaded artifact is useful.

Affected Files

  • playwright.config.js:3 — Add reporter: [["html", { open: "never" }]] and use.trace: "retain-on-failure" so a report and traces are produced.
  • .github/workflows/ci.yml:41 — Add an actions/upload-artifact@v4 step with if: failure() that uploads playwright-report/ and test-results/.

Requirements

  • playwright.config.js configures the HTML reporter and retains traces on failure.
  • The e2e job uploads playwright-report/ and test-results/ as a single artifact when the job fails.
  • The artifact upload is gated on if: failure() so passing runs do not upload anything.
  • npm run e2e still completes successfully on green.

Verification

  • grep -n 'reporter' playwright.config.js
  • grep -n 'trace' playwright.config.js
  • grep -n 'upload-artifact' .github/workflows/ci.yml
  • grep -n 'if: failure' .github/workflows/ci.yml
  • npm run e2e

Not In Scope

Evidence

  • .github/workflows/ci.yml:35-41e2e job has no upload-artifact step; failures leave nothing to inspect.
  • playwright.config.js:1-15 — Config does not set reporter or use.trace, so default output is minimal and nothing is retained.
  • .gitignore:1test-results/ is already gitignored, confirming Playwright writes there by default.

Arasaka Queue Planning Division.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions