Skip to content
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

Errors in Nightwatch 3.3.2 #6

Open
dovwatbnh opened this issue Dec 26, 2023 · 2 comments
Open

Errors in Nightwatch 3.3.2 #6

dovwatbnh opened this issue Dec 26, 2023 · 2 comments

Comments

@dovwatbnh
Copy link

Hi, just wondering if this is compatible with V3.

I'm getting 2 errors.

1:

Error calling SauceLabs updateJob:  TypeError: Cannot read properties of undefined (reading '')
at CommandInstance.command (/home/bamboo/aperture-qa-test/node_modules/nightwatch-saucelabs-endsauce/nightwatch/commands/endSauce.js:47:47)
at /home/bamboo/aperture-qa-test/node_modules/nightwatch/lib/api/_loaders/command.js:182:29

2:

❌ browser.sessionId undefined. Ensure endSauce() was called before browser was closed. Test result will not be updated.

And here's my globals file:

   1   │ module.exports = {
   2   │     before(cb) {
   3   │         cb();
   4   │     },
   5   │
   6   │     after(cb) {
   7   │         cb();
   8   │     },
   9   │
  10   │     beforeEach(browser, cb) {
  11   │         const testedEnvironment = " :" + process.env.NODE_ENV;
  12   │         if (!browser.options.desiredCapabilities.name.endsWith(testedEnvironment)) {
  13   │             browser.options.desiredCapabilities.name = browser.options.desiredCapabilities.name + testedEnvironment;
  14   │         }
  15   │
  16   │         cb();
  17   │     },
  18   │
  19   │     afterEach(browser, cb) {
  20   │         if (browser.globals && browser.globals.propertyData && browser.globals.propertyData.saucelabs) { // Only if using SauceLabs
  21   │             browser.endSauce();
  22   │         }
  23   │
  24   │         cb();
  25   │         browser.end();
  26   │     },
  27   │ };
@dovwatbnh dovwatbnh changed the title sessionId undefined in Nightwatch 3.3.2 Errors in Nightwatch 3.3.2 Dec 26, 2023
@dovwatbnh
Copy link
Author

@dovwatbnh
Copy link
Author

To be clear, the above 2 errors seem to happen every couple of tests or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant