testdevlab / TestUI

MIT License
33 stars 9 forks source link

Add function to check that element is in the viewport/ rework .untilIsVisible #90

Open Kirils-Podgalskis opened 1 year ago

Kirils-Podgalskis commented 1 year ago

.untilIsVisible throws "true" regardless whether element is actually visible inside a Viewport

alvarolaserna commented 1 year ago

The method is not meant to return any value, maybe you are thinking of

.isVisible()

?

The untilIsVisible() is just an assert and will either pass or fail, raising an error

Kirils-Podgalskis commented 1 year ago

I mean, yes, it passes regardless whether element is actually visible inside a Viewport

alvarolaserna commented 1 year ago

the way it works is if the element is visible within the page, even when you have to scroll down/up to get it into view. it will through false if the element is hiden. For example, when you go to google.com and you press on the input to check suggestions, there is an element that is about feedback on suggestions. This element will through false if you have not opened the suggestions dropdown.