-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add actionable message in async hook timeout error. #4031
Comments
help
text in async hook timeout error.
hii can i work on this issue please? |
Hi, please go through GSoC Contributor Guidance for Nightwatch. It contains details on how the issues will be assigned. |
yeah i read the guidelines already and did setup the project locally i can now work on this issue right? |
Yeah, sure. Go ahead! You don't need to ask before starting to investigate an issue, and as soon as you feel like you are close to a solution, let us know here how you plan to solve the issue and we'll assign the issue to you. |
ok thanks |
Hi, @garg3133 i have checked on that file . currently, the default timeout is set is 15000, although here it shows 10000 https://nightwatchjs.org/guide/writing-tests/using-test-globals.html . Will you assign me to this? hope i am able to explain u well... |
Hey @SjxSubham, that I'd suggest you investigate further on this till the point you roughly know what change you'd need to make and where. |
Hi @garg3133 , |
@FireNdIce3 That seems a good enough investigation and you're going in the right direction. I'll assign the issue to you. |
It had been a few days since there was any update on the previous PR. While playing around i actually found the fix for it, hence raised a PR #4053 . |
hi @dikwickley |
Hey @FireNdIce3 i used debugger only. Following along the code execution. |
Currently, the default timeout for hooks is set to
20000
ms, but sometimes execution of hooks might take longer than that (when loading a slow website inbefore
hook for example), and all the user gets is the following error with no clear indication on how to fix it:Here, the timeout of hooks can be modified by setting the
asyncHookTimeout
globals config, but the user does not know that such a config exists.So, we should make the user aware of this potential solution in the error message itself, by adding a
help
property to the error object, which we use to provide actionable error messages to the users (that is, the actions user can take to resolve the issue).Steps to reproduce
npm init nightwatch@latest <project-name>
(with defaults)cd <project-name>
asyncHookTest.js
insidetest
folder, with the sample test provided below.nightwatch.conf.js
file, add aglobals
property with the following value:npx nightwatch ./test/asyncHookTest.js
Sample test
Potential Fix
This issue can be potentially solved by narrowing down where the error is coming from and adding a
help
property to the error object (check the codebase to look at the other places this has been done already) with the instructions to potentially fix the issue by setting theasyncHookTimeout
globals config. Also make sure that thehelp
only shows up in case of timeout due to the hooks only, and not in all the cases.The text was updated successfully, but these errors were encountered: