JSPM

  • Created
  • Published
  • Downloads 930098
  • Score
    100M100P100Q185833F

A wrapper around Saucelabs REST API

Package Exports

  • saucelabs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (saucelabs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-saucelabs -- Node wrapper around the Saucelabs REST API

Download or update node

http://nodejs.org/#download

Install

npm install saucelabs

Writting a script

var sauce = require('./index');

var myAccount = new sauce({
    username: "your-sauce-username",
    password: "your-sauce-api-key",
})

myAccount.getAccountDetails( function (err, res) {
    console.log(res);
    myAccount.getServiceStatus( function (err, res) {
    //Status of the Sauce Labs services
    console.log(res);
    myAccount.getBrowsers( function (err, res) {
        //List of all browser/os combinations currently supported on Sauce Labs.
        console.log(res);
        myAccount.getJobs( function (err, res) {
        //Get a list of all your jobs
        for (k in jobs) {
            myAccount.showJob(jobs[k].id, function (err, res) {
            var str = res.id +": Status: "+ res.status;
            if (res.error) {
                str += "\033[31m Error: "+res.error+" \033[0m";
            }
            console.log(str);
            })
        }
        })
    })
    })
});

Supported Methods


Rest Node Wrapper
GET /users/:username
Access account details.
getAccountDetails(cb) -> cb(err, res)
GET /:username/limits
Access account details
getAccountLimits(cb) -> cb(err, res)
GET /:username/activity
Access current account activity.
getUserActivity(cb, start, end) -> cb(err, res)
GET /users/:username/usage
Access historical account usage data.
getAccountUsage(cb) -> cb(err, res)
GET /:username/jobs
List all job Id's belonging to a given user.
getJobs(cb) -> cb(err, res)
GET /:username/jobs/:id
Show the full information for a job given its ID.
showJob(id, cb) -> cb(err, res)
PUT /:username/jobs/:id
Changes a pre-existing job.
updateJob(id, data, cb) -> cb(err, res)
PUT /:username/jobs/:id/stop
Terminates a running job.
stopJob(id, data, cb) -> cb(err, res)
GET /:username/tunnels
Retrieves all running tunnels for a given user.
getActiveTunnels(cb) -> cb(err, res)
GET /:username/tunnels/:id
Show the full information for a tunnel given its ID.
getTunnel(id, cb) -> cb(err, res)
DELETE /:username/tunnels/:id
Shuts down a tunnel given its ID.
deleteTunnel(id, cb) -> cb(err, res)
GET /info/status
Returns the current status of Sauce Labs' services.
getServicesStatus(cb) -> cb(err, res)
GET /info/browsers
Returns an array of strings corresponding to all the browsers currently supported on Sauce Labs.
getBrowsers(cb) -> cb(err, res)
GET /info/counter
Returns the number of test executed so far on Sauce Labs.
getTestCounter(cb) -> cb(err, res)
POST /users/:id
Create a new sub-account, specifying a Sauce Labs service plan.
createSubAccount(data, cb) -> cb(err, res)
POST /users/:id/subscription ...

More Documentation

Check out the Sauce REST API for more information