34. Flaky Test Elimination & Retry Strategy

Retrying Tests in playwright.config.js

export default {
  retries: process.env.CI ? 2 : 0,
};

Stress test for flakiness locally:

npx playwright test tests/checkout.spec.js --repeat-each=20

Task

  • Implement classifyOutcome:
  • 1. Accept attempts (number) and passed (boolean).
  • 2. Return "FAILED" if !passed; "FLAKY" if attempts > 1 and passed; otherwise "PASSED".
πŸ’‘Common doubts
Did you like the problem?
Lesson 34 of 35
JavaScript
Loading code editor…
Next