saucectl with Azure DevOps
These examples can apply to virtually any Azure DevOps deployment, provided that you already have some existing automated tests, and are either the maintainer or an admin of the target repository.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license)
- Your Sauce Labs Username and Access Key
- An Azure DevOps Account
Add Secret Variables
To run tests on Sauce Labs from Azure DevOps, you need to make your Sauce Labs credentials available to your Pipelines. We'll set a secret variable in the UI.
- Log in to Azure DevOps.
- Go to the Pipelines page, select a pipeline, then Edit.
- Click on Variables, then New Variable.
- Enter the name
sauceUsername
and set the value to your Sauce Labs username and click OK. - Add another variable, this time named
sauceAccessKey
, set it to your Sauce Labs access key, select theKeep this value secret
option, and click OK. - Click Save.
Add Azure Pipeline Configuration
- In the root of your project directory, create the
.azure-pipelines.yml
file.azure-pipelines.ymlloading...
- Commit the updated
.azure-pipelines.yml
file to your git repository. - Navigate back to the Azure DevOps Pipelines to see your build pass.