Skip to content

Instantly share code, notes, and snippets.

Last active August 19, 2018 06:25
  • Star 20 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Running protractor tests on codeship #testing #browser #selenium
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
// 'browserName': 'internet explorer', - special installation needed
// 'version':'10',
'browserName': 'chrome',
//'browserName': 'firefox'
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['test/protractor/protractor.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
# -------------------------------------------
# 1. HTML website separate from API
# 2. HTML website is static HTML
# 3. API is mocked
# -------------------------------------------
# Install simple http server and protractor
npm install -g http-server protractor
# Download and install selenium webdrivers
webdriver-manager update
# Run web driver in background, keeping in mind it takes a few seconds to become responsive
nohup bash -c "webdriver-manager start 2>&1 &" && sleep 9
# Run local website, my website is contained within the ./app folder
http-server app > /dev/null &
# Run protractor tests
protractor protractor.conf.js
Copy link

This was working for me for a while but all the sudden i started getting an error on the test step. Not really sure what changed. Is anybody else having an issue?

[launcher] Process exited with error code 1

throw e;
SyntaxError: Unexpected token )
at goog.loadModuleFromSource_ (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1123:19)
at (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1085:46)
at /home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1:6
at (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/_base.js:135:8)
at <anonymous>:1:6
at Context.closure.closure.vm.createContext.CLOSURE_IMPORT_SCRIPT (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/_base.js:104:12)
at (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:879:9)
at (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:900:14)
at (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1323:16)
at (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:663:14)

Copy link

same as @pdsullivan here, even when using sause labs server instead of localhost...

Copy link

just found that there is BREAKING CHANGE: 1) Users will no longer be able to use node versions <4. 2,

just updated node to 4.2.1 via nvm install 4.2.1 and all working again.

Copy link

awhit012 commented Nov 21, 2016

For those of you running a Rails app, substitute this line:

# Run local website, my website is contained within the ./app folder

http-server app > /dev/null &

with this:
nohup bash -c "rails s &"

This will start the rails server in the background and continue to the next task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment