Playwright · Middle · Question 38 of 75
Why can await locator.isVisible() cause flaky tests?
- 1It always throws when the element is hidden
- 2It waits for the full test timeout every time
- 3It checks once without waiting for the element
Show the answer
Correct answer: It checks once without waiting for the element
Explanation
isVisible() returns the state right now. Using it in conditions or expect(...).toBe(true) races with rendering; web-first assertions retry.