Project rules
Playwright E2E Rules
Project rules for Playwright suites: role-based locators, fixtures, test isolation, web-first assertions, traces and CI sharding.
CLAUDE.md
1Locators and assertions
2- Locate by role, label, text or test id: `getByRole`, `getByLabel`, `getByTestId`. Avoid XPath and deep CSS chains. Add `data-testid` in the app when no accessible name exists.
3- Use web-first assertions (`await expect(locator).toBeVisible()`, `toHaveText`, `toHaveURL`), which retry. Never use `waitForTimeout` or fixed sleeps; wait on a condition or a network response.
4- No `if` branches in tests; one behavior per test, named like a sentence.
5Isolation and setup
typescript
#
Playwright E2E Rules
Project rulestypescript
Free