Skip to content

BitBucket Pipelines

To connect BitBucket to Testomat.io you will need a API Token created in your BitBucket account. API token can be added on ‘Repository settings’ page of the current user - create an access token for repository.

Testomat.io - Bitbucket API Token

Then create a new BitBucket project. Click on ‘Create’ button at the header menu and select ‘Project’ option from the displayed dropdown list.

Testomat.io - Bitbucket New Project

Make this build parametrized. Go to ‘Settings’ -> ‘Workspace settings’ -> ‘Workspace variables’

Testomat.io - Bitbucket Workspace Variables

Add the following parameters as a string with empty default values:

  • run
  • testomatio
  • grep

The Job should include a step where the test runner is executed with —grep option and TESTOMATIO environment variables passed in.

For instance: - npx codeceptjs run-workers 2 --grep "${grep}"

Testomat.io - Bitbucket Job Step

Save the build and switch to Testomat.io. To integrate BitBucket with your Testomat.io project follow the steps described below:

  1. Go to ‘Settings’.
  2. Select ‘Continuous Integration’.
  3. Click ‘Connect to CI’.

Testomatio - CI

  1. Select ‘BitBucket Pipeline’ and enter following details on the ‘Connection’ tab:
  • API token - access token, created in BitBucket during Step 1.
  • Workspace Name - Workspace UID.
  • Repository Slug- a URL-friendly version of a repository name, automatically generated by BitBucket for use in the URL.

Testomatio - Bitbucket

  1. Switch to ‘Input Variables’ tab and select checkboxes:
  • Send Run ID as run input (required for scheduled jobs).
  • Send Testomat.io API key as testomatio input.
  • Send Testomat.io Server URL as testomatio_url input (if you use on-premise setup).
  1. Click on ‘Save’ button to save the connection.

Testomatio - Bitbucket

7a. When the connection is saved, open ‘Runs’ page and select Run Automated Tests in CI option in extra menu.

Testomatio - CI Run

8a. Select ‘BitBucket’ profile in a list, select a target ref or any other variables, if any were configured. Optionally, select a Test Plan or create a new one.

9a. Click on ‘Launch’ button and wait for the results.

Testomatio - Bitbucket

OR

7b. On ‘Tests’ page select any automated suite or test case -> click ‘Extra menu’ button -> select ‘Run Tests’ option -> open ‘Run in CI’ tab.

8b. Select ‘BitBucket’ profile in a list, as well, select a target ref or any other variables, if any were configured.

9b. Click on ‘Launch’ button and wait for the results.

Testomatio - Bitbucket

This will start a new job in BitBucket, please check that the job was successfully triggered and completed. After the job has finished, a run report will be available on Runs page of Testomat.io.

Testomatio - Bitbucket