saucelabs
A wrapper around Sauce Labs REST API
Last updated 8 years ago by christian-bromann .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install saucelabs 
SYNC missed versions from official npm registry.

Trophy bot

Node Sauce Labs Build Status

Wrapper around the Sauce Labs REST APIs for Node.js.

Install

To install the package run:

npm install saucelabs

Options

user

Your Sauce Labs username.

Type: string
Default: process.env.SAUCE_USERNAME

key

Your Sauce Labs access key.

Type: string
Default: process.env.SAUCE_ACCESS_KEY

region

Your Sauce Labs datacenter region. The following regions are available: us-west-1 (short us), eu-central-1 (short eu).

Type: string
Default: us

headless

If set to true you are accessing the headless Sauce instances (this discards the region option).

Type: boolean
Default: false

Usage

All accessible API commands with descriptions can be found here.

As CLI Tool

This package if installed globally can be used as CLI tool to access the API from the command line:

$ npm install -g saucelabs
...
$ sl listJobs $SAUCE_USERNAME --limit 5 --region eu
{ jobs:
   [ { id: '19dab74f8fd848518f8d2c2cee3a6fbd' },
     { id: 'dc08ca0c7fa14eee909a093d11567328' },
     { id: '5bc6f70c777b4ae3bf7909a40f5ee41b' },
     { id: 'f40fe7b044754eaaa5f5a130406549b5' },
     { id: 'd1553f71f910402893f1e82a4dcb6ca6' } ] }

You can find all available commands and options with description by calling:

sl --help
# show description for specific command
sl listJobs --help

As NPM Package

The following example shows how to access details of the last job you were running with your account that is being exposed as environment variables as SAUCE_USERNAME and SAUCE_ACCESS_KEY.

import SauceLabs from 'saucelabs';

(async () => {
    const myAccount = new SauceLabs();

    // get job details of last run job
    const job = await user.listJobs(
        process.env.SAUCE_USERNAME,
        { limit: 1, full: true }
    );

    console.log(job);
    /**
     * outputs:
     * { jobs:
        [ { browser_short_version: '72',
            video_url:
             'https://assets.saucelabs.com/jobs/dc08ca0c7fa14eee909a093d11567328/video.flv',
            creation_time: 1551711453,
            'custom-data': null,
            browser_version: '72.0.3626.81',
            owner: '<username-redacted>',
            id: 'dc08ca0c7fa14eee909a093d11567328',
            record_screenshots: true,
            record_video: true,
            build: null,
            passed: null,
            public: 'team',
            end_time: 1551711471,
            status: 'complete',
            log_url:
             'https://assets.saucelabs.com/jobs/dc08ca0c7fa14eee909a093d11567328/selenium-server.log',
            start_time: 1551711454,
            proxied: false,
            modification_time: 1551711471,
            tags: [],
            name: null,
            commands_not_successful: 1,
            consolidated_status: 'complete',
            manual: false,
            assigned_tunnel_id: null,
            error: null,
            os: 'Windows 2008',
            breakpointed: null,
            browser: 'googlechrome' } ] }
     */
})

Test

To run the test suite, first invoke the following command within the repo, installing the development dependencies:

npm install

Then run the tests:

npm test

Current Tags

  • 2.0.0-beta.10                                ...           beta (8 years ago)
  • 9.3.0                                ...           latest (2 months ago)
  • 3.1.1-alpha.7                                ...           orchestrator-experiment (7 years ago)

