dist/claude/plugins/test-e2e/skills/testing-e2e/SKILL.md
Playwright-based end-to-end browser testing of user flows. Use when running existing Playwright tests, generating browser checks, recording a visible session, or verifying a user journey end-to-end. NOT for unit tests, API-only tests, or logic tests where curl or JSDOM suffices — use improving-tests or fixing-code instead.
npx skillsauth add alexei-led/claude-code-config testing-e2eInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Execute E2E testing workflows using Playwright scripts (via playwright-skill). Do not delete, reset, or mutate non-test data without explicit user confirmation. If the app cannot be started or fixtures are unavailable, report BLOCKED instead of inventing passing results.
Runner: Examples below use
npx playwright. If the project uses Bun, substitutebunx playwrighteverywhere. Both runners work; pick the one matching the project's lockfile (package-lock.json/pnpm-lock.yaml→npx;bun.lock/bun.lockb→bunx).
Use TaskCreate / TaskUpdate to track these 5 phases:
run → Run existing E2E testsrecord → Record browser session for test generationgenerate → Generate test from URL or page descriptionverify <feature> → Verify specific feature works in browserIf no argument provided, use AskUserQuestion. Ask one question at a time:
Before any browser test run or test-generation plan, explicitly include dev-server detection/startup and deterministic test data setup. Do not jump straight to browser steps.
baseURL; start it if missing, or report the blocker if no start command is known.npx playwright test
# or, with Bun:
bunx playwright test
For specific test:
npx playwright test login.spec.ts
For headed mode (visible browser):
npx playwright test --headed
Write a Playwright script to /tmp/playwright-record-*.js that:
headless: false and slowMo: 100cd ~/.claude/skills/playwright-skill && node scripts/run.js /tmp/playwright-record-*.jsTranslate manual flows into Playwright actions and assertions, but first define deterministic fixtures: seeded users/items/coupons, fixed dates, stable IDs, reset database state, and mocked external services where needed.
Task(
subagent_type="engineer",
description="Generate E2E test",
prompt="Generate an E2E test using the Playwright browser workflow — real browser automation, not generic unit-test authoring.
URL: {target URL}
Flow: {user flow description}
Requirements:
- Use Page Object pattern
- Use semantic locators (getByRole, getByLabel, getByText)
- Include assertions for expected outcomes
- No hardcoded waits (use waitFor patterns)
- Include accessibility checks where appropriate
- Write the script to /tmp/playwright-*.js and run it via the playwright-skill executor: cd ~/.claude/skills/playwright-skill && node scripts/run.js /tmp/playwright-*.js"
)
Task(
subagent_type="engineer",
description="Verify feature",
prompt="Verify this feature works correctly in the browser using the Playwright workflow — real browser automation, not generic test authoring.
Feature: {feature description}
Steps:
1. Navigate to appropriate page
2. Execute user flow
3. Assert expected outcomes
4. Report PASS/FAIL with evidence (screenshots if needed)
Write the Playwright script to /tmp/playwright-*.js and run it via the playwright-skill executor: cd ~/.claude/skills/playwright-skill && node scripts/run.js /tmp/playwright-*.js"
)
Run the test suite and validate:
npx playwright test --headed
Pass criteria: all tests green, no flaky failures on re-run, deterministic fixtures reset cleanly, and traces/screenshots/videos are saved or linked when failures occur.
If tests fail:
npx playwright test <failed-spec> --headednpx playwright testThe final report must include PASS/FAIL/BLOCKED, dev server status, fixture/reset summary, test results, and artifact paths for traces/screenshots/videos/reports when relevant. If tests were not run, report BLOCKED or explain exactly why; do not imply success.
E2E TESTING
===========
Action: {run|record|generate|verify}
Result: PASS | FAIL | BLOCKED
Tests: {pass/fail count}
Dev server: {reused|started|not needed|blocked: reason}
Fixtures: {deterministic data/reset summary}
Artifacts: {trace/screenshots/videos/report paths or "none"}
Details:
- [test results or generation summary]
Write Playwright scripts to /tmp/ and run via the playwright-skill executor:
cd ~/.claude/skills/playwright-skill && node scripts/run.js /tmp/playwright-test-*.js
The executor handles module resolution, auto-installs Chromium if needed, and provides helper utilities. See playwright-skill/SKILL.md for full patterns.
browser_snapshot to verify DOM updates after HTMX swapshx-trigger, hx-swap, hx-target behaviorsHX-* response headers in network requests// BAD: Immediate failure
await page.click("#submit-btn");
// GOOD: Wait with timeout + fallback
const btn = page.locator("#submit-btn");
if ((await btn.count()) === 0) {
// Try alternative selector
await page.click('button[type="submit"]');
} else {
await btn.click();
}
browser_snapshot to inspect current DOM state// Configure timeouts
test.setTimeout(60000); // Test timeout
page.setDefaultTimeout(30000); // Action timeout
// Or per-action
await page.click("#btn", { timeout: 10000 });
// Wait for network idle
await page.waitForLoadState("networkidle");
// Mock failing endpoints
await page.route("**/api/**", (route) => {
route.fulfill({ status: 500, body: "Server Error" });
});
page.waitForTimeout(1000) delays.btn-23waitForSelector, waitForLoadStategetByRole('button', { name: 'Submit' })browser_snapshot shows accessibility tree# Run with trace
npx playwright test --trace on
# View trace
npx playwright show-trace trace.zip
tools
Use when planning, executing, checkpointing, finishing, or inspecting lightweight spec-driven work. Runs one task at a time using `.spec/` markdown files and the bundled `specctl` helper. NOT for broad product discovery beyond a short requirement interview. NOT for generic implementation planning that does not read or write `.spec/` files.
development
Simple web development with HTML, CSS, JS, and HTMX. Use when working with .html, .css, or .htmx files, web templates, stylesheets, or vanilla JS scripts. NOT for React/Vue/Angular (use writing-typescript) or Node.js backends.
tools
Idiomatic TypeScript development. Use when writing TypeScript code, Node.js services, React apps, or TypeScript design advice. Emphasizes strict typing, boundary validation, composition, fast feedback, behavior tests, and project-configured tooling. NOT for Go, Python, Rust, plain HTML/CSS/JS, or server-rendered templates (use writing-web).
tools
Idiomatic shell development for POSIX sh, Bash, Zsh, Fish, hooks, CI shell steps, and scriptable CLI glue. Use when writing or changing `.sh`, `.bash`, `.zsh`, `.fish`, `.bats`, shell functions, shell pipelines, CI `run:` shell bodies, or command-runner recipes. Emphasizes portability, quoting, safe filesystem/process handling, non-TUI CLI tools, ShellCheck, shfmt, Bats, and ShellSpec. NOT for Python, Rust, TypeScript, Go, web code, or GitHub Actions workflow/job/permissions semantics; use operating-infra.