# -------------------------------------------
# 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
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
}
};