I'm trying to get my open source project tests up and running within Travis CI. I have them working locally using a Selenium server.
Seems a relatively simple process but I am lacking some basic knowledge to complete the task.
I have my .travis.yml file:
language: node_js
node_js:
- "0.10"
env:
global:
- SAUCE_USERNAME=[my-username]
- SAUCE_ACCESS_KEY=[my-key]
addons:
sauce_connect: true
before_install:
- npm install -g grunt-cli
my Protractor config:
exports.config = {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
capabilities: {
'browserName': 'chrome',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
'build': process.env.TRAVIS_BUILD_NUMBER,
'name': 'ngValidation Protractor Tests'
},
specs: ['demo/app/features/home/specs/*.spec.js'],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
},
baseUrl: 'http://localhost:' + (process.env.HTTP_PORT || '8000')
};
and Gruntfile
protractor: {
saucelabs: {
options: {
configFile: "saucelabs.spec.conf.js",
args: {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY
}
}
}
}
...the problem
I think everything is setup correctly however something must be missing because when I push to Github and the Travis CI build kicks off I start getting this error in the Travis build logs:
Could not proxy http://localhost:8000....
What am I missing to get these two talking to each other and running my tests?
The Travis build logs for full info: https://travis-ci.org/GrumpyWizards/ngValidation/builds/23264543
Edit: based on the accepted answer:
I wasn't running a server to serve my files! I ended up installing https://www.npmjs.org/package/grunt-contrib-connect and set up my Grunt file like so:
connect: {
server: {
options: {
hostname: 'localhost',
port: 9001
}
}
}
...
grunt.registerTask('travis', ['connect:test', 'protractor:saucelabs']);
I then changed my protractor config file like this:
baseUrl: 'http://localhost:9001/'
Hey presto I can now run a local server on either my machine or on Travis that now serves my files, files that SauceLabs can gain access to...