pause(undefined) pauses a test indefinitely
See original GitHub issueIf you call pause() with an undefined argument, pause will pause without completing.
module.exports = {
test: function (browser) {
browser.assert.ok(true, 'first'); // runs
browser
.pause(browser.globals.userDefinedPauseOopsTypo) // point of failure: pause(undefined)
.perform(function () {
browser.assert.ok(true, 'second'); // never runs, still spinning on pause
});
},
after: function (browser) { browser.end(); }
};
pause could recognize undefined as 0, but I think most cases where undefined is passed (such as the example above) its in error, so it would probably be better if pause threw an error.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
pause | API Reference - Nightwatch.js
pause (). Suspends the test for the given time in milliseconds. If the milliseconds argument is missing it will suspend the test indefinitely....
Read more >Correct way to pause a Python program - Stack Overflow
Paused. Press ^D (Ctrl+D) to continue. >>> The Python Debugger is also a good way to pause.
Read more >TypeError: Cannot read property 'pause' of undefined
I have configured a npm script to use babel with nightwatch, so please forgive the es6 syntax. Here is my page object: const...
Read more >Sweden, Denmark pause Moderna COVID-19 vaccine for ...
Sweden and Denmark said on Wednesday they are pausing the use of ... U.S. to impose mandatory COVID-19 tests for travelers from China ......
Read more >Testing HTTP - Artillery.io
How to set configuration options specifically for testing HTTP services. ... Pausing execution with think . To pause the virtual user for N...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ok I’ve changed my mind. I still don’t like having only the warning. This doesn’t help CI at all, still gumming up all the works there even if you issue a warning.
If people are using
pause()for manual testing, that’s fine, but it also means they can easily change that approach to something else, i.e. its not going to break systems. Rather it will simply disrupt a couple of manual workflows.While the solution doesn’t have to be an error, I don’t think it should hang. It should probably pause(0) and issue a warning if 0 wasn’t passed in directly. For people who want to pause indefinitely, they should use something explicit like
pause(Infinity)and/or maybe allow something like a < 0:pause(-1). Something likepause(Infinity)is harder to have happen accidentally in a CI build.Just my 2c
I’m OK with the arguments check + warning approach.