Reputation: 1242
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
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