L
laravel:e2e-playwright
About laravel:e2e-playwright
A skill for building reliable, maintainable Playwright end-to-end tests in Laravel projects. It provides guidance on test environments, state setup, stable selectors, authentication, and failure-only recordings.
Key features
- 01Dedicated `.env.playwright` environment
- 02Seeders and factories for test state
- 03Stable `data-testid` selectors
- 04Reuse authentication storage state
- 05Record media only on failure
Use cases
- 01Prepare a seeded environment for E2E tests
- 02Keep selectors stable during UI refactors
- 03Avoid flaky UI login in test setup
- 04Capture screenshots or video after failures
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ jpcaparas/ superpowers-laravel --skill laravel:e2e-playwrightAfter installing, type/laravel:e2e-playwrightin Claude Code to confirm it loaded.
Details
From the project READMEE2E Playwright (Laravel)
Keep E2E tests reliable, fast, and maintainable.
Environment
# Sail
sail pnpm playwright:test
# Non‑Sail
pnpm playwright:test
Use a dedicated .env.playwright and rebuild schema with migrate:fresh --seed before running.
State & Seeds
- Provide seeders for common scenarios (users, roles, demo content)
- Use factories for per‑test setup; reset state between specs
Test IDs & Selectors
- Prefer
data-testidattributes over CSS paths - Keep selectors stable through refactors
Auth
- Reuse storage state when possible (logged‑in cookies/session)
- Otherwise create user via API/setup to avoid UI login flakiness
Patterns
- Break large flows into steps; assert key milestones
- Record videos/screenshots only on failure to keep suites fast
Comments
Markdown supported