Learn Playwright with the Movies app
Hands-on course on a real Next.js movies app with a local mock API. Official concepts live on playwright.dev. This site is where you practice.
Try the live Movies app in the browser. Clone the repository when you want to run Playwright locally.
Pick your path
| Path | Start at | Skim or skip |
|---|---|---|
| Beginner | 01 Overview | none |
| Intermediate | 05 Tags or 06 Auth | 01 to 04 if you already know ARIA, UI Mode, and env credentials |
| AI-first | Agent house style and 07 Fixtures, then 09 AI path | Still read fixtures before generating tests |
Start with 00 Start here once.
Agenda
- Overview, structure, config, first test
- First test and credentials
- ARIA snapshots
- Debugging: UI Mode and traces
- Tags and annotations
- Auth setup and storageState
- beforeEach, fixtures, helpers
- Network mocking and API testing
- AI writing path
- Bonus: sharding
- Bonus: page objects
Course outcomes
By the end you should be able to:
- Run tests with the CLI and UI Mode on a local clone
- Write a small test with
.envcredentials (no Codegen) - Assert with role locators and
toMatchAriaSnapshot - Debug with UI Mode and Trace Viewer before changing locators
- Organize runs with tags and annotations
- Use auth
setupandstorageStatefor logged-in projects - Prefer helpers and list fixtures over copy-pasted setup
- Mock network responses and call the mock API with
request - Drive plan, generate, and heal with house style, then pass the review rubric
Foundations smoke check
After modules 01 to 04, these should pass on a local clone:
bash
npx playwright test tests/logged-out/movie-list.spec.ts --project=chromium
npx playwright test tests/logged-out/auth.spec.ts --project=chromium
npx playwright test tests/logged-out/search.spec.ts --project=chromiumExtra practice
After the matching modules (especially 03, 07, and 09), try the exercises on a clone. Solutions live next to each exercise—attempt the task first.