GitHub Actions
Testery integrates with GitHub Actions via the Testery CLI.
You'll need to define a GitHub Actions workflow. This is done by creating a yml file in the .github/workflows folder in your repository.
Step 1. Retrieve your Testery API Token. To retrieve your token, click Settings → Integrations → Show API Token and copy the token that is displayed. Keep this token secure as it allows access to Testery on your behalf.
Step 2. Store your Testery API Token as a GitHub Actions secret. This is referenced in your GitHub Actions workflow as follows:
1
jobs:
2
build:
3
...
4
env:
5
TESTERY_TOKEN: ${{ secrets.TesteryTokenProd }}
6
...
Copied!
Step 3. Add steps to your GitHub Actions workflow to install the Testery CLI and create the test run.
Here is a sample .github/workflows/testery.yml
1
name: Testery Tests
2
3
on: [push]
4
5
jobs:
6
build:
7
runs-on: ubuntu-latest
8
9
env:
10
TESTERY_TOKEN: ${{ secrets.TesteryTokenProd }}
11
12
steps:
13
- uses: actions/[email protected]
14
- name: Set up Python ${{ matrix.python-version }}
15
uses: actions/setup-[email protected]
16
with:
17
python-version: "3.x"
18
- name: Install dependencies
19
run: |
20
python -m pip install --upgrade pip
21
pip install testery --upgrade
22
- name: Deploy Application
23
run: |
24
... logic to deploy your application ...
25
- name: Run Testery Tests
26
run: |
27
# Create test run.
28
testery create-test-run --api-url https://api.testery.io/api --token "$TESTERY_TOKEN" --include-tags "smoke" \
29
--variable "TEST_URL=${TEST_URL}" \
30
--git-ref "$GITHUB_SHA" --project "example-webdriverio" --environment "testery-dev" \
31
--wait-for-results
32
Copied!
Last modified 11mo ago
Copy link