This episode covers runbooks for flaky tests, environment drift, and browser failures, managing suite health and team ownership, recovery strategies when baselines change, as well as maintenance and cleanup task schedules.

A healthy suite isn't just about green tests today — it's about how the team reacts when tests fail, who's responsible, and how to recover after a problem. This episode 19 covers operational readiness: runbooks, ownership, and maintenance processes that make a suite manageable in the long term.
Like production operations, a test suite needs procedures. A runbook answers "what do I do right now?" when tests are flaky, when there's environment drift, or when a browser fails. Ownership answers "who resolves this?" And maintenance answers "when do we care for the suite before it breaks?" We'll put all three together one by one.
A flaky test is one that sometimes passes and sometimes fails with no code change. Here's the step-by-step runbook:
getByRole or getByTestId.waitForTimeout with waiting for a condition.[ ] Grab the trace from CI
[ ] Identify the failing step
[ ] Check the locator and timing
[ ] Fix the root cause, not the symptomsEnvironment drift happens when CI differs from local — Node, browser, or dependency versions aren't in sync. Detection and steps:
npx playwright --version in CI and locally.package-lock.json or bun.lock) is committed.A browser that can't launch is usually due to missing system dependencies on Linux CI. The fix:
npx playwright install --with-depsnpx playwright install --with-deps installs the browsers along with system dependencies. If the CI runner already uses the official Playwright image, these dependencies are already there — so choose an image matching your Playwright version.
Suite health can be measured with simple metrics monitored regularly:
npx playwright test --reporter=json --output=report.json--reporter=json produces structured data that a script can process to monitor health metrics automatically.
Every test suite needs a clear owner — not "everyone," which really means no one. Assign ownership per area: the frontend team owns UI tests, the backend team owns API tests, and one coordinator maintains the suite's configuration and infrastructure.
Treat tests like production code: every test change must go through review. This prevents changes that lower quality — for example, removing an assertion to make a test pass, or adding a waitForTimeout to cover up a problem.
When the design changes, visual baselines (episode 16) must be updated. A safe procedure:
--update-snapshots.If a diff appears with no design change, it's an alarm — don't update the baseline to cover it up. Investigate the cause: maybe fonts changed, dynamic content got rendered, or the rendering environment differs.
For major changes (a full page redesign), freeze the visual tests temporarily, complete the change, then regenerate the baselines from the correct state. Document the freeze period so the team understands why visual tests didn't run during that time.
A suite needs periodic care, not just when it breaks. A healthy schedule:
Removed features leave behind dead tests. Delete obsolete tests together with their features — tests pointing at features that no longer exist only add runtime and confusion.
[ ] Remove tests for removed features
[ ] Update locators that reference old elements
[ ] Verify fixtures and helpers still in use
[ ] Update snapshot baselines after design changesTest artifacts (screenshots, videos, traces) quickly fill up storage. Set retention in CI — GitHub Actions can set retention-days, and the local test-results folder can be cleaned automatically:
rm -rf test-results playwright-reportThe command rm -rf test-results playwright-report cleans up local test results. Get in the habit of running it periodically so the workspace doesn't bloat with old artifacts.
Episode 19 equipped you with the operational side of testing: runbooks for the three most common failures, metrics and ownership for keeping the suite healthy, recovery procedures when baselines change, and a maintenance and cleanup schedule that prevents silent decay.
Key takeaways:
npx playwright install --with-deps resolves most Linux CI browser failures.In the next episode we'll discuss real-world use cases and patterns — real examples of e-commerce checkout, signup flows, and dashboard workflows, test design patterns for end-to-end automation, balancing UI tests with API and component tests, and prioritizing tests for critical business paths.