Running Testim CLI in Github Actions

483 Views Asked by At

I'm in the process of evaluating Testim.io (Tests automation framework). They provide a CLI for running tests in a CI environment but do not support Github Actions. I've been trying to run it anyway, using the local option (which spins up a local Chrome instance) but failed miserably. The steps that were taken:

  1. Install Chromium using browser-actions/setup-chrome@latest action.
  2. Run testim-cli with the --use-local-chrome-driver flag, passing the Chromium bin location (--chrome-binary-location=$(which chrome)).

The error I'm getting in the action logs: enter image description here

I suspect I might be passing the wrong location of the chromium bin, but I'm not aware of any debugging tools in Github Actions that might help in that case.

Did anyone encounter anything similar?

2

There are 2 best solutions below

0
On

Testim now supports github actions. Here's a sample yaml from official docs:

name: Testim E2E
on: [push]

jobs:
    run-testimio-cli:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - uses: actions/setup-node@v2
              with:
                node-version: '16.13.0'
            - run: npm install -g @testim/testim-cli
            - run: testim --token <TESTIM_TOKEN> --project <PROJECT_ID> --grid <GRID_NAME>

Here's my sample project if you are interested to know more.

2
On

In case anyone encounters a similar issue (hopefully this will be supported soon by Testim).
It seems like the CLI didn't manage to run the tests as there's no display server in the remote machine.
I finally managed to run it by using the xvfb-action: enter image description here