What Playwright Actually Buys Me
Table of Contents
One of my production apps moves real money — a subscription, Stripe on the backend, a trial that has to actually expire on time. I’m the only one who looks at the code before it ships. There’s no QA team, no staging environment somebody else pokes at — just me, and lately, Claude writing a lot of the implementation.
That’s the setup that made me take Playwright seriously. Not because testing is best practice. Because I needed something other than my own eyes catching the bug before a customer’s billing breaks.
A test that earns its keepLink to heading
Here’s one from the suite — checking what happens the moment a ward’s trial expires:
test('B3: expired trial locks admin (GET redirect + POST 403), public page stays up', async ({ page,}) => { const ward = await signupNewWard(page, { wardName: 'Billing B3 Ward' }) await setTrialEndsAt(ward.slug, '2000-01-01T00:00:00Z')
// GET: any admin page redirects to billing await page.goto(`/${ward.slug}/admin/events`) await page.waitForURL(`**/${ward.slug}/admin/billing`)
// POST: direct form submissions are rejected, not just hidden in the UI const res = await page.request.post(`/${ward.slug}/admin/settings`, { form: { name: 'Sneaky rename' }, }) expect(res.status()).toBe(403)
// The public page — the thing visitors actually use — stays up const pub = await page.goto(`/${ward.slug}`) expect(pub?.status()).toBe(200)})Three things in one test: the redirect works, the API route is actually locked down and not just hidden behind a disabled button, and the public page nobody’s paying for keeps working. That middle check is the one a manual click-through skips every time — nobody opens dev tools and fires a raw POST request to see if the server-side gate holds. Playwright does, on every run.
What changed when Claude started writing the testsLink to heading
I didn’t write most of those 3,300 lines by hand. Claude did, after I described the behavior I wanted locked down. I reviewed them — Playwright specs are readable enough that reviewing one takes a fraction of the time writing it would have.
That’s the part I didn’t expect going in. I thought Playwright’s value was “catches bugs before users do.” It is that. But the bigger shift is that it turned testing from a thing I’d skip under deadline pressure into a thing that costs me almost nothing to ask for. “Write a test for what happens when the trial expires” is a five-minute ask now. Before, it was an hour I usually didn’t have.
I wrote about this shift before — generation is getting cheaper, trust isn’t. Playwright is where that shows up concretely. AI made writing the test cheap. The test is still what makes me trust the code enough to ship it.
Where it actually catches meLink to heading
The production smoke test is the one that’s saved me the most:
test.use({ baseURL: 'https://mywardpage.com' })
test('production: public pages + events + program rendering', async ({ page }) => { await page.goto('/sandy-21/events') const eventLinks = await page.locator('a[href*="/events/"]').all() expect(eventLinks.length).toBeGreaterThan(0) // ...click through, verify the real page renders})That one runs against the actual live site, not a local build. It’s caught deploys that passed every local check and still broke something in production — a stale cache, an env var that didn’t make it into the build, a migration that ran against the wrong database. Local tests tell you the code is right. This one tells you the deploy is right, which is a different and sneakier kind of wrong.
Watching it happen beats describing itLink to heading
At work, I lean on Playwright the same way for a different reason: proving something works without making someone trust my word for it. Recording video and taking screenshots while a test runs turns “I verified it” into “here, watch it happen.” That’s done more for the quality of my work than I expected going in — it’s a lot harder to hand-wave past an edge case when there’s a recording of it.
One setting that made a real difference: turn on cursor tracking. A recording where you can actually see the mouse moving toward what it’s about to click reads completely differently than one where elements just change state with no visible cause. It’s the gap between watching something happen and being told it happened.
When the value of what you’re shipping depends on it actually working, you can’t go wrong leaning on Playwright for that — not just to assert expect().toBe(), but to produce proof somebody else can watch.
What I’d tell myself a year agoLink to heading
Don’t treat Playwright as the thing you add once the product matters. Add it while it’s cheap to add, because the cost only goes up — more routes, more roles, more money moving through more paths. I have four production apps now, and the ones with a real test suite are the ones I can touch without flinching. The ones without one are the ones I’m scared to refactor.
That fear is the actual cost of skipping it. It just doesn’t show up on a timeline.