Skip to content

Commit

Permalink
Use the SauceLabs package
Browse files Browse the repository at this point in the history
  • Loading branch information
nickcmaynard committed Oct 1, 2020
1 parent 13a58eb commit 32020b4
Show file tree
Hide file tree
Showing 3 changed files with 1,518 additions and 140 deletions.
46 changes: 19 additions & 27 deletions e2e-tests/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,42 +54,35 @@ var config = {
'tunnel-identifier': sauceTunnelId,
'build': process.env.TRAVIS_BUILD_NUMBER
}, {
'browserName': 'MicrosoftEdge',
'version': 'latest',
'platform': 'Windows 10',
'tunnel-identifier': sauceTunnelId,
'build': process.env.TRAVIS_BUILD_NUMBER
},
{
'browserName': 'internet explorer',
'version': 'latest',
'platform': 'Windows 10',

// IE11 just doesn't play nice. Just run smoke tests
'exclude': ['data.spec.js','samples.spec.js', 'interaction.spec.js'],

'tunnel-identifier': sauceTunnelId,
'build': process.env.TRAVIS_BUILD_NUMBER
}, {
'browserName': 'MicrosoftEdge',
'version': 'latest',
'platform': 'Windows 10',
'tunnel-identifier': sauceTunnelId,
'build': process.env.TRAVIS_BUILD_NUMBER
}
];

// Launch Sauce Connect
const sauceConnectLauncher = require('sauce-connect-launcher');
// eslint-disable-next-line
return new Promise((resolve, reject) => {
console.info('Launching Sauce Connect...');
sauceConnectLauncher({
const SauceLabs = require('saucelabs').default;
const account = new SauceLabs();
console.info('Launching Sauce Connect...');
return account.startSauceConnect({
tunnelIdentifier: sauceTunnelId
}, function (err, process) {
if (err) {
console.error(err.message);
return reject(err);
}

console.info('...Sauce Connect ready');
// Keep track
sauceConnectProcess = process;
return resolve();
});
}).then(process => {
console.info('...launched Sauce Connect.');
// Keep track
sauceConnectProcess = process;
}).then(() => {
// Capabilities for testing remotely
return capabilities;
Expand Down Expand Up @@ -123,12 +116,11 @@ var config = {
// Clean up Sauce Connect
console.info('Closing Sauce Connect...');
// eslint-disable-next-line
return new Promise((resolve, reject) => {
sauceConnectProcess.close(function () {
console.log('...closed Sauce Connect.');
resolve();
});
const p = sauceConnectProcess.close();
p.then(() => {
console.info('...closed Sauce Connect.');
});
return p;
}
}

Expand Down
Loading

0 comments on commit 32020b4

Please sign in to comment.