You've fixed your locators. You've switched to web-first assertions. Your tests still fail intermittently — but now the failures look different. Duplicate records in the database. Tests that pass alone but fail in parallel. Mocks that say everything is fine while production is broken.
This is the next layer of flakiness. It lives in your API calls, your test doubles, and your database. Better selectors won't help here.
Code examples are simplified for clarity — focus on the idea, not the boilerplate.
TL;DR
Use idempotency keys on POST requests — one network glitch shouldn't create two orders






