Playwright · Junior · Question 67 of 75
What does toBeVisible() consider visible?
- 1Only elements inside the current viewport
- 2Any element present in the DOM tree
- 3A non-empty box and not
visibility: hidden
Show the answer
Correct answer: A non-empty box and not visibility: hidden
Explanation
Elements with zero size, display: none or visibility: hidden are not visible. Being scrolled out of view still counts as visible.