Playwright Rules
Browser testing framework for reliable end-to-end tests. Automate Chromium, Firefox, and WebKit with powerful selectors.
3 rules
Assertion Best Practices
Beginner
Standardize Playwright assertion patterns — use web-first assertions with auto-retry, avoid manual waits, and prefer user-visible state checks over DOM property inspection.
globs: **/*.spec.ts, **/*.test.ts, **/tests/**, **/e2e/**, **/playwright/**
assertions, web-first, auto-retry, best-practices
View Rule
Locator Selection Standards
Beginner
Enforce the use of semantic locators (getByRole, getByLabel, getByText) over CSS selectors and XPath in all Playwright tests for resilience and accessibility.
globs: **/*.spec.ts, **/*.test.ts, **/tests/**, **/e2e/**, **/playwright/**
locators, selectors, accessibility, standards
View Rule
Test Isolation Requirements
Intermediate
Mandate complete test isolation in Playwright suites — no shared state, independent browser contexts, deterministic data, and no reliance on test execution order.
globs: **/*.spec.ts, **/*.test.ts, **/tests/**, **/e2e/**, **/playwright/**
test-isolation, fixtures, flaky-tests, parallelism
View Rule