aiskillstore/playwright-best-practices
Use when writing or modifying Playwright tests (.spec.ts, .test.ts with @playwright/test imports).
npx skills add https://github.com/aiskillstore/marketplace --skill playwright-best-practices
When running Playwright tests from Claude Code or any CLI agent, always use minimal reporters to prevent verbose output from consuming the context window.
Use --reporter=line or --reporter=dot for CLI test runs. Configure playwright.config.ts to default to minimal reporters when CI or CLAUDE env vars are set — see playwright-patterns.md for the config snippet.
Always prefer user-facing attributes:
page.getByRole('button', { name: 'Submit' }) — accessibility rolespage.getByLabel('Email') — form control labelspage.getByPlaceholder('Search...') — input placeholderspage.getByText('Welcome') — visible text (non-interactive)page.getByAltText('Logo') — image alt textpage.getByTitle('Settings') — title attributespage.getByTestId('submit-btn') — explicit test contractsawait expect(locator).toBeVisible(), never expect(await locator.isVisible()).toBe(true) — web-first matchers auto-wait and retrystorageState; never log in via UI in every testpage.waitForTimeout(ms) — use auto-waiting locators insteadpage.locator('.class') — use role/label/testid--reporter=line or --reporter=dotawait expect() web-first matcherspage.waitForTimeout() — use auto-waitingline/dot) used in CI/agent contextsSee playwright-patterns.md for Page Object Model, fixtures, network mocking, and configuration examples.
Take aiskillstore/playwright-best-practices from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.