diff --git a/.travis.yml b/.travis.yml index a5b5294d3..ea1c90ba2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ install: - "bin/installDeps.sh" before_script: - "tests/frontend/travis/sauce_tunnel.sh" +script: + - "tests/frontend/travis/runner.sh" env: global: - secure: "oKA4KbSvyxMOFCiOa3hWswnaIrCmX60MfhBhD8xu8sodOqbdK5RUrxDJew9p\n1nNSewxoVmKhX0G5GxIABfGtdU1nrEzCEoejTDJIFmzEbcLcHpcyarouWLSY\nOpn11FKS1rnb69aflHM7K8l4dhrCkA2i0Dwwl8LN3HayGzDV2Rg=" diff --git a/tests/frontend/travis/.gitignore b/tests/frontend/travis/.gitignore new file mode 100644 index 000000000..1fe24e256 --- /dev/null +++ b/tests/frontend/travis/.gitignore @@ -0,0 +1 @@ +sauce_connect.log diff --git a/tests/frontend/travis/remote_runner.js b/tests/frontend/travis/remote_runner.js new file mode 100644 index 000000000..3b412a4be --- /dev/null +++ b/tests/frontend/travis/remote_runner.js @@ -0,0 +1,36 @@ +/* + connect to sauce labs + run 2 tests in parrallel + - check in 5s interval for status + - print out result when finished + - exit with 0 when everything has passed, else with 1 +*/ +var srcFolder = "../../../src/node_modules/"; +var log4js = require(srcFolder + "log4js"); +var wd = require(srcFolder + "wd"); + +var config = { + host: "ondemand.saucelabs.com" + , port: 80 + , username: process.env.SAUCE_USER + , accessKey: process.env.SAUCE_KEY +} + +var browser = wd.remote(config.host, config.port, config.username, config.accessKey); +var browserChain = browser.chain(); + +var enviroment = { + 'platform' : 'Linux' + , 'browserName' : 'firefox' + , 'version' : '' + , 'name' : 'Halloween test' +} + +browserChain.init(enviroment).get("http://localhost:9001/tests/frontend/", function(){ + setTimeout(function(){ + browserChain.quit(); + setTimeout(function(){ + process.exit(0); + }, 1000); + }, 60000); +}); diff --git a/tests/frontend/travis/runner.sh b/tests/frontend/travis/runner.sh new file mode 100755 index 000000000..06405b097 --- /dev/null +++ b/tests/frontend/travis/runner.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +#Move to the base folder +cd `dirname $0` + +#start etherpad lite +../../../bin/run.sh & +sleep 10 + +#start remote runner +node remote_runner.js + +kill $! +kill $(cat /tmp/sauce.pid) \ No newline at end of file