These examples can apply to virtually any GitLab deployment, provided that you already have some existing automated tests, and are either the maintainer or an admin of the target repository.
- GitLab Account and Instance
- SauceLabs Account
- The following permissions in GitLab:
- Ability to manage GitLab repository containing the project.
The first step of the integration is to ensure you've added your
SAUCE_ACCESS_KEY as a secret in your GitLab instance (Not sure where to find these? They're here).
The easiest way to add credentials to GitLab is with the UI:
- Log in to GitLab.
- Go to your repository.
- In the left column, select Settings, then CI/CD.
- Look for Variables and click on expand.
- Click on Add Variable to create a new secret.
- Enter the following information:
- Value: 'your-sauce-username'
- Type: 'Variable'
- Environment Scope: All
- Repeat the process for your Sauce Labs Access Key.
Credentials are now set!
In the root of your project directory, create the
.gitlab-ci.yml file. Below are some job snippets of how to configure Testrunner Toolkit with GitLab-CI:
Commit the updated
.gitlab-ci.yml to your git repository. Navigate back to the GitLab-CI dashboard to see your build pass.