Reputation: 151036
For .waitForElementNotVisible(selector, 2000)
, supposedly, it can test whether the element is fading out in 0.75 second.
But what if our code has a bug, and it is doing the wrong thing and the element is not visible and is fading in?
Now, won't .waitForElementNotVisible()
actually still succeed (and pass the test), because at time = 0, it really is not visible (because it is fading in).
In other words, .waitForElementNotVisible()
can succeed no matter what?
(There can be two situations, one is JavaScript adjusting the opacity every 33ms, for example, and the other case is CSS transition).
Upvotes: 0
Views: 340
Reputation: 626
I think this is an assertion so you should use expect/assert api instead:
browser.waitForElementNotVisible(selector, 2000)
be
browser.expect.element(selector).to.not.be.visible.after(2000);
Upvotes: 0