1

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?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
Bruno Soko
  • 624
  • 6
  • 20

1 Answers1

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:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195