Github Actions

Running tests and reporting results within a continuous integration (CI) is a common task. If you use Github Actions and your workflow includes a job with a step that runs your tests, you may need to check the result to determine whether the pipeline is a success or a failure.

Some test frameworks automatically fail the process if the tests do not all pass. Others do not. For the latter case Tesults provides the Tesults API results check Action in the Github Actions Marketplace to check results and usage is demonstrated below.

In the case of the Playwright test framework for example the step will report results to Tesults and then Playwright will automatically fail the job if all test cases do not pass. In this case you do not need to do anything else.

name: Playwright Tests
  branches: [ main, master ]
  branches: [ main, master ]
  timeout-minutes: 60
  runs-on: ubuntu-latest
  - uses: actions/checkout@v3
  - uses: actions/setup-node@v3
    node-version: 18
  - name: Install dependencies
  run: npm ci
  - name: Install Playwright Browsers
  run: npx playwright install --with-deps
  - name: Run Playwright tests
      TARGET: ${{ secrets.TARGET }}
      BUILD: ${{ format('{0} {1}', 'Build ', github.run_number) }}
    run: npx playwright test

In the case above this assumes the playwright.config.js file contains reporter parameters like this:

reporter: [['playwright-tesults-reporter',
{'tesults-target': process.env.TARGET,
'tesults-build-name': process.env.BUILD,
'tesults-build-result': 'pass'}]],

This all works well for the Playwright test framework because it handles returning the appropriate process code for failing the job.

In the case where the test framework does not automatically fail the job, after tests have run and results data has been uploaded to Tesults, you would want to check results via the Tesults API, and then determine whether to fail the job or not.

To make this easy for Github Actions Tesults has made the Tesults API results check Action available in the Github Actions Marketplace:

Using this action is demonstrated below.

- name: Check
id: check
uses: tesults/tesults-api-results-check@1.0.6
  target: ${{ secrets.TARGET }}
  build: ${{ format('{0} {1}', 'Build ', github.run_number) }}
  api_token: ${{ secrets.API_TOKEN }}

The target, build and api_tokens are all required.

  1. target - the id of the target (available from the Tesults configuration menu ( and Tesults API)
  2. build - the build name, this is self generated and should be unique for the test run, we recommend simply using github.run_number
  3. api_token - the api token for the Tesults project, generated from the Tesults configuration menu (

This action will automatically fail the job if the pass rate is not 100%, however if you need the number of passes and total for any reason, the action outputs these values and they can be examined.

# Use the output from the `Check` step
- name: Get the number of passes and total
run: echo "${{ steps.check.outputs.pass }} pass out of ${{ }} total"

View the output in the Actions tab on Github.