# CLAUDE.md — End-to-end tests with Playwright ## Goal Reliable end-to-end tests for this app's most important user flows. ## Rules - Use the Playwright MCP to open the running app and explore a flow before writing its test. - Tests live in `tests/`. One file per flow, e.g. `tests/sign-up.spec.ts`. - Locators: `getByRole`, `getByLabel`, `getByText` first. `data-testid` only when nothing else is stable. - Never use fixed waits (`waitForTimeout`). Rely on auto-waiting and `expect(...).toBeVisible()`. - Each test sets up its own data and does not depend on another test. - Run `npx playwright test` after writing each file; fix failures before moving on. - Never put real passwords or keys in tests. Use env vars (`TEST_USER_EMAIL`, `TEST_USER_PASSWORD`).