-
-
Save leejsinclair/526fbf3788f497765d1f to your computer and use it in GitHub Desktop.
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' | |
}, | |
baseUrl:'http://127.0.0.1:8080', | |
// 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 |
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
/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/q/q.js:126
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 Object.goog.loadModule (/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 Object.Context.closure.goog.retrieveAndExecModule_ (/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 Object.goog.importScript_ (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:879:9)
at Object.goog.importModule_ (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:900:14)
at Object.goog.writeScripts_ (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1323:16)
at Object.goog.require (/home/rof/.nvm/v0.10.40/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:663:14)
same as @pdsullivan here, even when using sause labs server instead of localhost...
just found that there is BREAKING CHANGE: 1) Users will no longer be able to use node versions <4. 2
http://stackoverflow.com/a/33835026/1109957,
just updated node to 4.2.1 via nvm install 4.2.1 and all working again.
https://codeship.com/documentation/languages/nodejs/
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.
Hi, I also have the config working, the baseUrl is accessed successfully (I'm doing a print screen, and the main page is loaded correctly) but the first API request that I make fails with 405 Method not allowed (this being the login request all other tests fail). All tests are running fine on my local environment. I have a rails app with angularjs. Any thoughts why the API would return 405 only on Codeship?