@rulepack/playwright

v0.1.0

Official Playwright e2e best practices: user-facing locators, web-first auto-retrying assertions, isolated tests, no manual waits.

Updated 6/4/20266 files | 8.8 KB
$pnpm dlx rulepack add playwright

Drops CLAUDE.md / .cursor/rules/* and friends into your project.

Downloads

0

Stars

0

Views

0

playwright

Official Playwright end-to-end testing best practices for AI coding agents.

npx rulepack add playwright

What it covers

  • Locators — prefer user-facing locators (getByRole, getByText, getByLabel) over CSS/XPath; chain and filter to disambiguate.
  • Assertions — use web-first auto-retrying assertions (await expect(locator).toBeVisible()); avoid manual isVisible() checks and manual waits.
  • Test isolation — independent storage/cookies/data per test; shared setup via beforeEach/afterEach and storageState.
  • Tooling & CI — cross-browser projects, traces on first retry, lint with no-floating-promises, keep Playwright updated.
  • Scope — test user-visible behaviour, not implementation; mock third-party services with page.route().

Source

Distilled from the official Playwright documentation: https://playwright.dev/docs/best-practices

License

MIT