nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

Nightwatch v2.2.1 Upgraded selenium-webdriver to v4.2.0 - #3215 has broken Jenkins integration #3337

Closed kretschmannj closed 2 years ago

kretschmannj commented 2 years ago

Description of the bug/issue

When I attempt to run a Nightwatch test from Jenkins I get an error

Steps to reproduce

No response

Sample test

No response

Command to run

No response

Verbose Output

/var/lib/jenkins/workspace/Portal_UI_Automated_Tests_QA/node_modules/selenium-webdriver/lib/virtual_authenticator.js:26 static Protocol = { ^

SyntaxError: Unexpected token = at Module._compile (internal/modules/cjs/loader.js:721:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/var/lib/jenkins/workspace/Portal_UI_Automated_Tests_QA/node_modules/selenium-webdriver/lib/webdriver.js:40:20) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)

Nightwatch Configuration

nightwatch v2.2.1

Nightwatch.js Version

2.2.1

NPM Version

6.9.0

Node Version

10.16.0

Yarn Version

No response

Browser

No response

Operating System

No response

Additional Information

The test runs successfully with v2.1.8 but fails with Nightwatch v2.2.x or higher. The error indicates an issue with selenium-webdriver/lib/virtual_authenticator.js which was updated in v2.2.1 per https://github.com/nightwatchjs/nightwatch/pull/3215

kretschmannj commented 2 years ago

I resolved the issue by updating the version of Node used by Jenkins from 10.16.0 to 16.16.0.

AutomatedTester commented 2 years ago

Closing as this appears to have been a nodejs issue. Glad you were able to solve it.