Tutan Ramen
Tutan Ramen

Reputation: 1242

Manual assertion in Nightwatch.js not related to DOM

So, the only way I know to do assertions in Nightwatch is via browser.expect which is tied to the DOM in some way.

Is there a way for me to do a manual assertion such as: expect(true).to.be(true) and have that assertion tie into the nightwatch testrunner?

Upvotes: 1

Views: 373

Answers (1)

Jonathan Ross
Jonathan Ross

Reputation: 550

Looks like you can do browser.assert.ok(condition). It's not listed in the API documentation but it appears in the example at the start of API / Commands. It doesn't chain with other assertion functions so must be done in a callback, as shown.

Upvotes: 2

Related Questions