-
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
Error in beforeEach() in global settings does not cause the test to fail #1293
Comments
I played around a bit more with this and it seems like whenever an assert fails in a global before(), a global beforeEach() or a before() in a testsuite the test is not marked as failed and nightwatch exits with the exitcode 0. But when an assert fails in a local beforeEach() nightwatch counts it as failed and therefore exits with exit status 1. Version: The current 0.9.9 |
OK please ignore this here. It seems like this error just occurs if there is a condition between a async before() function and the execution of the code. Because nightwatch works correctly when I call done() directly but not when I do something else (like perform a HTTP request to a service) first and then after that is done call done(). When there is something inbeween and done() gets called with a delay, nightwatch does not work as expected. Because I can't reproduce this behaviour consistently, please ignore this issue until I can provide better input for you guys... |
Some of the inconsistent behavior you're seeing may be from #1276 |
Yes that could be. But funnily enough, I nove moved stuff away from the global settings-hook into the hooks in the individual files and also removed the async hooks (so no done() anywhere) and now it's working fine... |
This issue has been automatically marked as stale because it has not had any recent activity. |
I have the following code in my settings.js (a global settings file):
Which generates the following output:
That means that if there is an element not found in the the pageObject command performLogin (which uses
waitForElementVisible
) the test is just skipped instead of failed.I would want the test then to be marked as failed. Is there a way to achieve this?
The text was updated successfully, but these errors were encountered: