Docs status images

Sauce Build Status Images

Show off your Selenium test status!

If you use Sauce for open source projects or are fine making your Selenium test runs publicly visible, you can show off the status of your most recent build using our build status images, which look like this:

or you can use our new status browser matrix widget that gives really good insight into platforms on which your tests were run and status on each one of them:

Here's how it works:

  1. Choose a Sauce account which corresponds to your project.
    If you just have one project, you can use your main Sauce account name.
    If you have multiple projects, you will want to create a sub-account for each project.
  2. Run your tests for a given project on Sauce using that account's username and access key (found on the account page).
  3. Make sure to set a build and pass/fail status for every test that runs.
    process.env.TRAVIS_JOB_ID //an available build number if you're using travis-ci (node example)
    Also make sure every job is set to be publicly viewable (our Open Source Plan makes them public by default).
    Check out the additional configuration docs for more information on setting build or public flags on your test jobs.
    If your tests don't have a build or pass/fail status, or if even one in a build is not public, you'll get the "Unknown" image for security reasons.

Now you've got two options - choose your preffered one.

A) If you want to use standard badge:

  1. Paste the following HTML in your github README or on your project site:
    <a href="https://saucelabs.com/u/[ACCOUNT USERNAME]">
      <img src="https://saucelabs.com/buildstatus/[ACCOUNT USERNAME]" alt="Selenium Test Status" />
    </a>
  2. Or if you like Markdown:
    [![Selenium Test Status](https://saucelabs.com/buildstatus/[ACCOUNT USERNAME])](https://saucelabs.com/u/[ACCOUNT USERNAME])

B) If you want to use browser matrix widget:

  1. Paste the following HTML in your github README or on your project site:
    <a href="https://saucelabs.com/u/[ACCOUNT USERNAME]">
      <img src="https://saucelabs.com/browser-matrix/[ACCOUNT USERNAME].svg" alt="Selenium Tests Status" />
    </a>
  2. Or if you like Markdown:
    [![Selenium Test Status](https://saucelabs.com/browser-matrix/[ACCOUNT USERNAME].svg)](https://saucelabs.com/u/[ACCOUNT USERNAME])

NEW Browser Matrix Widget for non-public accounts

We just added a new feature that enables the widget for the private Sauce accounts. We want to make sure that no one besides you and people you want has access to the widget. To ensure that, you should generate a hmac authorization token that will be passed with the url. Requests to the widget without the proper token will be rejected. Here is how you generate it:

>>> from hashlib import md5
>>> import hmac
>>> hmac.new("[ACCOUNT USERNAME]:your-access-key", None, md5).hexdigest()
'a363c1ec5795c05cddeb13368b686684'
Once the auth token has been obtained, it can be used to build a link in the following format:
https://saucelabs.com/browser-matrix/[ACCOUNT USERNAME].svg?auth=<token>
For the example account, the link would end up being:
<a href="https://saucelabs.com/u/[ACCOUNT USERNAME]">
  <img src="https://saucelabs.com/browser-matrix/[ACCOUNT USERNAME].svg?auth=a363c1ec5795c05cddeb13368b686684" alt="Selenium Tests Status" />
</a>