sc

1.0.1 • Public • Published

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


Update node to latest

Install libsauceconnect

  • (mac) brew install libsauceconnect (not yet ready)
  • (linux) apt-get install libsauceconnect (not yet ready)
  • (win) download msi installer (not yet ready)

Install

   $ npm install sc

Command line

  $ npm install -g sc
  $ sc --username yourusername --accessKey yourkeyhere

Authors

Writing a test!

  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

Readme

Keywords

none

Package Sidebar

Install

npm i sc

Weekly Downloads

13

Version

1.0.1

License

none

Last publish

Collaborators

  • admc
  • msabourin
  • sourishkrout
  • jlipps