Skip to content

Instantly share code, notes, and snippets.

Embed
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'
},
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
@awhit012
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