e2e-playwright
Installation
SKILL.md
E2E Playwright
Use this skill when a Laravel task involves Playwright E2E tests, browser workflow coverage, regression tests, screenshots, traces, auth setup, or converting manual browser findings into durable tests.
Use the official microsoft/playwright repository as the source for current Playwright behavior when APIs, CLI, MCP, browser support, locators, traces, or configuration details matter: https://github.com/microsoft/playwright. Prefer the linked Playwright docs and API reference over remembered APIs.
Workflow
- Detect how the project runs Laravel, assets, queues, database, and browser tests: host, Sail, Docker, package manager, Vite, Playwright config, existing test helpers, and CI commands.
- Reuse project-local Playwright patterns first: auth helpers, seed scripts, storage state, route helpers, page objects, fixtures, test IDs, screenshots, and trace settings.
- Seed deterministic data through Laravel factories, seeders, HTTP setup routes, API helpers, or existing test bootstrap. Avoid fragile production-like data dependencies.
- Write tests with user-facing locators first:
getByRole,getByLabel,getByText,getByPlaceholder, andgetByTestIdonly when semantic locators are not stable enough. - Prefer Playwright web-first assertions such as
toBeVisible,toHaveText,toHaveURL,toHaveValue, andtoHaveScreenshotover fixed sleeps. - Cover the high-value user workflow, not every implementation detail. Include success, validation failure, authorization-dependent UI, empty state, loading or queued state, and destructive confirmation when relevant.
- Capture traces, screenshots, videos, or console/network evidence only when they help debug failures or support handoff.
- Run the smallest meaningful Playwright command locally and report skipped browsers, missing services, or environment blockers explicitly.