Playwright from Scratch — Setup and First Test
Learn why Playwright is the modern choice for E2E testing. Set up your first project, write a reliable test using auto-waiting and accessible selectors, and understand the browser/context/page mental.
Hands-on E2E testing with Microsoft Playwright — from the first test through network control, browsers, permissions, files, and the page, frame, or dialog the click actually opened.
16 / 17 parts
← All seriesLearn why Playwright is the modern choice for E2E testing. Set up your first project, write a reliable test using auto-waiting and accessible selectors, and understand the browser/context/page mental.
Master Playwright's locator strategy. Learn why role-based selectors are superior to CSS, when to use test IDs, how to filter and chain locators, and avoid the brittle patterns that break on every UI.
Compare the classic Page Object Model with Playwright's fixture-based composition. Learn when each pattern wins, how to avoid god objects, and structure test code for maintainability at scale.
Master Playwright's web-first assertions and auto-waiting to eliminate flaky tests. Learn why waitForTimeout is a bug, when networkidle helps, how expect.poll works, and whether to retry or fix the.
Learn how to use Playwright's APIRequestContext for backend testing. Seed test data via API before UI tests, validate responses, handle authentication headers, and decide when API tests beat E2E.
Authentication in tests is deceptively hard. Learn how to use Playwright's storageState to log in once and reuse sessions, support multi-role testing, and avoid the most common security and.
Visual regression tests catch UI changes you didn't intend. Accessibility tests catch barriers you didn't notice. Learn when visual testing helps, when it's noise, and how to integrate axe-core for.
Playwright tests can run in parallel across multiple workers and even multiple machines. Learn how to configure workers, shard test suites for CI, collect trace and video artifacts, and set up a.
Failed tests are not problems — they're clues. Learn how to use Playwright's UI mode, trace viewer, headed debugging, and artifact analysis to isolate flaky steps, understand root causes, and fix.
Most test suites rot over time. Tests become flaky, slow, and ignored. Learn the practices that keep Playwright tests valuable as your team grows: ownership, tagging, smoke vs regression, locator.
Use Playwright routing to fulfill, abort, or pass through calls so a UI test fails for the reason you intended.
Run Chromium on every pull request. Add Firefox and WebKit only where those engines produce bugs you have actually seen.
Test geolocation, clipboard, camera, and notifications when the user says no. A fixture that grants them all hides that path.
Test the files users upload and download: type, size, name, and a look inside. An enabled button is not proof the file survived.
When a click opens a popup or a new tab, assert on that page. The opener staying put is not evidence the new window worked.
When a control lives inside an iframe, point the locator at that frame with frameLocator. A locator on page searches the outer document and misses it.