Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 7 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Showing with 16 additions and 20 deletions.
  1. +12 −17 index.js
  2. +4 −3 package.json
View
29 index.js
@@ -19,17 +19,8 @@ var SauceConnect = function(emitter, logger) {
var alreadyRunningDefered;
var alreadyRunningProces;
- this.start = function(username, accessKey, tunnelIdentifier, done) {
- var options = {
- username: username,
- accessKey: accessKey,
- verbose: false,
- logfile: null,
- logger: log.debug.bind(log),
- no_progress: false,
- tunnelIdentifier: tunnelIdentifier
- };
-
+ this.start = function(connectOptions, done) {
+ connectOptions.logger = log.debug.bind(log);
// TODO(vojta): if different username/accessKey, start a new process
if (alreadyRunningDefered) {
log.debug('Sauce Connect is already running or starting');
@@ -37,7 +28,7 @@ var SauceConnect = function(emitter, logger) {
}
alreadyRunningDefered = q.defer();
- launchSauceConnect(options, function(err, p) {
+ launchSauceConnect(connectOptions, function(err, p) {
if (err) {
return alreadyRunningDefered.reject(err);
}
@@ -80,6 +71,13 @@ var SauceLabsBrowser = function(id, args, sauceConnect, /* config.sauceLabs */ c
tunnelIdentifier = 'karma' + Math.round(new Date().getTime() / 1000);
}
+ var connectOptions = config.connectOptions || {};
+ connectOptions = helper.merge(connectOptions, {
+ username: username,
+ accessKey: accessKey,
+ tunnelIdentifier: tunnelIdentifier
+ });
+
this.id = id;
this.name = browserName + ' on SauceLabs';
@@ -147,7 +145,7 @@ var SauceLabsBrowser = function(id, args, sauceConnect, /* config.sauceLabs */ c
this.start = function(url) {
if (startConnect) {
- sauceConnect.start(username, accessKey, tunnelIdentifier).then(function() {
+ sauceConnect.start(connectOptions).then(function() {
start(url);
}, function(err) {
log.error('Can not start %s\n Failed to start Sauce Connect:\n %s', browserName, err.message);
@@ -165,10 +163,7 @@ var SauceLabsBrowser = function(id, args, sauceConnect, /* config.sauceLabs */ c
clearTimeout(pendingHeartBeat);
log.debug('Shutting down the %s driver', browserName);
- // workaround - navigate to other page to avoid re-connection
- driver.get('about:blank', function() {
- driver.quit(done);
- });
+ driver.quit(done);
};
this.markCaptured = function() {
View
7 package.json
@@ -1,6 +1,6 @@
{
"name": "karma-sauce-launcher",
- "version": "0.1.7",
+ "version": "0.1.8",
"description": "A Karma plugin. Launch any browser on SauceLabs!",
"main": "index.js",
"scripts": {
@@ -19,8 +19,8 @@
],
"author": "Vojta Jina <vojta.jina@gmail.com>",
"dependencies": {
- "wd": "~0.1.5",
- "sauce-connect-launcher": "~0.1.10",
+ "wd": "~0.2.8",
+ "sauce-connect-launcher": "~0.2.2",
"q": "~0.9.6",
"saucelabs": "~0.1.0"
},
@@ -35,6 +35,7 @@
"grunt-auto-release": "~0.0.2"
},
"contributors": [
+ "Johannes Würbach <johannes.wuerbach@googlemail.com>",
"Santiago Suarez Ordoñez <santiycr@gmail.com>",
"Johannes Würbach <johannes.wuerbach@googlemail.com>",
"Parashuram <code@nparashuram.com>",

No commit comments for this range

Something went wrong with that request. Please try again.