sc

Connect your machine to Sauce Labs.

SC -- Sauce Connect in C (for node).


  • http://nodejs.org/#download
  • (mac) brew install libsauceconnect (not yet ready)
  • (linux) apt-get install libsauceconnect (not yet ready)
  • (win) download msi installer (not yet ready)
   $ npm install sc
  $ npm install -g sc
  $ sc --username yourusername --accessKey yourkeyhere
  var wd = require('wd')
    , assert = require('assert')
    , sauceconnect = require('sc')
    , colors = require('colors')
    ;

var obj = { username: process.env.SAUCE_USERNAME , accessKey: process.env.SAUCE_ACCESS_KEY };

var connect = new sauceconnect(obj);

connect.on('status', function(info) { console.log(info.green); });

connect.start(function(err, session) { console.log(session); var browser = wd.promiseRemote("ondemand.saucelabs.com", 80, obj.username, obj.accessKey);

browser.on('status', function(info) {
  console.log(info.cyan);
});

browser.on('command', function(meth, path, data) {
  console.log(' > ' + meth.yellow, path.grey, data || '');
});

browser.init({
    browserName: 'chrome',
    tags: ["examples"],
    name: "This is an example test"
}).then(function () {
    return browser.get("http://google.com");
}).then(function () {
    return browser.title();
}).then(function (title) {
    assert.ok(~title.indexOf('Google'), 'Wrong title!');
}).fin(function () {
    browser.quit(function() {
      session.stop(function(cObj) {
        console.log("Connect Session Stopped");
      });
    });
}).done();

});

  • License - Apache 2: http://www.apache.org/licenses/LICENSE-2.0