Testrunner Toolkit with GitLab

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.

What You'll Need#

Configure GitLab Credentials#

The first step of the integration is to ensure you've added your SAUCE_USERNAME and 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:

  1. Log in to GitLab.
  2. Go to your repository.
  3. In the left column, select Settings, then CI/CD.GitLab Secrets
  4. Look for Variables and click on expand.GitLab Variables
  5. Click on Add Variable to create a new secret.
  6. Enter the following information:
    • Value: 'your-sauce-username'
    • Type: 'Variable'
    • Environment Scope: AllAdd GitLab SAUCE_USERNAME
  7. Repeat the process for your Sauce Labs Access Key.

Credentials are now set!


Add GitLab-CI Configuration#

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:

See full example on GitHub

Commit the updated .gitlab-ci.yml to your git repository. Navigate back to the GitLab-CI dashboard to see your build pass.

GitLab Output
Last updated on by FΓ©lix P