Waits & assertions
Task-first recipes for waits & assertions.
Wait for an element to disappear
Let a spinner, loader, or toast finish before you assert on what replaces it.
Wait for text to appear
Let a label, message, or heading settle before you assert on it, without guessing a delay.
Assert a list count
Check how many elements a locator matches, and wait for the right number instead of counting too early.
Poll until a condition is met
Let assertions retry for you, and write a bounded polling loop only for a condition no assertion covers.