Playwright guides
Short articles on the Playwright topics that trip people up most, with TypeScript examples. Each one links to the exercises where you practise it.
- Playwright practice for beginners: a four-week planA four-week Playwright practice plan for beginners: set up a TypeScript project, then work through hands-on exercises from your first click to a full end-to-end suite.
- Playwright locators: a practical guide with exercisesHow to choose Playwright locators that survive redesigns: getByRole, getByLabel, getByText and test ids, exact matching, filtering, combining locators, strict mode and shadow DOM, with exercises.
- Playwright auto-waiting: how to fix flaky testsWhy Playwright tests turn flaky and how to fix them: actionability checks, web-first assertions, timeouts, waiting for responses, expect.poll and toPass, with exercises.
- Testing iframes with PlaywrightHow to test iframes with Playwright: contentFrame() and frameLocator(), nested and duplicate frames, late frames, dialogs from frames and payment forms, with exercises.
- Playwright network mocking and API testingMock and inspect network traffic in Playwright with page.route(), fulfill, abort, fetch and waitForResponse, and test an API directly with the request fixture, with exercises.
- Playwright authentication: sign in once with storageStateHow to handle sign-in in Playwright tests: save the session with storageState in a setup project, sign in through the API, test several roles and handle sign-in popups, with exercises.
- Playwright Page Object Model with fixturesHow to structure a Playwright suite: Page Object classes in TypeScript, custom fixtures with test.extend(), state prepared through the API and tests that run in parallel, with exercises.
- File upload and download in PlaywrightHow to test file uploads and downloads with Playwright: setInputFiles(), in-memory files, file choosers, drop zones, the download event and checking file contents, with exercises.
- Playwright Trace Viewer: how to debug failing testsHow to debug a failing Playwright test: read the error and call log, record a trace, inspect snapshots, network and console in the Trace Viewer, and collect errors in code, with exercises.
- Running Playwright tests in CI with GitHub ActionsHow to run Playwright tests in GitHub Actions: the workflow file, CI settings for retries, workers and traces, reports as artifacts, sharding and keeping secrets out of the repository.
- Playwright cheat sheet: locators, actions and assertionsA one-page Playwright cheat sheet in TypeScript: commands, locators, actions, assertions, waiting, network, frames, dialogs, files and test structure, each linked to an exercise.