The Flaky Test Checklist: 10 Causes and Their Fixes
Every flaky Playwright test we have ever debugged came down to one of these ten causes.
By Karthik Kodati · 18 September 2026 · 5 min read
Flaky tests destroy trust in a suite faster than missing tests. Work through this list top to bottom.
- Hard-coded sleeps. Replace
waitForTimeoutwithexpect(locator).toBeVisible()orwaitForResponse. - Ambiguous locators. If
getByRolecan match two elements, it will eventually pick the wrong one. Tighten it. - Shared test data. Two parallel workers editing the same record. Create data per test.
- Order dependence. Run the test alone. If it fails, it depends on another test.
- Animations. Disable them in test environments or wait for the animation end.
- Network races. Assert on the response, not on a spinner disappearing.
- Timezones and dates. Freeze the clock with
page.clockor inject a fixed date. - Third-party scripts. Block analytics and chat widgets with
page.route. - Viewport differences. Pin the viewport in config, not per test.
- Environment drift. CI runs a different browser version. Pin versions in
package.json.
Keep a retry budget of one in CI, and treat every retry as a bug to fix, not a feature to rely on.