Wrapper around the Sauce Labs REST API for \href{http://nodejs.org/}{\texttt{ Node.\+js}}.\hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26241}{}\doxysection{Install}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26241}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm install saucelabs }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26242}{}\doxysection{Test}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26242}
To run the test suite, first invoke the following command within the repo, installing the development dependencies\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install }

\end{DoxyCode}


Then run the tests\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{npm test }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26243}{}\doxysection{Authors}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26243}

\begin{DoxyItemize}
\item Dan Jenkins (\href{https://github.com/danjenkins}{\texttt{ danjenkins}})
\item Mathieu Sabourin (\href{https://github.com/OniOni}{\texttt{ Oni\+Oni}})
\item Daniel Perez Alvarez (\href{https://github.com/unindented}{\texttt{ unindented}})
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26244}{}\doxysection{Writing a script}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26244}

\begin{DoxyCode}{0}
\DoxyCodeLine{var SauceLabs = require('saucelabs');}
\DoxyCodeLine{}
\DoxyCodeLine{var myAccount = new SauceLabs(\{}
\DoxyCodeLine{  username: "{}your-\/sauce-\/username"{},}
\DoxyCodeLine{  password: "{}your-\/sauce-\/api-\/key"{}}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{myAccount.getAccountDetails(function (err, res) \{}
\DoxyCodeLine{  console.log(res);}
\DoxyCodeLine{  myAccount.getServiceStatus(function (err, res) \{}
\DoxyCodeLine{    // Status of the Sauce Labs services}
\DoxyCodeLine{    console.log(res);}
\DoxyCodeLine{    myAccount.getAllBrowsers(function (err, res) \{}
\DoxyCodeLine{      // List of all browser/os combinations currently supported on Sauce Labs}
\DoxyCodeLine{      console.log(res);}
\DoxyCodeLine{      myAccount.getJobs(function (err, jobs) \{}
\DoxyCodeLine{        // Get a list of all your jobs}
\DoxyCodeLine{        for (var k in jobs) \{}
\DoxyCodeLine{          if ( jobs.hasOwnProperty( k )) \{}
\DoxyCodeLine{            myAccount.showJob(jobs[k].id, function (err, res) \{}
\DoxyCodeLine{              var str = res.id + "{}: Status: "{} + res.status;}
\DoxyCodeLine{              if (res.error) \{}
\DoxyCodeLine{                str += "{}\(\backslash\)033[31m Error: "{} + res.error + "{} \(\backslash\)033[0m"{};}
\DoxyCodeLine{              \}}
\DoxyCodeLine{              console.log(str);}
\DoxyCodeLine{            \});}
\DoxyCodeLine{          \}}
\DoxyCodeLine{        \}}
\DoxyCodeLine{      \});}
\DoxyCodeLine{    \});}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\}); }

\end{DoxyCode}
 \hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26245}{}\doxysection{Using a proxy}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26245}
If you\textquotesingle{}re behind a corporate firewall or would like to utilize a proxy, define it in the constructor like this\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var sauce = new SauceLabs(\{}
\DoxyCodeLine{  username: "{}your-\/sauce-\/username"{},}
\DoxyCodeLine{  password: "{}your-\/sauce-\/api-\/key"{},}
\DoxyCodeLine{  proxy: "{}https://your-\/proxy.com:8000"{}}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26246}{}\doxysection{Supported Methods}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26246}
\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{0}{|X[-1]}|}
\hline
\end{longtabu}


REST 

Node Wrapper  $<$/thead$>$ $<$tbody$>$ 

GET /users/\+:username ~\newline
 Access account details.  

get\+Account\+Details(cb) -\/$>$ cb(err, res)   

GET /\+:username/limits ~\newline
 Access current account limits.  

get\+Account\+Limits(cb) -\/$>$ cb(err, res)   

GET /\+:username/activity ~\newline
 Access current account activity.  

get\+User\+Activity(start, end, cb) -\/$>$ cb(err, res) ~\newline
 get\+User\+Activity(start, cb) -\/$>$ cb(err, res) ~\newline
 get\+User\+Activity(cb) -\/$>$ cb(err, res)   

GET /users/\+:username/concurrency ~\newline
 Get currently running job counts broken down by account and job status  

get\+User\+Concurrency(cb) -\/$>$ cb(err, res)   

GET /users/\+:username/usage ~\newline
 Access historical account usage data.  

get\+Account\+Usage(cb) -\/$>$ cb(err, res)   

GET /\+:username/jobs ~\newline
 List all job IDs belonging to a given user.  

get\+Jobs(cb) -\/$>$ cb(err, res)   

GET /\+:username/jobs/\+:id ~\newline
 Show the full information for a job given its ID.  

show\+Job(id, cb) -\/$>$ cb(err, res)   

PUT /\+:username/jobs/\+:id ~\newline
 Changes a pre-\/existing job.  

update\+Job(id, data, cb) -\/$>$ cb(err, res)   

DELETE /\+:username/jobs/\+:id ~\newline
 Removes the job from the system with all the linked assets.  

delete\+Job(id, cb) -\/$>$ cb(err, res)   

PUT /\+:username/jobs/\+:id/stop ~\newline
 Terminates a running job.  

stop\+Job(id, data, cb) -\/$>$ cb(err, res)   

GET /\+:username/tunnels ~\newline
 Retrieves all running tunnels for a given user.  

get\+Active\+Tunnels(cb) -\/$>$ cb(err, res)   

GET /\+:username/tunnels/\+:id ~\newline
 Show the full information for a tunnel given its ID.  

get\+Tunnel(id, cb) -\/$>$ cb(err, res)   

DELETE /\+:username/tunnels/\+:id ~\newline
 Shuts down a tunnel given its ID.  

delete\+Tunnel(id, cb) -\/$>$ cb(err, res)   

GET /info/status ~\newline
 Returns the current status of Sauce Labs\textquotesingle{} services.  

get\+Service\+Status(cb) -\/$>$ cb(err, res)   

GET /info/browsers/all ~\newline
 Returns an array of strings corresponding to all the browsers currently supported on Sauce Labs.  

get\+All\+Browsers(cb) -\/$>$ cb(err, res)   

GET /info/browsers/selenium-\/rc ~\newline
 Returns an array of strings corresponding to all the browsers currently supported under Selenium on Sauce Labs.  

get\+Selenium\+Browsers(cb) -\/$>$ cb(err, res)   

GET /info/browsers/webdriver ~\newline
 Returns an array of strings corresponding to all the browsers currently supported under Web\+Driver on Sauce Labs.  

get\+Web\+Driver\+Browsers(cb) -\/$>$ cb(err, res)   

GET /info/counter ~\newline
 Returns the number of test executed so far on Sauce Labs.  

get\+Test\+Counter(cb) -\/$>$ cb(err, res)   

POST /users/\+:username ~\newline
 Create a new subaccount.  

create\+Sub\+Account(data, cb) -\/$>$ cb(err, res)   

POST /users/\+:username/subscription ~\newline
 Update a subaccount Sauce Labs service plan.  

update\+Sub\+Account(data, cb) -\/$>$ cb(err, res)   

DELETE /users/\+:username/subscription ~\newline
 Unsubscribe a subaccount from its Sauce Labs service plan.  

delete\+Sub\+Account(cb) -\/$>$ cb(err, res)   

Make a public link to a private job, without needing to login.  

create\+Public\+Link(job\+\_\+id, datetime, use\+\_\+hour, cb) -\/$>$ cb(err, url) ~\newline
 create\+Public\+Link(job\+\_\+id, datetime, cb) -\/$>$ cb(err, url) ~\newline
 create\+Public\+Link(job\+\_\+id, cb) -\/$>$ cb(err, url)   

GET /users/\+:username/list-\/subaccounts ~\newline
 Access list of subaccounts  

get\+Sub\+Account\+List(cb) -\/$>$ cb(err, res)   

GET /users/\+:username/subaccounts ~\newline
 Get information about a sub accounts  

get\+Sub\+Accounts(cb) -\/$>$ cb(err, res)   $<$/tbody$>$ \hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26247}{}\doxysection{More documentation}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26247}
Check out the \href{https://saucelabs.com/docs/rest}{\texttt{ Sauce REST API}} for more information.\hypertarget{md_sfcode_node_modules_saucelabs_README_autotoc_md26248}{}\doxysection{License}\label{md_sfcode_node_modules_saucelabs_README_autotoc_md26248}
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 \char`\"{}\+Software\char`\"{}), 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 \char`\"{}\+AS IS\char`\"{}, 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. 