Playwright e2e
Skill ahtishamshahzad/agent_dev_flow/.ai/skills/web/playwright-e2e
Tool-neutral AI Engineering System: 174 reusable skills (installable as Claude Code plugins) for planning and building software with AI agents. Classify → plan → approve → build under quality gates. Works with Claude Code, Codex, Cursor, Windsurf, Copilot & Antigravity. Canonical in .ai/.
npx -y skills add ahtishamshahzad/agent_dev_flow --skill playwright-e2eAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 21 days oldThe repository was created 21 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use to plan Playwright end-to-end tests for critical web journeys — authentication and authorization, forms, dashboards, reports, checkout — with visual regression only when justified, deterministic test data, environment isolation (never prod), CI execution with traces, and regression coverage for fixed bugs. Cover the critical path, not every page.
SKILL.md
7.6 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
Playwright E2E
Purpose
Plan and structure Playwright tests that exercise the app's critical user journeys in a real browser, end to end, validating what users actually experience. The web E2E arm of ../../testing-strategy — the top of the pyramid, reserved for flows whose failure is high-impact.
When to Use
- When critical journeys exist (auth, checkout, core dashboard workflows, report generation) that must not break.
- Before releases of high-impact flows; when a fixed high-impact bug needs a permanent journey-level guard.
- Not for logic (
web-unit-testing) or component behavior (web-component-testing), and never to E2E every page.
Inputs
- The critical-journey list with acceptance criteria (agreed with the user).
- A deployable build and an isolated test environment with seedable data.
- Auth roles/accounts available for testing (
web-authentication,web-authorization).
Discovery Questions
- Which journeys are critical enough that failure means incident-level impact?
- Which roles must each journey run as (customer, each admin role) to prove authorization?
- Where do tests run (dedicated environment? ephemeral per-PR?) and how is data seeded/reset?
- Is visual regression justified anywhere (stable, design-critical surfaces with a diff-review process)?
Responsibilities
- Select critical user journeys — signup/login, the product's core loop, checkout if commerce, key dashboard workflows — and keep the suite small and meaningful.
- Test authentication: login (success/failure), logout, protected-route redirects with return path, session expiry behavior; reuse authenticated state via
storageStateper role so every test doesn't re-login through the UI. - Test authorization: per role, assert both what's reachable and that forbidden routes/actions are denied (direct-URL access, API-backed actions) — proving
web-authorization's enforcement from the outside. - Test forms: validation errors surface accessibly, successful submission lands, server errors render (
web-forms). - Test dashboards: table filtering/sorting/pagination against seeded data, permission-scoped visibility, a guarded bulk operation with its confirmation flow (
dashboard-tables,dashboard-bulk-operations). - Test reports: a seeded dataset produces the expected numbers/rows, ranges/filters apply, export delivers (
dashboard-reporting). - Test checkout (where commerce exists): the full path to a confirmed order against payment-provider test modes — never live payment rails.
- Apply visual regression only when justified: stable design-critical surfaces, deliberate baselines, a review process for diffs — not screenshots of every page that break on each copy change.
- Manage test data: seeded per run, unique (no shared mutable records between tests), reset/cleanup guaranteed, tests independent and parallel-safe.
- Enforce environment isolation: a dedicated test environment/database, test accounts, external services in test/sandbox mode — never production, never real user data.
- Plan CI execution: headless on PRs/merges, parallel workers, a deliberate retry policy (retries flag flake for fixing, not for hiding), artifacts on failure (trace, screenshot, video) so failures are debuggable from CI alone.
- Maintain regression coverage: every fixed high-impact bug that E2E is the right level for gets a journey test; the suite is pruned as flows change so it stays trusted.
Required Workflow
- Agree the critical-journey list and the roles each runs as.
- Stand up environment isolation + data seeding/reset strategy.
- Author journeys with stable selectors (roles/labels first,
data-testidwhere needed) and web-first assertions — no arbitrary sleeps. - Set up per-role
storageState; add authorization-denial checks per role. - Wire CI (headless, parallel, artifacts, retry policy); triage flake to zero tolerance.
- Add regression journeys as high-impact bugs are fixed; run the suite and record results (or "unverified until run").
Decision Rules
- A journey earns E2E when its failure is user-visible and high-impact; everything else belongs to cheaper layers.
- Selector preference: accessible role/label →
data-testid→ never brittle CSS/XPath chains. - Auth via
storageState/API setup for speed; the login flow itself is tested once as its own journey. - Visual regression is opt-in per surface with a named justification; otherwise assert semantics, not pixels.
- A flaky test is fixed or quarantined the week it flakes — a red-ish suite is a dead suite.
Rules
- Tests are independent, order-agnostic, and parallel-safe; no test depends on another's leftovers.
- No production environments, production data, or live third-party rails — ever.
- Failures ship with their trace/screenshot; a failure that can't be diagnosed from artifacts is a tooling bug to fix.
Anti-Patterns
- E2E-ing every page until the suite takes an hour and everyone ignores it.
waitForTimeoutsprinkled to outrun race conditions.- Shared test accounts mutating each other's state across parallel workers.
- Screenshot assertions on volatile pages, regenerated blindly on every failure.
- Retry-until-green as the flake strategy.
Validation Checklist
- Critical journeys agreed and listed (auth, authorization, forms, dashboards, reports, checkout where present).
- Environment isolation + seeded, per-run-unique test data in place.
- Per-role auth state reuse set up; authorization denials asserted per role.
- Stable selectors and web-first assertions throughout; no arbitrary sleeps.
- Visual regression limited to justified surfaces with a baseline-review process.
- CI runs headless/parallel with failure artifacts and a deliberate retry policy.
- Regression journeys added for fixed high-impact bugs.
- Suite executed and passing, or explicitly flagged "unverified until run."
Definition of Done
A small, trusted Playwright suite covering the agreed critical journeys — auth and per-role authorization, forms, dashboard and reporting workflows, checkout where relevant — running deterministically on isolated data in CI with debuggable artifacts, growing only through justified additions and regression guards.
Related Skills
../../testing-strategy, web-unit-testing, web-component-testing, web-authentication, web-authorization, web-forms, dashboard-tables, dashboard-bulk-operations, dashboard-reporting, web-deployment, ../../bug-investigation.
Related Knowledge
../../../knowledge/ (critical journeys, roles, environment topology).
Related References
../../../references/web/testing/ (journey specs, seeding patterns — when populated).
Context Loading Guidance
- Requires: critical-journey list, roles, environment/data strategy.
- Does not require: full source tree, component internals, unrelated features.
- May load:
web-authentication/web-authorizationfor auth flows;dashboard-bulk-operationsfor guarded-action journeys. - Stop when: journeys are authored, CI-wired, and run (or flagged unrun).
Token Efficiency Guidance
Plan journeys as one-line specs (journey → role → seeded state → assertions). Keep selectors/data conventions defined once; link references rather than pasting page trees.