How can we can perform negative assertions on values in the framework?
So we take "foo" then compare to "bar" expecting it to NOT match (which is correct) and fail if it does match? Is there a straightforward way to doing this?
assert.notEqual maybe?
The node.js assert module is available within nightwatch:
http://nodejs.org/api/assert.html
Thanks
Just looked if I could invert "assert.containsText" - with assert.notEqual. Probably not?
If so, then I think i could contribute to separate notContainsText / attributeNotEquals :-)
Could you please confirm @beatfactor ?
@vinogradoff You can just invert the condition inside those two commands in
the pass method. If you will contribute, please add tests also and api
docs. Thanks.
On Tue, Mar 18, 2014 at 3:47 PM, vinogradoff [email protected]:
Just looked if I could invert "assert.containsText" - with
assert.notEqual. Probably not?If so, then I think i could contribute to separate notContainsText /
attributeNotEquals :-)
Could you please confirm @beatfactor https://github.com/beatfactor ?
Reply to this email directly or view it on GitHubhttps://github.com/beatfactor/nightwatch/issues/87#issuecomment-37941001
.
Worth re-opening this as the fix sounds a lot better than the assert.NotEqual (only throws an error)
:+1:
Although there is a possible solution i think it may be a good spot for a refactoring to provide a clean, consistent and _testable_ _api_ in the long run.
What do you think ?
/cc @beatfactor
so what's the issue on hand here? it's not very clear anymore what needs to be done.
I would be happy to contribute, but I have only the next week some free time.
If it’s okay, just let it open, I try to do new methods.
Am 21.03.2014 um 16:52 schrieb Andrei Rusu [email protected]:
so what's the issue on hand here? it's not very clear anymore what needs to be done.
—
Reply to this email directly or view it on GitHub.
done.
Note: attributeNotEquals - passes, if attribute does not exist, but the element does.
I did it so, because attributeEquals just don't pass, but without error, if attribute doesn't exist.
So I thought, they must be complement. (attributeNotEquals always negate of attributeEquals).
Hiya,
Not sure the documentation was added for this, is that correct?
Most helpful comment
assert.notEqual maybe?
The node.js assert module is available within nightwatch:
http://nodejs.org/api/assert.html