If I define a page object myPage:
return {
myButton: element(by.css('#my-button'))
};
And then elsewhere perform an isElementPresent check:
return browser.driver
.isElementPresent(myPage.myButton);
I get the folowing error:
Error: Failed: Invalid locator
Why?
I suspect if I remove the element invocation, this would work. element returns an elementFinder IIUC. But isElementPresent is clearly not designed to work with elementFinders. Why?