Skip to content

Azure Pipelines

  1. Create a Personal Access Token in your user account with permission to Read & Execute Build

image

  1. Obtain the ID of a pipeline you want to execute. Open a pipeline and copy its ID from definitionId query parameter. On this screenshot the ID is 1:

image

  1. Create a new CI connection on Continuous Integration page in Settings in Testomat.io.

image

  1. Fill in Private Access Token, Organization name, Project name, ID of a Pipeline

  2. Switch to “Input Variables” tab and check boxes:

  • Send Run ID as ‘run’ input (required for scheduled jobs)
  • Send Testomatio API key as ‘testomatio’ input
  • Send Testomatio Server URL as ‘testomatio_url’ input (If you use on-premise setup)
  1. Save the conection

  2. Testomat.io will need to send input variables into a pipeline. We need to enable them inside a pipeline using Azure DevOps UI. Open a Pipeline and edit it.

image

  1. Click “Variables” button

image

  1. Create the following variables:
  • grep
  • run
  • testomatio
  • testomatio_url

2022-11-13_01-56

Do not set defaults to this variable and tick “Let users override this value when running this pipeline” so Testomat.io could set these variables via API request.

image

  1. Update the pipeline to use passed variables. Update the script and pass environment variables to a test runner. Each variable can be accessed as $(variable). For CodeceptJS this command will look the following way:
- script: |
TESTOMATIO=$(testomatio) TESTOMATIO_URL=$(testomatio_url) TESTOMATIO_RUN=$(run) npx codeceptjs run --grep="$(grep)"
displayName: 'run tests'

If you use Jest, Playwright, Cucumber, Cypress, etc replace npx codeceptjs run with the execution command of your test runner.

You can pass more custom variables into a pipeline defining them in a Pipeline UI first and listing them in Testomat.io configuration as well. These variables should be set in Azure in the same way as grep. See Environment Configuration to see how they can be configured in Testomat.io

To specify a different branch to run tests add ref parameter on Configuration tab specifying target ref.

image

To specify develop branch add this as config parameter:

ref=refs/heads/develop