Playwright (E2E testing)
Playwright runs full end-to-end tests in a real browser. Use it to validate critical user journeys.
What to test
- core flows (login, create/update, payments if applicable)
- routing + navigation
- integration points (the “happy path” across systems)
Avoid:
- testing every edge case via E2E (too slow and flaky)
- duplicating unit test coverage
Sources
- Playwright docs: https://playwright.dev/docs/intro
- Test runner basics: https://playwright.dev/docs/test-intro
- Locators: https://playwright.dev/docs/locators
- Fixtures: https://playwright.dev/docs/test-fixtures
Standard approach (what we’ll converge on)
- Prefer resilient locators (role/text/testid), not CSS structure.
- Make tests independent and repeatable.
- Handle auth once with fixtures/storage state (when applicable).
Exercises
content/exercises/07-playwright/01-happy-path-e2e.mdx
Last updated on