Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gulp task for running protractor e2e test on saucelabs through sauce connect
var sauceConnectLauncher = require('sauce-connect-launcher');
// connects to saucelabs server and runs protractor e2e tests against saucelabs server
gulp.task('e2e_protractor_sauce', function() {
sauceConnectLauncher({
username: 'xxx',
accessKey: 'xxxx',
// logger: console.log
}, function (err, sauceConnectProcess) {
if (err) {
console.error(err.message);
return;
}
console.log("Sauce Connect ready");
gulp.src(["./src/tests/*.js"])
.pipe(protractor({
configFile: "e2e/protractor.saucelabs.conf.js"
}))
.on('error', function(e) {
sauceConnectProcess.close(function () {
console.log("Closed Sauce Connect process");
});
throw e;
})
.on('end', function(e) {
sauceConnectProcess.close(function () {
console.log("Closed Sauce Connect process");
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.