Objective: Debug from evidence, and classify flake by species — because each species has a different cure, and the wrong cure is worse than the disease.
⏱ ≈53 min full lesson · English edition — Español · العربية · বাংলা in translation
Open evidence in this order: 1) THE TRACE — time-travel: every action, the DOM at that moment, network, console. 2) THE VIDEO — the human-speed story. 3) THE FAILURE SCREENSHOT — one frame, fastest glance. 4) THE ERROR TEXT — read it FULLY; the answer is embarrassingly often in line three. No guessing what the page looked like; you can visit it.
Playwright AUTO-WAITS: actions and assertions retry until ready (up to your expect timeout). Flake is born when tests fight that system — chiefly waitForTimeout as a STRATEGY. A fixed sleep bets the machine is always faster than your number and never slower. Replace sleeps with the assertion that describes “ready.”
TIMING (passes locally, fails under load) → readiness assertions. STATE (fails with others, passes alone) → independence: own data, teardown. ORDER (fails after one specific test) → a shared-state leak; detective work.
ENVIRONMENT (one browser/device column only) → engine truth; fix the assumption. PRODUCT (the app is intermittently broken) → the test is RIGHT; file it with the trace, don't shoot the messenger. TEST-DESIGN (fails when data changes legitimately) → over-specified assertions (A-06's trap).
Your config's retries: 1 exists so one hiccup doesn't stop a human's run. But in GATING runs, a test that needs its retry is a failure wearing a costume: count retry-passes AS FAILURES in reporting, or your flake rate goes invisible exactly where it matters.
Keep a FLAKE LEDGER: every intermittent failure, one line — test, signature, species guess. Bring it to the next failure. Pattern-matching against the ledger is how senior engineers look fast.
Flake, classified and priced later in P-04. Next: visual engineering — baselines and thresholds.