Last active
August 19, 2018 06:25
-
-
Save leejsinclair/526fbf3788f497765d1f to your computer and use it in GitHub Desktop.
Running protractor tests on codeship #testing #browser #selenium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------- | |
# 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 |
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
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/