Appearance

Visual style

Mode
Theme
Accent
Advanced
Text sizeScales the whole site
16 px
Reduce motionReduce animations or match your system
Separate light and darkChoose a theme, accent and font for each
50

Technology · Quality

End-to-end testing with Playwright

Playwright is an end-to-end testing framework from Microsoft. Its documentation describes one API for driving Chromium, Firefox and WebKit, with auto-waiting, device emulation, network interception, tracing and parallel test execution.

In practice

How I use Playwright

I set up the cross-service Playwright suite for Ekonavi's multi-app platform. On the websites I build, Playwright runs against the production build on desktop and a mobile profile (Pixel 7): navigation, forms, filters, reduced motion, no horizontal overflow at 320 px, and, on site migrations, a check that every URL in the old sitemap returns 200 or redirects to a page that does.

What I test on every website

CheckWhy it matters
Key pages render with no console errorsCatches broken scripts before visitors do
Primary CTA flows (enquiry, WhatsApp, booking)These are the business outcomes
Menu opens, marks the current page, closes on EscapeMobile navigation is where most sites break
No horizontal overflow at 320 pxThe most common mobile layout bug
Reduced motion shows all contentAccessibility and resilience
Every old URL resolves (migrations)Protects search rankings and inbound links

Illustrative example: migration URL coverage

import { test, expect } from "@playwright/test";
import legacyUrls from "./fixtures/legacy-sitemap.json";

for (const path of legacyUrls) {
  test(`legacy URL resolves: ${path}`, async ({ request }) => {
    const res = await request.get(path, { maxRedirects: 5 });
    expect(res.status(), path).toBe(200);
  });
}

Platform suites

On a multi-app platform, the valuable tests cross service boundaries: sign in on one app, act in another, confirm the API and data layer agree. They belong in CI against deployed staging: after the deploy, before promotion to production.

Trade-offs

Where Playwright shines, and where it doesn't

Strengths

  • Tests real browsers, including mobile emulation, against the build users will get.
  • Auto-waiting removes most flaky sleeps.
  • Traces make CI failures debuggable.

Limitations

  • E2E suites are slower than unit tests; they should cover critical flows, not every branch.
  • Tests against shared staging data need careful setup and teardown.

Sources

Official documentation

General descriptions on this page are based on the official documentation linked below. Experience notes are my own.

FAQ

Playwright questions

Do small business websites need end-to-end tests?

A handful, yes. A few Playwright tests (pages load without console errors, the contact or booking form submits, the menu works on mobile, no horizontal scroll) catch the regressions that actually lose enquiries, and they run in under a minute.

How do you protect SEO during a website migration?

I extract every URL from the old sitemap and test each one against the new build: it must either return 200 or redirect to a page that returns 200. On the Eastern Condiments rebuild that check covered 442 original URLs.

Playwright or Cypress for end-to-end testing?

Both are capable. Playwright supports Chromium, Firefox and WebKit with one API, runs tests in parallel across browsers out of the box and handles multiple tabs and origins well. Cypress has an excellent interactive runner. I use Playwright, mainly for its cross-browser and mobile emulation support.

Need a Playwright developer?

If your project needs Playwright, send a short description of what you're building and where it's stuck. I'll reply with how I'd approach it.