I have a problem with cucumberjs. I cannot find a way to ensure that element with given selector is presented into DOM. I\'m using cucumberjs with Chai. https://github.co
Why when expecting the promise to return element we use “false”? Maybe you mean: expect(element.isPresent()).to.be.true
?
Almost all functions in Protractor return promises that will resolve into the values you actually want to test against. So if you're just trying to do something like the following, it will always fail because it's asserting on the promise object returned by isPresent
:
expect(element.isPresent()).to.be.false
I would recommend using the chai-as-promised plugin for Chai to handle situations like this. It provides the eventually
chain that will resolve promises for you and assert on the resulting value. The above example would look like this:
expect(element.isPresent()).to.eventually.be.false