I want to verify that an element is present when I access a page using the above mentioned FWs, is there any similar assertion library for these like the one that exists in Jasmine?
Asked
Active
Viewed 1,678 times
1
1 Answers
2
protractor
actually documents how to configure protractor
to work with cucumber
framework. You need to add:
framework: 'cucumber'
to your protractor config and use a separate assertion library to deal with resolving promises while making your expectations. Here is an example that uses chai-as-promised
plugin to Chai
assertion library. That said and based on that, here is how you can assert an element is present:
expect(element(by.id('myid')).isPresent()).to.eventually.be.true;
eventually
here is that "magic" that implicitly resolves promises.
Note that CucumberJS
and Jasmine
are mutually exclusive, see: