commit
95bff0999d
@ -0,0 +1,32 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
|
||||
SAUCECONNECT_URL="https://saucelabs.com/downloads/sc-4.3.16-linux.tar.gz" |
||||
SAUCECONNECT_USERNAME="chriseth" |
||||
SAUCECONNECT_ACCESSKEY="b781828a-9e9c-43d8-89d4-2fbb879595ca" |
||||
SAUCECONNECT_JOBIDENTIFIER="browsersolidity_tests_${TRAVIS_JOB_NUMBER}" |
||||
SAUCECONNECT_READYFILE="sc.ready" |
||||
TEST_EXITCODE=0 |
||||
|
||||
npm run build |
||||
npm run serve & |
||||
|
||||
wget $SAUCECONNECT_URL |
||||
tar -zxvf sc-4.3.16-linux.tar.gz |
||||
./sc-4.3.16-linux/bin/sc -u $SAUCECONNECT_USERNAME -k $SAUCECONNECT_ACCESSKEY -i $SAUCECONNECT_JOBIDENTIFIER --readyfile $SAUCECONNECT_READYFILE & |
||||
while [ ! -f $SAUCECONNECT_READYFILE ]; do |
||||
sleep .5 |
||||
done |
||||
|
||||
npm run browser-test-remote-firefox || TEST_EXITCODE=1 |
||||
npm run browser-test-remote-chrome || TEST_EXITCODE=1 |
||||
npm run browser-test-remote-safari || TEST_EXITCODE=1 |
||||
npm run browser-test-remote-ie || TEST_EXITCODE=1 |
||||
|
||||
node ci/sauceDisconnect.js $SAUCECONNECT_USERNAME $SAUCECONNECT_ACCESSKEY $SAUCECONNECT_JOBIDENTIFIER |
||||
|
||||
echo $TEST_EXITCODE |
||||
if [ $TEST_EXITCODE -eq 1 ] |
||||
then |
||||
exit 1 |
||||
fi |
@ -0,0 +1,72 @@ |
||||
const https = require('https') |
||||
|
||||
var userName = process.argv[2] |
||||
var accessKey = process.argv[3] |
||||
var tunnelName = process.argv[4] |
||||
|
||||
function removeTunnel () { |
||||
const requestPath = `/rest/v1/${userName}/tunnels` |
||||
console.log(requestPath) |
||||
callSauce(requestPath, 'GET', function (error, result) { |
||||
if (error) { |
||||
console.log(error) |
||||
} else { |
||||
var data = JSON.parse(result) |
||||
for (var k in data) { |
||||
retrieveTunnel(data[k], function (error, result) { |
||||
if (error) { |
||||
console.log(error) |
||||
} else if (result.identtifier === tunnelName) { |
||||
deleteTunnel(result.id, function () { |
||||
console.log('tunnel deleted ' + data[k] + ' ' + tunnelName) |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function retrieveTunnel (tunnelid, callback) { |
||||
const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}` |
||||
callSauce(requestPath, 'GET', function (error, result) { |
||||
if (error) { |
||||
callback(error) |
||||
} else { |
||||
callback(null, {'identtifier': JSON.parse(result).tunnel_identifier, 'id': tunnelid}) |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function deleteTunnel (tunnelid, callback) { |
||||
const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}` |
||||
callSauce(requestPath, 'DELETE', callback) |
||||
} |
||||
|
||||
function callSauce (requestPath, type, callback) { |
||||
function responseCallback (res) { |
||||
res.setEncoding('utf8') |
||||
console.log('Response: ', res.statusCode, JSON.stringify(res.headers)) |
||||
res.on('data', function onData (chunk) { |
||||
console.log('BODY: ' + chunk) |
||||
callback(null, chunk) |
||||
}) |
||||
res.on('end', function onEnd () {}) |
||||
} |
||||
|
||||
var req = https.request({ |
||||
hostname: 'saucelabs.com', |
||||
path: requestPath, |
||||
method: type, |
||||
auth: userName + ':' + accessKey |
||||
}, responseCallback) |
||||
|
||||
req.on('error', function onError (e) { |
||||
console.log('problem with request: ' + e.message) |
||||
callback(e.message) |
||||
}) |
||||
req.write('') |
||||
req.end() |
||||
} |
||||
|
||||
removeTunnel() |
@ -0,0 +1,79 @@ |
||||
'use strict' |
||||
var TRAVIS_JOB_NUMBER = process.env.TRAVIS_JOB_NUMBER |
||||
|
||||
module.exports = { |
||||
'src_folders': ['test-browser'], |
||||
'output_folder': 'reports', |
||||
'custom_commands_path': '', |
||||
'custom_assertions_path': '', |
||||
'page_objects_path': '', |
||||
'globals_path': '', |
||||
|
||||
'test_settings': { |
||||
'default': { |
||||
'launch_url': 'http://ondemand.saucelabs.com:80', |
||||
'selenium_host': 'ondemand.saucelabs.com', |
||||
'selenium_port': 80, |
||||
'silent': true, |
||||
'username': 'chriseth', |
||||
'access_key': 'b781828a-9e9c-43d8-89d4-2fbb879595ca', |
||||
'use_ssl': false, |
||||
'globals': { |
||||
'waitForConditionTimeout': 10000, |
||||
'asyncHookTimeout': 100000 |
||||
}, |
||||
'screenshots': { |
||||
'enabled': false, |
||||
'path': '' |
||||
}, |
||||
'desiredCapabilities': { |
||||
'browserName': 'firefox', |
||||
'javascriptEnabled': true, |
||||
'acceptSslCerts': true, |
||||
'build': 'build-' + TRAVIS_JOB_NUMBER, |
||||
'tunnel-identifier': 'browsersolidity_tests_' + TRAVIS_JOB_NUMBER |
||||
} |
||||
}, |
||||
|
||||
'chrome': { |
||||
'desiredCapabilities': { |
||||
'browserName': 'chrome', |
||||
'javascriptEnabled': true, |
||||
'acceptSslCerts': true, |
||||
'build': 'build-' + TRAVIS_JOB_NUMBER, |
||||
'tunnel-identifier': 'browsersolidity_tests_' + TRAVIS_JOB_NUMBER |
||||
} |
||||
}, |
||||
|
||||
'safari': { |
||||
'desiredCapabilities': { |
||||
'browserName': 'safari', |
||||
'javascriptEnabled': true, |
||||
'acceptSslCerts': true, |
||||
'build': 'build-' + TRAVIS_JOB_NUMBER, |
||||
'tunnel-identifier': 'browsersolidity_tests_' + TRAVIS_JOB_NUMBER |
||||
} |
||||
}, |
||||
|
||||
'ie': { |
||||
'desiredCapabilities': { |
||||
'browserName': 'internet explorer', |
||||
'javascriptEnabled': true, |
||||
'acceptSslCerts': true, |
||||
'build': 'build-' + TRAVIS_JOB_NUMBER, |
||||
'tunnel-identifier': 'browsersolidity_tests_' + TRAVIS_JOB_NUMBER |
||||
} |
||||
}, |
||||
|
||||
'local': { |
||||
'launch_url': 'http://localhost:8080', |
||||
'selenium_port': 4444, |
||||
'selenium_host': 'localhost', |
||||
'desiredCapabilities': { |
||||
'browserName': 'firefox', |
||||
'javascriptEnabled': true, |
||||
'acceptSslCerts': true |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,42 +0,0 @@ |
||||
{ |
||||
"src_folders" : ["test-browser"], |
||||
"output_folder" : "reports", |
||||
"custom_commands_path" : "", |
||||
"custom_assertions_path" : "", |
||||
"page_objects_path" : "", |
||||
"globals_path" : "", |
||||
|
||||
"test_settings" : { |
||||
"default" : { |
||||
"launch_url": "http://ondemand.saucelabs.com:80", |
||||
"selenium_port": 80, |
||||
"selenium_host": "ondemand.saucelabs.com", |
||||
"silent": true, |
||||
"username": "chriseth", |
||||
"access_key": "b781828a-9e9c-43d8-89d4-2fbb879595ca", |
||||
"screenshots" : { |
||||
"enabled" : false |
||||
}, |
||||
"globals": { |
||||
"waitForConditionTimeout": 60000 |
||||
} |
||||
}, |
||||
"remote" : { |
||||
"desiredCapabilities": { |
||||
"browserName": "firefox", |
||||
"javascriptEnabled": true, |
||||
"acceptSslCerts": true |
||||
} |
||||
}, |
||||
"local" : { |
||||
"launch_url": "http://localhost:8080", |
||||
"selenium_port": 4444, |
||||
"selenium_host": "localhost", |
||||
"desiredCapabilities": { |
||||
"browserName": "firefox", |
||||
"javascriptEnabled": true, |
||||
"acceptSslCerts": true |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue