Skip to content

Add agent-friendly e2e failure report hosted next to the HTML report - #1853

Open
pedrobonamin wants to merge 1 commit into
mainfrom
cursor/agent-friendly-e2e-failure-report-060d
Open

Add agent-friendly e2e failure report hosted next to the HTML report#1853
pedrobonamin wants to merge 1 commit into
mainfrom
cursor/agent-friendly-e2e-failure-report-060d

Conversation

@pedrobonamin

@pedrobonamin pedrobonamin commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Problem

The merged Playwright HTML report deployed to Vercel is a JS single-page app — great for humans, but an AI agent fetching the report URL only gets an empty HTML shell. The only machine-readable output today is test-summary.json (counts + failed file names), which lacks everything an agent needs to debug a failure.

Solution

Playwright (≥1.53, we're on 1.62) already attaches error-context.md — an ARIA/YAML snapshot of the page at the moment of failure, designed for AI consumption — to every failed test. That data travels inside the blob reports CI already merges; it was just never surfaced anywhere fetchable.

This PR extracts it into a single plain-markdown digest hosted on the existing Vercel report deployment:

  • e2e/reporters/summary.ts (the merge-time reporter) now also writes playwright-report/agent-report.md containing, per failed/flaky test: title, spec location, browser, attempt count, the full ANSI-stripped error + stack + code snippet, the inlined error-context page snapshot, other attachment names, plus run metadata and the exact env-complete local repro command. When everything passes it writes a one-line "all passed" file so the URL is always valid. test-summary.json gains a hasFailures flag.
  • The file rides along with the existing cp -r e2e/playwright-report/* .vercel/output/static/ step, so it's served at <report-url>/agent-report.md — one URL an agent can fetch in a single request.
  • The failed PR comment gains a Share with an AI agent blockquote pointing at that URL, ready to paste into an agent chat.
  • The digest is also appended to the workflow run's job summary (truncated to stay under the 1 MB limit), so failures are readable in the Actions UI without opening any deployment.
  • e2e/README.md documents the new output.

No changeset: only the private e2e package and CI workflow are touched.

Report example:
Screenshot 2026-08-06 at 12 02 17
https://plugins-e2e-test-studio-gmw0f2cne.sanity.dev/agent-report.md

Verification

Verified end-to-end locally against a real ephemeral dataset: ran a deliberately failing spec with the CI reporter setup (blob), merged with playwright merge-reports --reporter html,./reporters/summary.ts, and confirmed agent-report.md contains the error, code snippet, page snapshot, and repro command (see run artifacts in the agent session). pnpm format, pnpm lint, pnpm knip, pnpm build, and pnpm test all pass.

Open in Web Open in Cursor 

Generate a plain-markdown failure digest during the e2e report merge:
error messages, code snippets, and Playwright's error-context page
snapshots. Host it on the Vercel report deployment at
<report-url>/agent-report.md, link it from the failed PR comment as a
'Share with an AI agent' blockquote, and append it to the job summary.
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview Aug 6, 2026 9:15am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plugins-e2e-test-studio Ignored Ignored Aug 6, 2026 9:15am

Request Review

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b253659

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ E2E Tests

🟢 26 passedview full reportview run

Studio: https://plugins-e2e-test-studio-f0vq6xxf8.sanity.dev

Datasets: pr-1853-chromium-31088320399, pr-1853-firefox-31088320399

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 32% 5508 / 17209
🔵 Statements 31.78% 5812 / 18288
🔵 Functions 27.78% 1427 / 5136
🔵 Branches 23.33% 2828 / 12118
File CoverageNo changed files found.
Generated in workflow #8788 for commit b253659 by the Vitest Coverage Report Action

@pedrobonamin
pedrobonamin marked this pull request as ready for review August 6, 2026 10:21
@pedrobonamin
pedrobonamin requested a review from a team as a code owner August 6, 2026 10:21
@pedrobonamin
pedrobonamin requested review from Copilot and stipsan and removed request for a team and Copilot August 6, 2026 10:21

@stipsan stipsan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants