QA Wolf logo

QA Wolf

/

Star

2.7k

Run Tests with CLI

In this tutorial, we'll trigger our tests with the QA Wolf CLI. This is useful if you want to run your tests in a CI provider like GitHub Actions, GitLab CI/CD, or CircleCI.

Run Tests with QA Wolf CLI

The command runs all of your tests with the QA Wolf CLI. If you are logged in, your team's API key is included in the example:

QAWOLF_API_KEY=API_KEY_HERE npx qawolf test

You can optionally filter tests by tags, choose the environment, and provide additional environment variables:

QAWOLF_API_KEY=API_KEY_HERE npx qawolf test --tags 'Sign up,Checkout' --environment 'Staging' --variables '{ "MY_VARIABLE": "secret" }'

Below are the available options:

  • --tags (optional): Comma separated list of test tag names. If not provided, all of your tests will run. Otherwise, tests with any of the provided tags will run.
  • --environment (optional): Name of environment to use when running your tests.
  • --variables (optional): JSON string of environment variables to pass to your tests.
  • --no-wait (optional): Do not wait for tests to run before exiting.
  • --branch (optional): Git branch of tests to run. You must have the sync to GitHub add-on to use this feature.

Note that you also need to set the QAWOLF_API_KEY environment variable before running tests with the CLI:

export QAWOLF_API_KEY=API_KEY_HERE # set API key

Run Tests with GitHub Actions

Create an encrypted secret for your QAWOLF_API_KEY.

Then run the cli in your workflow file. Here is an example running tests on deployment:

name: QA Wolf
on: [deployment]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Run QA Wolf tests
run: npx qawolf test
env:
QAWOLF_API_KEY: ${{ secrets.QAWOLF_API_KEY }}

Run Tests with GitLab CI/CD

Create a protected variable for your QAWOLF_API_KEY.

Then run the cli in your .gitlab-ci.yaml file. Here is an example workflow file:

image: node
qawolf:
script:
- npx qawolf test

Please reach out for help if you have questions about integrating QA Wolf into your process.

View Run History

🎉 Congratulations - now your tests will run when you use the QA Wolf CLI in 100% parallel!

You can see your test runs in the "Run history" page of the dashboard.

Run history