Socket
Socket
Sign inDemoInstall

saucelabs

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saucelabs - npm Package Compare versions

Comparing version 0.0.9 to 0.1.0

.jshintrc

4

index.js

@@ -1,1 +0,3 @@

module.exports = require('./lib/Saucelabs');
module.exports = process.env.SAUCELABS_COV ?
require('./lib-cov/SauceLabs') :
require('./lib/SauceLabs');
{
"author": "Dan Jenkins <dan.jenkins@holidayextras.com> (www.dan-jenkins.co.uk)",
"name": "saucelabs",
"description": "A wrapper around Saucelabs REST API",
"version": "0.0.9",
"description": "A wrapper around Sauce Labs REST API",
"version": "0.1.0",
"homepage": "https://github.com/holidayextras/node-saucelabs",

@@ -11,9 +11,14 @@ "repository": {

},
"main": "index.js",
"dependencies": {},
"devDependencies": {},
"optionalDependencies": {},
"devDependencies": {
"jshint": "*",
"mocha": "1.9.x",
"chai": "1.5.x",
"nock": "0.17.x"
},
"engines": {
"node": "*"
},
"scripts": {
"test": "make lint test"
}
}

@@ -1,7 +0,5 @@

# node-saucelabs -- Node wrapper around the Saucelabs REST API
# node-saucelabs [![Build Status](https://secure.travis-ci.org/holidayextras/node-saucelabs.png)](http://travis-ci.org/holidayextras/node-saucelabs)
## Download or update node
Wrapper around the Sauce Labs REST API for [Node.js](http://nodejs.org/).
http://nodejs.org/#download
## Install

@@ -13,2 +11,16 @@

## Test
To run the test suite, first invoke the following command within the repo, installing the development dependencies:
```shell
npm install
```
Then run the tests:
```shell
npm test
```
## Authors

@@ -18,35 +30,36 @@

- Mathieu Sabourin ([OniOni](https://github.com/OniOni))
- Daniel Perez Alvarez ([unindented](https://github.com/unindented))
## Writting a script
## Writing a script
```javascript
var sauce = require('saucelabs');
var SauceLabs = require('saucelabs');
var myAccount = new sauce({
username: "your-sauce-username",
password: "your-sauce-api-key",
var myAccount = new SauceLabs({
username: "your-sauce-username",
password: "your-sauce-api-key"
})
myAccount.getAccountDetails( function (err, res) {
myAccount.getAccountDetails(function (err, res) {
console.log(res);
myAccount.getServiceStatus(function (err, res) {
// Status of the Sauce Labs services
console.log(res);
myAccount.getServiceStatus( function (err, res) {
//Status of the Sauce Labs services
console.log(res);
myAccount.getAllBrowsers( 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);
})
}
})
})
myAccount.getAllBrowsers(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);
});
}
})
})
})
});

@@ -57,149 +70,222 @@ ```

<table class="wikitable" width="90%" style="padding: 5%;">
<table>
<thead>
<tr>
<th width="50%">REST</td>
<th width="50%">Node Wrapper</td>
</tr>
</thead>
<tbody>
<tr >
<td width="50%"><strong>Rest</strong></td>
<td width="50%"><strong>Node Wrapper</strong></td>
<tr>
<td>
GET /users/:username <br />
Access account details.
</td>
<td>
getAccountDetails(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /users/:username <br />
Access account details.
GET /:username/limits <br />
Access current account limits.
</td>
<td>getAccountDetails(cb) -> cb(err, res)</td>
<td>
getAccountLimits(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /:username/limits <br />
Access account details
GET /:username/activity <br />
Access current account activity.
</td>
<td> getAccountLimits(cb) -> cb(err, res) </td>
<td>
getUserActivity(start, end, cb) -> cb(err, res) <br />
getUserActivity(start, cb) -> cb(err, res) <br />
getUserActivity(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /:username/activity <br />
Access current account activity.
GET /users/:username/usage <br />
Access historical account usage data.
</td>
<td>getUserActivity(cb, start, end) -> cb(err, res)</td>
<td>
getAccountUsage(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /users/:username/usage <br />
Access historical account usage data.
GET /:username/jobs <br />
List all job IDs belonging to a given user.
</td>
<td> getAccountUsage(cb) -> cb(err, res)</td>
<td>
getJobs(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /:username/jobs <br />
List all job Id's belonging to a given user.
GET /:username/jobs/:id <br />
Show the full information for a job given its ID.
</td>
<td>getJobs(cb) -> cb(err, res)</td>
<td>
showJob(id, cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /:username/jobs/:id <br />
Show the full information for a job given its ID.
PUT /:username/jobs/:id <br />
Changes a pre-existing job.
</td>
<td>showJob(id, cb) -> cb(err, res)</td>
<td>
updateJob(id, data, cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
PUT /:username/jobs/:id <br />
Changes a pre-existing job.
PUT /:username/jobs/:id/stop <br />
Terminates a running job.
</td>
<td>updateJob(id, data, cb) -> cb(err, res)</td>
<td>
stopJob(id, data, cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
PUT /:username/jobs/:id/stop <br />
Terminates a running job.
GET /:username/tunnels <br />
Retrieves all running tunnels for a given user.
</td>
<td>stopJob(id, data, cb) -> cb(err, res)</td>
<td>
getActiveTunnels(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /:username/tunnels <br />
Retrieves all running tunnels for a given user.
GET /:username/tunnels/:id <br />
Show the full information for a tunnel given its ID.
</td>
<td>getActiveTunnels(cb) -> cb(err, res)</td>
<td>
getTunnel(id, cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /:username/tunnels/:id <br />
Show the full information for a tunnel given its ID.
DELETE /:username/tunnels/:id <br />
Shuts down a tunnel given its ID.
</td>
<td>getTunnel(id, cb) -> cb(err, res)</td>
<td>
deleteTunnel(id, cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
DELETE /:username/tunnels/:id <br />
Shuts down a tunnel given its ID.
GET /info/status <br />
Returns the current status of Sauce Labs' services.
</td>
<td>deleteTunnel(id, cb) -> cb(err, res)</td> <br />
<td>
getServiceStatus(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /info/status <br />
Returns the current status of Sauce Labs' services.
GET /info/browsers/all <br />
Returns an array of strings corresponding to all the browsers currently supported on Sauce Labs.
</td>
<td>getServicesStatus(cb) -> cb(err, res)</td>
<td>
getAllBrowsers(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /info/browsers/all <br />
Returns an array of strings corresponding to all the browsers currently supported on Sauce Labs.
GET /info/browsers/selenium-rc <br />
Returns an array of strings corresponding to all the browsers currently supported under Selenium on Sauce Labs.
</td>
<td>getAllBrowsers(cb) -> cb(err, res)</td>
<td>
getSeleniumBrowsers(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /info/browsers/selenium-rc <br />
Returns an array of strings corresponding to all the browsers currently supported under Selenium on Sauce Labs.
GET /info/browsers/webdriver <br />
Returns an array of strings corresponding to all the browsers currently supported under WebDriver on Sauce Labs.
</td>
<td>getSeleniumBrowsers(cb) -> cb(err, res)</td>
<td>
getWebDriverBrowsers(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /info/browsers/webdriver <br />
Returns an array of strings corresponding to all the browsers currently supported under WebDriver on Sauce Labs.
GET /info/counter <br />
Returns the number of test executed so far on Sauce Labs.
</td>
<td>getWebDriverBrowsers(cb) -> cb(err, res)</td>
<td>
getTestCounter(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
GET /info/counter <br />
Returns the number of test executed so far on Sauce Labs.
POST /users/:username <br />
Create a new subaccount.
</td>
<td>getTestCounter(cb) -> cb(err, res)</td>
<td>
createSubAccount(data, cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
POST /users/:id <br />
Create a new sub-account, specifying a Sauce Labs service plan.
POST /users/:username/subscription <br />
Update a subaccount Sauce Labs service plan.
</td>
<td>createSubAccount(data, cb) -> cb(err, res)</td>
<td>
updateSubAccount(data, cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>POST /users/:id/subscription</td>
<td> ... </td>
<td>
DELETE /users/:username/subscription <br />
Unsubscribe a subaccount from its Sauce Labs service plan.
</td>
<td>
deleteSubAccount(cb) -> cb(err, res)
</td>
</tr>
<tr>
<td>
Make a public link to a private job, no need to login
Make a public link to a private job, without needing to login.
</td>
<td>createPublicLink(job_id, datetime, use_hour, cb) -> cb(err, url)<br />
createPublicLink(job_id, datetime, cb) -> cb(err, url)<br />
createPublicLink(job_id, cb) -> cb(err, url)</td>
<td>
createPublicLink(job_id, datetime, use_hour, cb) -> cb(err, url) <br />
createPublicLink(job_id, datetime, cb) -> cb(err, url) <br />
createPublicLink(job_id, cb) -> cb(err, url)
</td>
</tr>
</tbody>
</table>
## More Documentation
Check out the [Sauce REST API](http://saucelabs.com/docs/saucerest)
for more information
## More documentation
Check out the [Sauce REST API](https://saucelabs.com/docs/rest) for more information.
## License
saucelabs is licensed under the MIT license.
The MIT License (MIT)
Copyright (c) 2013 Dan Jenkins
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc