Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Unable to run tests using protractor on SauceLabs #2748

Closed
vcernomschi opened this issue Nov 27, 2015 · 1 comment
Closed

Unable to run tests using protractor on SauceLabs #2748

vcernomschi opened this issue Nov 27, 2015 · 1 comment

Comments

@vcernomschi
Copy link

protractor.config.js.txt

Unable to run tests using protractor on SauceLabs launched from Travis CI

Step to reproduce.

  1. I have configured .travis.yml (https://docs.travis-ci.com/user/sauce-connect/) to use Sauce Connect to allow Travis runs scripts on Sauce Labs. Travis log displayed that connection was successful:
    27 Nov 06:48:18 - Starting Selenium listener...
    27 Nov 06:48:18 - Establishing secure TLS connection to tunnel...
    27 Nov 06:48:18 - Selenium listener started on port 4445.
    27 Nov 06:48:19 - Sauce Connect is up, you may start your tests.
  2. Start e2e test with protractor.config.js configuration.
  3. Expected result: All e2e tests are passed/failed.
    Actual result: Tests aren't started. The following error is displayed:

[chrome #2] PID: 3328
[chrome #2] undefined:1190
[chrome #2] vlog(2, () => this + ' scheduling notifications', this);
[chrome #2] ^
[chrome #2] SyntaxError: Unexpected token )
[chrome #2] at goog.loadModuleFromSource_ (/home/travis/.nvm/versions/node/v0.12.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1123:19)
[chrome #2] at Object.goog.loadModule (/home/travis/.nvm/versions/node/v0.12.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1085:46)
[chrome #2] at /home/travis/.nvm/versions/node/v0.12.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1:6
[chrome #2] at Object.exports.runInContext (vm.js:64:17)
[chrome #2] at Object.Context.closure.goog.retrieveAndExecModule_ (/home/travis/.nvm/versions/node/v0.12.4/lib/node_modules/protractor/node_modules/selenium-webdriver/base.js:135:8)
[chrome #2] at :1:6
[chrome #2] at Object.exports.runInContext (vm.js:64:17)
[chrome #2] at Context.closure.closure.vm.createContext.CLOSURE_IMPORT_SCRIPT (/home/travis/.nvm/versions/node/v0.12.4/lib/node_modules/protractor/node_modules/selenium-webdriver/base.js:104:12)
[chrome #2] at Object.goog.importScript
(/home/travis/.nvm/versions/node/v0.12.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:879:9)
[chrome #2] at Object.goog.importModule
(/home/travis/.nvm/versions/node/v0.12.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:900:14)
[launcher] Runner process exited unexpectedly with error code: 1

[launcher] 1 instance(s) of WebDriver still running

I used protractor@3.0.0.

For more details please refer to the protractor configuration file and full travis log (https://s3.amazonaws.com/archive.travis-ci.org/jobs/93474859/log.txt)

@NickTomlin
Copy link
Contributor

This error is due to the fact that Protractor 3.x.x does not work with node versions < 4. It looks like you are using node v0.12.4 which is not compatible.

You will need to downgrade to protractor 2.x.x or upgrade your version of node to 4 or greater. You can see the exception is generated from the new es6 arrow syntax in your stacktrace:

[chrome #2] vlog(2, () => this + ' scheduling notifications', this);
[chrome #2] ^
[chrome #2] SyntaxError: Unexpected token )

In the future please direct debugging or usage questions to Stackoverflow or post in the Gitter Channel to get help.

From the the getting help section of the README:

Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)

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

No branches or pull requests

2 participants