This GitHub Action can be used to trigger a new test on the external crowd-testing platform TestIO from a GitHub pull request (PR). Once this action is available in your repository you can use it by adding and editing specific comments in any PR.
To enable the action in your repository we recommend adding a new workflow to the .github/workflows
folder.
It must look like the following workflow.
name: TestIO - Trigger test from PR
on:
issue_comment:
types: [created, edited]
jobs:
testio-trigger-test:
name: TestIO - Trigger Test
runs-on: ubuntu-22.04
if: startsWith(github.event.comment.body, '@bot-testio exploratory-test') # this is the prefix all subsequent comments must start with
steps:
- name: Trigger Test on TestIO
uses: Staffbase/testio-trigger-test-github-action@v1.3.0
with:
testio-slug: your-testio-slug
testio-product-id: your-testio-product-id
github-token: ${{ secrets.YOUR_GITHUB_TOKEN }}
testio-token: ${{ secrets.YOUR_TESTIO_TOKEN }}
You can also use a reusable workflow to enable this action in your repository described here: https://github.com/Staffbase/gha-workflows#testio
Input | Description | Required |
---|---|---|
testio-slug |
the slug you received from TestIO | NO, but effectively YES because it defaults to staffbase |
testio-product-id |
ID of the product on the TestIO platform to which the triggered test should be assigned to | YES |
github-token |
GitHub token to be used for commenting in a PR | YES |
testio-token |
TestIO token of a user for which the triggered test is created | YES |
We highly recommend creating a separate product in your TestIO account dedicated to test creation from a PR. This avoids interference with the tests in your main product(s) (see FAQs).
In the product you dedicate for triggering tests from PRs we recommend configuring the default devices so that they correspond to your required Desktop test environments. Refer to the FAQs how to achieve this.
To trigger a test on TestIO for your default devices the following steps are required:
- Add the comment
@bot-testio exploratory-test create
to the PR from which the test should be triggered. - The action acknowledges your intention to trigger a new test by commenting in the PR with a message for requesting required information:
- Provide the required information by editing the comment added in step 2.
- Once you entered all the required information in the edited comment you need to replace
@bot-testio exploratory-test preparation
by@bot-testio exploratory-test submit
. - This triggers the test on TestIO and successful creation is commented back as a new comment.
To trigger a test on TestIO explicitly for Android or iOS devices the same steps as described for Default Devices need to be followed but with the following small adjustment:
- The comment to be added to trigger the whole process from step 1 needs to be
@bot-testio exploratory-test create <OS>
where<OS>
is one ofandroid
orios
. - If you want to trigger a test for Android Tablets you need to write
@bot-testio exploratory-test create android tablets
(for iOS respectively). - In addition to the other requested information you now need to provide the following:
"device": { "os": "android", "category": "smartphones", "min": "8.0", "max": "10" }
- You need to provide minimal and maximum OS version of devices the testers should use.
min
is mandatory andmax
optional.- If
max
is not provided TestIO automatically sets it tolatest
.
- run
nvm use
which uses the node version from.nvmrc
file - run
npm install
to install dependencies - run
npm run test
to run the unit test suite
How/Where to configure the default devices on TestIO?
Find the Default Devices in the menu as can be seen in the following screenshot.
How to create a new product dedicated for testing PRs on TestIO?
You can easily achieve that via the menu as can be seen in the following screenshot.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the Apache-2.0 License - see the LICENSE.md file for details.
Staffbase GmbH
Staffbase is an internal communications platform built to revolutionize the way you work and unite your company. Staffbase is hiring: staffbase.com/jobs GitHub | Website | Jobs |