Skip to content

GitHub Actions

To set up connection between GitHub and Testomat.io, first, you need to configure your GitHub account:

  1. Create a Personal Access Token on GitHub with access to workflow scope (follow the instructions by link - Create PAT).

Testomatio - GitHub

  1. Create a Workflow in a GitHub Repository: Go to ‘Actions’ tab in Repository -> Select Workflow template -> Click ‘Configure’ button. Then you will get a workflow template. A workflow filename will be used by Testomat.io to call a specific workflow.

Testomatio - GitHub

Testomatio - GitHub

  1. This workflow will be used solely by Testomat.io, so it should start only on workflow_dispatch event. The event should be defined with the following input parameters:
name: Testomatio Tests
on:
workflow_dispatch:
inputs:
grep:
description: 'tests to grep '
required: false
default: ''
run:
required: false
testomatio:
required: false
  1. The Job should include a step where the test runner is executed with --grep option and TESTOMATIO environment variables passed in. For instance:
- run: npx codeceptjs run --grep "${{ github.event.inputs.grep }}"
env:
TESTOMATIO: "${{ github.event.inputs.testomatio }}"
TESTOMATIO_RUN: "${{ github.event.inputs.run }}"

After configuring your GitHub account, integrate GitHub Actions CI with your Testomat.io project:

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

Testomatio - CI

  1. Select ‘GitHub’ and enter following details on the ‘Connection’ tab:
  • GitHub Username.
  • API token - PAT created, in GitHub during Step 1.
  • Organization/Repository (or User/Repository).
  • Workflow - name of a workflow in GitHub Actions, in our case testomatio.yml.

Testomatio - GitHub

  1. Open ‘Configuration’ tab and check the default ref value. ref specifies the target branch or tag for test execution. By default, it is set to master, but you can adjust this if your main branch uses a different name, such as main.

Testomatio - GitHub

  1. Go to ‘Input Variables’ tab and enable run and testomatio inputs, to pass them from Testomat.io.
  1. Click on ‘Save’ button to save the connection.

Testomatio - GitHub

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

Testomatio - CI Run

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

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

Testomatio - GitHub

OR

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

9b. Select ‘GitHub’ profile in a list, as well, select a target ref and any other variables, if any were configured.

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

Testomatio - GitHub

This will start a new job in GitHub Actions, 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 - GitHub