I am working with a Protractor and Cucumber to test a React project. In the course of this I have some elements that will have visibility:hidden/visible and I would like to use Protractor's isDisplayed or isPresent to test with.
I wrote a little test because I was getting some strange output and it looks like this:
this.Then(/^skal jeg kunne legge inn et nummer$/, function () {
var inputfelt = element(by.css(".mdl-textfield__input"))
expect(browser.isElementPresent(inputfelt)).to.eventually.equal(true)
expect(browser.isElementPresent(inputfelt)).to.eventually.equal(false)
});
This is my last version of this where I am using browser.isElementPresent. I have also used inputfelt.isDisplayed and inputfelt.isPresent and for all three of them this test passes.
I cannot see how it should be able to pass as the field cannot both be present and not be present.
Am I using this wrong?