Closed LucaLis closed 3 years ago
I had the same timeout error, my workaround at the moment is transforming the custom command to async/await command https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-commands. Hope it will work for you as well until the bug is fixed.
Thanks a lot @ituradastra - your workaround works!
Thank you @ituradastra for the help.
Howdy!
I'm facing quite strange behaviour that seems to be related with custom commands, screenshots on failure and cucumber. The problem is that failing scenario is causing a freeze of subsequent scenario which at the end causes cucumber timeout. I managed to reduce the test code to bare minimum to isolate the problem - more details below. I also tried to cause similar problem using pure nightwatch but without luck so this is why I'm posting this in nightwatch-api project.
Expected Behavior
Framework should not freeze or cause cucumber step timout.
Current Behavior / Steps to Reproduce
I have prepared a project that allows to reproduce this problem (same case is described below): https://github.com/LucaLis/nightwatch-api-cucumber-bug-demonstration
I'm using following test:
Implementation of steps is rather trivial:
Please note that
client.waitForElementPresent('#thisWontBePresent')
is here by purpose to simulate situation when element is not present on the page.Custom command is also a dummy:
When I run this failed step from first scenario causes a problem with subsequent scenario which runs few `dummy step' steps and freezes (which in the end causes cucumber timeout) - log for this case: https://github.com/LucaLis/nightwatch-api-cucumber-bug-demonstration/blob/master/logs/cucumber-timeout-custom-command-present-screenshots-enabled.log
Hint
I've noticed that if i turn off screenshots (log https://github.com/LucaLis/nightwatch-api-cucumber-bug-demonstration/blob/master/logs/ok-custom-command-present-screenshots-disabled.log)
OR remove custom command from failing step definition (https://github.com/LucaLis/nightwatch-api-cucumber-bug-demonstration/blob/master/logs/ok-custom-command-commented-in-step-screenshots-enabled.log) then whole feature won't freeze/cause cucumber timeout.
Environment
Nightwatch.conf.js
cucumber.conf.js
Dependencies:
Windows 10 Node: v10.16.3 npm: 6.9.0