Nightwatch: There should be a way to say "Assert(true or false)"

Created on 15 Apr 2017  路  4Comments  路  Source: nightwatchjs/nightwatch

If you're testing an api with your existing testing framework (nightwatch) and writing gets/puts to spec with request or something, it would be useful to be able to call AssertIPromiseIKnowWhatImDoingYall(true); to say "I did something that nightwatch doesn't have an API for, so I did it all by myself, but I want it to be in our unit tests"

I could just load google.com and assert that body is present or not present, but that seems hacky and unclean.

Most helpful comment

What about browser.assert.ok([true|false])? Is that what you mean?

All 4 comments

What about browser.assert.ok([true|false])? Is that what you mean?

Thanks. Hadn't found that one.

where I can find api for browser.assert.ok?
what options it accepts?
is there a callback?
does it return promise?

nevermind, found it here
https://nodejs.org/api/assert.html

Was this page helpful?
0 / 5 - 0 ratings