128 Versions

  • 9.3.0                                ...           2 months ago
  • 9.2.0                                ...           3 months ago
  • 9.1.0                                ...           4 months ago
  • 9.0.2                                ...           2 years ago
  • 9.0.1                                ...           2 years ago
  • 9.0.0                                ...           2 years ago
  • 8.0.0                                ...           2 years ago
  • 7.5.0                                ...           3 years ago
  • 7.4.0                                ...           3 years ago
  • 7.3.1                                ...           3 years ago
  • 7.3.0                                ...           3 years ago
  • 7.2.5                                ...           3 years ago
  • 7.2.4                                ...           3 years ago
  • 7.2.3                                ...           3 years ago
  • 7.2.2                                ...           3 years ago
  • 7.2.1                                ...           4 years ago
  • 7.2.0                                ...           5 years ago
  • 7.1.3                                ...           5 years ago
  • 7.1.2                                ...           5 years ago
  • 7.1.1                                ...           5 years ago
  • 7.1.0                                ...           5 years ago
  • 7.0.4                                ...           5 years ago
  • 7.0.3                                ...           5 years ago
  • 6.2.2                                ...           5 years ago
  • 7.0.2                                ...           5 years ago
  • 6.1.2                                ...           5 years ago
  • 7.0.1                                ...           5 years ago
  • 7.0.0                                ...           5 years ago
  • 6.2.1                                ...           5 years ago
  • 6.2.0                                ...           5 years ago
  • 6.1.1                                ...           5 years ago
  • 6.1.0                                ...           5 years ago
  • 6.0.2                                ...           5 years ago
  • 6.0.1                                ...           5 years ago
  • 6.0.0                                ...           5 years ago
  • 5.1.0                                ...           5 years ago
  • 5.0.3                                ...           6 years ago
  • 4.7.8                                ...           6 years ago
  • 5.0.2                                ...           6 years ago
  • 4.7.7                                ...           6 years ago
  • 5.0.1                                ...           6 years ago
  • 5.0.0                                ...           6 years ago
  • 4.7.6 [deprecated]           ...           6 years ago
  • 4.7.5                                ...           6 years ago
  • 4.7.4                                ...           6 years ago
  • 4.7.3                                ...           6 years ago
  • 4.7.2                                ...           6 years ago
  • 4.7.1                                ...           6 years ago
  • 4.7.0                                ...           6 years ago
  • 4.6.8                                ...           6 years ago
  • 4.6.7                                ...           6 years ago
  • 4.6.6                                ...           6 years ago
  • 4.6.5                                ...           6 years ago
  • 4.6.4                                ...           6 years ago
  • 4.6.3                                ...           6 years ago
  • 4.6.2                                ...           6 years ago
  • 4.6.1                                ...           6 years ago
  • 4.6.0                                ...           6 years ago
  • 4.5.2                                ...           6 years ago
  • 4.5.1                                ...           6 years ago
  • 4.5.0                                ...           6 years ago
  • 4.4.5                                ...           6 years ago
  • 4.4.4                                ...           6 years ago
  • 4.4.3                                ...           6 years ago
  • 4.4.2                                ...           6 years ago
  • 4.4.1                                ...           6 years ago
  • 4.4.0                                ...           7 years ago
  • 4.3.0                                ...           7 years ago
  • 4.2.1                                ...           7 years ago
  • 4.2.0                                ...           7 years ago
  • 4.1.0                                ...           7 years ago
  • 4.0.2                                ...           7 years ago
  • 4.0.1                                ...           7 years ago
  • 4.0.0                                ...           7 years ago
  • 3.1.1-alpha.7 [deprecated]           ...           7 years ago
  • 3.1.1-alpha.6 [deprecated]           ...           7 years ago
  • 3.1.1-alpha.5 [deprecated]           ...           7 years ago
  • 3.1.1-alpha.4 [deprecated]           ...           7 years ago
  • 3.1.1-alpha.3 [deprecated]           ...           7 years ago
  • 3.1.1-alpha.2 [deprecated]           ...           7 years ago
  • 3.1.1-alpha.1 [deprecated]           ...           7 years ago
  • 3.1.1 [deprecated]           ...           7 years ago
  • 3.0.1                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 2.3.0                                ...           7 years ago
  • 2.2.1                                ...           7 years ago
  • 2.2.0                                ...           7 years ago
  • 2.1.9                                ...           8 years ago
  • 2.1.8                                ...           8 years ago
  • 2.1.7                                ...           8 years ago
  • 2.1.6                                ...           8 years ago
  • 2.1.4                                ...           8 years ago
  • 2.1.3                                ...           8 years ago
  • 2.1.2                                ...           8 years ago
  • 2.1.1                                ...           8 years ago
  • 2.1.0                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 2.0.0-beta.10                                ...           8 years ago
  • 2.0.0-beta.9                                ...           8 years ago
  • 2.0.0-beta.8                                ...           8 years ago
  • 2.0.0-beta.7                                ...           8 years ago
  • 2.0.0-beta.6                                ...           8 years ago
  • 2.0.0-beta.5                                ...           8 years ago
  • 2.0.0-beta.4                                ...           8 years ago
  • 2.0.0-beta.3                                ...           8 years ago
  • 2.0.0-beta.2                                ...           8 years ago
  • 2.0.0-beta.1                                ...           8 years ago
  • 2.0.0-beta.0                                ...           8 years ago
  • 1.5.0                                ...           9 years ago
  • 1.4.0                                ...           10 years ago
  • 1.3.0                                ...           10 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.1.1                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
  • 0.0.9                                ...           14 years ago
  • 0.0.8                                ...           14 years ago
  • 0.0.7                                ...           14 years ago
  • 0.0.6                                ...           14 years ago
  • 0.0.5                                ...           14 years ago
  • 0.0.4                                ...           14 years ago
  • 0.0.3                                ...           14 years ago
  • 0.0.2                                ...           14 years ago
  • 0.0.2-alpha                                ...           14 years ago
  • 0.0.1                                ...           14 years ago
Downloads
Total 412
Today 0
This Week 31
This Month 200
Last Day 0
Last Week 22
Last Month 106
Dependencies (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE