I'm new to protractor and I want to create an expect like this:
expect(elementIsVisible).toBe(true);
I saw that protractor has EC (expected conditions), namely EC.visibilityOf
which seems to be what I'm looking for. However, I'm not entirely sure what visibilityOf
returns.
I find the docs very obscure:
RETURNS
+-----------+-------------------------------------------------------------------------------------------+
| Type | Description |
+-----------+-------------------------------------------------------------------------------------------+
| !function | An expected condition that returns a promise representing whether the element is visible. |
+-----------+-------------------------------------------------------------------------------------------+
What it returns? A Promise
or an expected condition?
Well, considering that chaining a .then
triggers then is not a function
, it seems it returns an expected condition. But what's that?
In all Protractor documentation examples, this return value is used in browser.wait
functions.
I don't want to use it like that, I want to have a true
/false
value in my expect
condition.
If I try to find more information from Selenium's examples, Protractor (a javascript implementation) redirects to Java documentation...