Playwright · Middle · Question 38 of 75

Why can await locator.isVisible() cause flaky tests?

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.

Further reading

Problem with a question

Playwright · Middle · question 38

Test yourself

Take the Playwright · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz