Home / Blog
Playwright, written down
What we learned building and repairing these suites, including the parts that make a bad afternoon.
Choosing a framework
What Playwright does not do
Every limit with its source, and not one of them is a compliment wearing a disadvantage's clothes.
Playwright vs Selenium
Not which is better — what breaks when you move a suite you already have, and the four places Selenium still wins.
Playwright vs Cypress
The differences are architectural, and each one has a price. Where Cypress is better, said plainly.
Playwright vs Puppeteer
A library against a test framework, which is not a fair fight and not the question — so here is the one worth asking.
Playwright vs WebdriverIO
One arrives whole, one is assembled from services and reporters. And one of them reaches a native app.
TypeScript or Python?
Same browser API in both. The test runner is Node-only, and that is the whole decision.
Getting started
Playwright, after the quickstart
The four decisions that are cheap on day one and a project to undo later — the hour the documentation has no reason to write.
What Playwright is, and what it is not for
Three engines, one API, four languages, and the four things it will not do.
How Playwright actually works
One connection instead of a request per command, and what that changes about the tests you write on top of it.
Writing tests
Best practices, ranked
Ordered by what they save you, with four marked contested and left unresolved.
Why your Playwright test is flaky
Four causes, how to tell which one you have, and the one fix that is not a fix.
Which wait actually fired
Seven timeouts, three defaults, and the nesting that makes one of them unreachable.
What to assert, and which assertions wait
The ones that poll and the ones that judge once — and why the second kind is how a suite acquires a race.
Iframes and shadow DOM
Two different boundaries that readers arrive confusing, and the one nothing gets into.
Which locator to use
The seven built-in locators ranked for a real application, and what to do when the recommended one does not exist.
Staying logged in
Four login patterns, and the expiry whose failure message never says the word session.
What to mock, and what it costs
A mocked test and a real one answer different questions — so the page says which is worth what.
When to write a fixture
Setup that survives a failing test body, and the teardown a discarded worker still runs.
Do you need a page object model?
Twelve arguments, each with a verdict attached — including the two weakest, one from each side.
Visual regression, without the noise
A baseline is keyed to the platform that made it. What belongs in the frame, and which tolerance option applies.
Where test data comes from
Three ways to get a record in front of a test, what each costs, and who deletes the row when the run dies halfway.
API calls from a browser test
The request fixture sends real HTTP from a test file. Where that beats a dedicated API tool, and where it stops.
Uploads and downloads
The drop zone with no input in it, and the export nobody opens — the cases setInputFiles does not cover.
Accessibility checks in the suite
What a scan decides on its own, what it leaves to a person, and why a green run is not a conformance claim.
What the generator hands you
Codegen, three test agents and a bundled MCP server in 1.62, and the regression a generated test stayed green through.
Component testing in a real browser
What a browser catches that jsdom cannot, what the gallery costs to keep, and where the line against end-to-end sits.
Running them at scale
Workers, shards, and where each stops paying
A scaling curve measured on one machine, and the arithmetic for the shard count from two numbers you time yourself.
Playwright in GitHub Actions
The docs’ workflow goes green on the first push. Week two is the bill: pull request against nightly, shards, and who reads a red job.
Reading a failing CI run
The build is red, the machine is gone, and the trace is the only witness left.
Which reporter, and who reads it
Four readers, one reporter array that serves all four, and what the HTML report does not render off the file system.
Playwright in Docker
The official image is usually the whole job, until its tag and the version in your project disagree.
Playwright vs TestCafe
TestCafe stopped defaulting to its proxy in 3.0, and the browser string still decides which mechanism the whole run gets.
The Playwright MCP server
Twenty-four tools out of the box, 68 with capabilities on, and a --help that names three of the eight.
Playwright cheat sheet
The locators, assertions and CLI flags worth keeping open in a tab, every one of them run against 1.62.1.
Playwright interview questions
Eight questions an interviewer can actually score, and what a good answer sounds like when the candidate has done the work.
Mobile emulation
A viewport, a user agent and a touch flag in a desktop engine. What that catches, and the things it cannot.
The library or the runner
Two packages, and a working `playwright test` command is no evidence you have the one you think you have.
Onboarding a team
The first weeks, the conventions worth fixing early, and the two checks that do not cover for each other.
Reading this because something is flaky?
Send the suite and the last week of CI runs. Flaky-test remediation starts there.