Playwright
Playwright drives a real browser through a static site the way readers use it, which makes it the tool for the parts of a static site that can break without the HTML changing: search and its index files, menus and focus handling, version switchers, forms backed by functions. The guides below use it in three places — on every pull request, against preview deploys, and on a schedule against production.
Two guides go beyond pass or fail. One measures layout shift and interaction latency inside existing tests, catching the regressions Lighthouse cannot see because it never clicks or scrolls. Another works through the causes of flaky runs against previews — the wrong deploy, cold caches, timing assumptions and third-party scripts — because a suite that fails one run in six stops being trusted.
Core Web Vitals Optimization for SSGs
- Measuring Web Vitals in Playwright TestsHow-toMeasure LCP, CLS and interaction latency inside existing Playwright tests on a static site, with throttling, stable thresholds and per-PR results.
Production-Ready Deployment & CI/CD for SSGs
- Accessibility Testing with axe and pa11y in CIHow-toRun axe-core through Playwright and pa11y-ci on sampled pages of a static site in both themes, fail pull requests on new violations and track the rest.
- End-to-End Tests for Static Sites with PlaywrightHow-toProtect the few interactive flows on a static site with Playwright: search, theme toggle, mobile menu, copy buttons and forms, run against every preview deploy.
- Synthetic Monitoring With Scheduled Playwright ChecksHow-toRun Playwright checks against a live static site on a schedule: search, forms and navigation, with screenshots on failure, alert routing and run costs.
- Testing Search and Navigation Flows With PlaywrightHow-toTest the interactive parts of a static docs site with Playwright: search results and keyboard use, mobile menus, sidebar state, versions and 404s.
- Visual Regression Testing on Preview DeploysHow-toScreenshot key templates on every preview deploy with Playwright, compare them with main, and review diffs in the pull request without drowning in noise.
- Fixing Flaky Playwright Tests Against Preview DeploysFixStabilise Playwright tests that run against preview URLs: wait for the right deploy, warm caches, drop timing assumptions and isolate third parties.
Often used with Playwright
- Lighthouse1 shared guidesBudgets, Lighthouse CI and lab against field data.