waitForTimeout): Relying on arbitrary sleep timers instead of actionability checks.
2. Shared State: Test A mutating data that Test B depends upon.
3. Fragile Locators: Relying on generated CSS classes that mutate between builds.
4. Animation Latency: Clicking an element while it is sliding into view.---
export default defineConfig({
// Retry 2 times on CI, 0 times locally
retries: process.env.CI ? 2 : 0,
});When a test fails on attempt 1, passes on attempt 2:
- Playwright marks the test as Flaky (yellow status).
- Captures full traces of the failed attempt for inspection.
---
npx playwright test tests/checkout.spec.ts --repeat-each=20If it fails even once, fix the locator or synchronization before merging!