Playwright E2E testing patterns, cross-browser configuration, page objects, and CI setup. Use when creating E2E specs, visual regression suites, or configuring Playwright in CI. Trigger terms: playwright, e2e, trace, page object, cross-browser
69
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Project test config and breakpoints: testing-config.md. Docs: https://playwright.dev/docs/intro
Layout: specs tests/e2e/{feature}/, page objects tests/pages/, fixtures tests/fixtures/.
getByRole(role, { name }) → getByLabel() for inputs → getByTestId() for containers → getByText() → page.locator(css) only when no semantic alternative exists.
trace: 'on-first-retry' costs nothing on green runs — enable it for flaky suites and attach the trace ID to failure tickets.mask dynamic content, otherwise every run diffs.forbidOnly: !!process.env.CI prevents a stray test.only from silently shrinking the CI suite to one test.webServer.reuseExistingServer: !process.env.CI — locally reuses your dev server; in CI it must start its own.retries: 2 and workers: 1 in CI trade wall-clock for determinism.await page.route('/api/login', route => route.fulfill({ status: 200, body: ... })).npx playwright test --ui # interactive iteration
npx playwright test auth.spec.ts # single spec
npx playwright test --project=chromium # one browser
npx playwright test --grep "login" # filter by title
npx playwright test --debug # step through
npx playwright codegen http://localhost:3000 # record a spec
npx playwright show-report # HTML report (verify 0 failures)
npx playwright install # browsers — required on a fresh machine/CIprojects in playwright.config.ts map to devices[...] presets (Desktop Chrome, Desktop Firefox, Desktop Safari, iPhone 14).
fa0c341
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.