-
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
Abort test on waitUntil
failure when using it standalone with async/await.
#4157
Comments
This issue seems to be happening due to a side-effect of the queuing system. In the case of chaining, if Let's say, if we have the following in the test await browser
.waitUntil(function() {
browser.title();
return false;
})
.pause(); Now, if While the above does not create any problem with Nightwatch or Mocha test runner (as they probably just dump the test case on failure <-- need to confirm this), it causes the test run to be stuck forever in case of Cucumber (which uses Nightwatch Programmatic API) or any other use of the Nightwatch Programmatic API. But, in the case of direct use of Let's say we have the following in the test: await browser.waitUntil(function() {
browser.title();
return false;
});
await browser.pause(); Now, if But, as soon as the |
waitUntil
failure when using with async/await.waitUntil
failure when using standalone with async/await.
waitUntil
failure when using standalone with async/await.waitUntil
failure when using it standalone with async/await.
@Temidayo32 Updated the issue description to be more clear. The test correctly aborts with But, if we use async/await on the Nightwatch still displays the Timeout error in the second case, but the main thing is that Nightwatch should not continue with the test execution (it should not execute the |
@garg3133 I think this issue might be a lot more bigger than just
Here is what I observed about the queuing system in Nightwatch API. When a test is run initially, all the commands are read even before it start executing any of the commands. I am able to observe this by console logging the command name.
As can be seen, when the test first start running, all the commands ( Also, as can be seen, when the |
browser what is the path of this code |
it('Demo test ecosia.org', async function (browser) {
await browser
.navigateTo('https://ecosia.org/');
await browser.waitUntil(function () {
browser.title();
return false;
}, 2000)
console.info("Tests")
await browser.pause()
}); @Temidayo32 if you try running this test after setting
And you can see that this test continues executing even after |
Description of the bug/issue
When we use the
waitUntil
command with command chaining (waitUntil
command chained with some other command, not standalone), the test aborts correctly onwaitUntil
timeout. Using or not using async/await does not matter here. Ex.But, if we use the
waitUntil
command without command chaining (standalone;waitUntil
not chained with any other command) and with async/await, the test continues executing even afterwaitUntil
timeout. Ex.The test should abort in the second case as well.
This issue is created from #4123 (comment)
Nightwatch.js Version
3.5.0
The text was updated successfully, but these errors were encountered: