question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pause(undefined) pauses a test indefinitely

See original GitHub issue

If 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:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
senocularcommented, Oct 12, 2016

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 like pause(Infinity) is harder to have happen accidentally in a CI build.

Just my 2c

1reaction
senocularcommented, Oct 12, 2016

I’m OK with the arguments check + warning approach.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found