-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to create custom assertion with no arguments #924
Comments
You can just use it on the main nightwatch object, instead of the page. On Sat, Apr 2, 2016 at 11:19 AM, Heath Morrison [email protected]
|
This is what we ended up doing, though it has the minor annoyance of breaking chaining. |
Wait, so is it not a bug though that the command wrapper doesn't check it's arguments? |
Oh yes, you're right. I misunderstood the issue. |
Hello,
A bit new to Nightwatch - but we're trying to make a custom assertion which takes no arguments, and the Page Object command wrapper is naively trying to tweak the first parameter. The assertion we're building,
noConsoleErrors
, is not element scoped so rightly needs to parameters. It looks something like this:Usage is like this:
When called in that way (without a message), the command wrapper fails:
Problem appears to be caused by naive assumptions about available parameters in the command wrapper: https://github.com/nightwatchjs/nightwatch/blob/master/lib/page-object/command-wrapper.js#L71
Are we doing something wrong, or is this a legitimate bug? Is there an obvious work around?
Nightwatch 0.8.18
The text was updated successfully, but these errors were encountered: