FRAMEWORK GUIDES · 7 MIN READ

Playwright Flaky Tests: Root Causes, Retries, and Quarantine

Eliminate Playwright flaky tests with web-first assertions, network idling fixes, trace analysis, and automatic FlakeCheck quarantine.

Why End-to-End Playwright Suites Flake

Playwright includes auto-waiting, yet E2E tests still flake when scripts use manual element handles instead of web-first locators, race against background API hydration, share browser storage state across workers, or hit throttled CI runner CPUs.

// playwright.config.ts
export default defineConfig({
  retries: process.env.CI ? 2 : 0,
  reporter: [['json', { outputFile: 'playwright-results.json' }]],
  use: { trace: 'on-first-retry' },
});

Streaming Playwright JSON to FlakeCheck

With retries enabled on CI, Playwright records every failed attempt and passing retry inside playwright-results.json. Streaming that file to FlakeCheck immediately surfaces proven flakes with 100% confidence, extracts exact selector timeout evidence, and computes wasted runner minutes.

npx playwright test
npx @onurdrsn/flakecheck ingest playwright-results.json --format playwright

Eliminate flaky tests automatically with FlakeCheck

Stream your JUnit, CTRF, Jest, Vitest, Playwright, Pytest, Mocha, or Go reports to FlakeCheck and get statistical scoring + auto-quarantine in minutes.

Related Guides