Wait or sleep?
Slow the app down and compare a fixed pause with a check that keeps retrying.
The diagram
After Lily taps Save, the app shows “Saved” after some time. Drag the slider to change how long the app takes. Each row is one way a test could wait for it.
- A fixed pause of 1 second: fails, after 1.0 seconds.
- A fixed pause of 4 seconds: passes, after 4.0 seconds, 1.5 of them wasted.
- A check that keeps retrying: passes, after 2.5 seconds.
The short pause fails: it stopped waiting too soon. The retrying check passes the moment “Saved” appears.
The 5 second limit is a teaching figure. A team sets the real limit.
SYNTHETIC / TRAINING ONLY. The Daily List app and the people in it are made up, and every number is a teaching figure.
What this shows
Auto-waiting and web-first assertions: a retrying check passes as soon as the page is ready and fails only after a limit, while a fixed pause is either too short or wasteful.