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
sauceUsernameand 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 the
Keep this value secretoption, and click OK.
- Click Save.
Add Azure Pipeline Configuration
- In the root of your project directory, create the
- Commit the updated
.azure-pipelines.ymlfile to your git repository.
- Navigate back to the Azure DevOps Pipelines to see your build pass.