Playwright + JS · Lesson 34 of 35
Module 34: Retries & Flaky Test Management
Try it yourself
Implement classifyOutcome:
The editor has a worked example. Read it, tweak it, then press Mark as complete.
playwright.config.jsexport default {
retries: process.env.CI ? 2 : 0,
};Stress test for flakiness locally:
npx playwright test tests/checkout.spec.js --repeat-each=20Flaky tests erode team confidence in test automation. In this lesson, we will explore the root causes of flakiness, configure intelligent retry strategies for CI pipelines, and use Playwright tools to identify, isolate, and permanently eliminate flaky tests. Let's build rock-solid stability!
Part of the Playwright + JS course (Playwright with JavaScript). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
No. Retries prevent blocking CI pipelines on transient network glitches. Every flaky test should be diagnosed and stabilized using Trace Viewer.
Finished reading?
Review the worked example in the editor, then mark the lesson complete.