From playwright-e2e
Run the E2E test suite via the Playwright coding agent core test-runner with E2E-specific flags. Captures traces and videos on first retry, parses the HTML report, extracts trace viewer URLs, and categorizes failures.
How this skill is triggered — by the user, by Claude, or both
Slash command
/playwright-e2e:e2e-testingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill delegates execution to the `playwright-coding-agent` core `test-runner` skill with E2E-specific flags applied. Do not run `npx playwright test` directly from a spec — always route through the core runner so guardrails (budget monitoring, audit logging) are honoured.
This skill delegates execution to the playwright-coding-agent core test-runner skill with E2E-specific flags applied. Do not run npx playwright test directly from a spec — always route through the core runner so guardrails (budget monitoring, audit logging) are honoured.
Apply these flags for all E2E runs unless the caller explicitly overrides them:
| Flag | Value | Purpose |
|---|---|---|
--project | chromium | Run against Chromium by default; extend to firefox and webkit for cross-browser CI |
--trace | on-first-retry | Capture a full trace on first retry to aid debugging without slowing green runs |
--video | on-first-retry | Record video on first retry for visual regression investigation |
--reporter | html | Generate the interactive HTML report; also emit list for CI log readability |
Example invocation produced by this skill:
npx playwright test --project=chromium --trace on-first-retry --video on-first-retry --reporter=html,list
When the caller specifies a file, directory, or tag, scope the run accordingly:
# Single spec file
npx playwright test tests/e2e/specs/login.spec.ts --project=chromium --trace on-first-retry
# Directory
npx playwright test tests/e2e/specs/checkout/ --project=chromium --trace on-first-retry
# Tagged tests (using Playwright tag annotations)
npx playwright test --grep @smoke --project=chromium --trace on-first-retry
After a run, open the HTML report with:
npx playwright show-report
Parse the generated playwright-report/index.html to extract:
Traces are saved under test-results/<test-name>/trace.zip. For each failed test, extract and surface the trace viewer command:
npx playwright show-trace test-results/<test-name>/trace.zip
When reporting results, include the exact show-trace command for every failed test so the developer can open it immediately.
After parsing the report, classify failures into these categories and present them grouped:
| Category | Indicators | Suggested action |
|---|---|---|
| Locator not found | locator.click: Target closed / waiting for locator timeout | Review selector with e2e-selectors skill |
| Assertion failed | expect(...).toBeVisible / toHaveText failure | Check expected vs actual in trace; review assertion |
| Navigation error | page.goto timeout / net::ERR_CONNECTION_REFUSED | Verify baseURL in .playwright-agent.json and app is running |
| Auth failure | Redirect to /login mid-test | Regenerate storageState via auth.setup.ts |
| Flaky | Passes on retry | Add retry logic in config or investigate race condition |
| Setup failure | Error in auth.setup.ts or global setup | Run setup project in isolation to isolate the issue |
Return a structured summary after every run:
E2E Run Summary
───────────────
Project: chromium
Passed: 42
Failed: 2
Flaky: 1
Skipped: 0
Failed Tests:
1. Login > should redirect to dashboard (tests/e2e/specs/login.spec.ts:14)
Category: Assertion failed — expected URL /dashboard, received /login
Trace: npx playwright show-trace test-results/login-should-redirect/trace.zip
2. Checkout > should apply promo code (tests/e2e/specs/checkout.spec.ts:88)
Category: Locator not found — waiting for getByLabel('Promo code')
Trace: npx playwright show-trace test-results/checkout-promo/trace.zip
Flaky Tests:
1. Dashboard > should load widgets (tests/e2e/specs/dashboard.spec.ts:31) — passed on retry
npx claudepluginhub gagandeepp/software-agent-teams --plugin playwright-e2eGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.