https://github.com/staffbase/testio-trigger-test-github-action
GitHub Action for triggering a new test on the crowd-testing provider platform TestIO from a PR
https://github.com/staffbase/testio-trigger-test-github-action
github-actions
Last synced: over 1 year ago
JSON representation
GitHub Action for triggering a new test on the crowd-testing provider platform TestIO from a PR
- Host: GitHub
- URL: https://github.com/staffbase/testio-trigger-test-github-action
- Owner: Staffbase
- License: apache-2.0
- Created: 2023-07-03T13:10:21.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T02:57:50.000Z (about 2 years ago)
- Last Synced: 2024-04-14T12:55:15.987Z (about 2 years ago)
- Topics: github-actions
- Language: TypeScript
- Homepage:
- Size: 1.39 MB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Trigger a Test on the Crowd-Testing Platform TestIO from a Pull Request
## Description
This GitHub Action can be used to trigger a new test on the external crowd-testing platform [TestIO](https://test.io/services/exploratory-testing) 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.
> ##### Note: For being able to use this action you need to be a customer of TestIO.
## Enable the Action in Your Repository
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.
### Workflow
```yaml
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 }}
```
### Reusable Workflow
You can also use a reusable workflow to enable this action in your repository described here: [https://github.com/Staffbase/gha-workflows#testio](https://github.com/Staffbase/gha-workflows#testio)
### Inputs
| 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 |
## Use the Action to trigger a new test on TestIO from a PR
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](#faqs)).
### For the Default Devices in Your Account
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](#faqs) how to achieve this.
To trigger a test on TestIO for your default devices the following steps are required:
1. Add the comment `@bot-testio exploratory-test create` to the PR from which the test should be triggered.
2. The action acknowledges your intention to trigger a new test by commenting in the PR with a message for requesting required information:
3. Provide the required information by editing the comment added in step 2.
4. 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`.
5. This triggers the test on TestIO and successful creation is commented back as a new comment.

### For Android or iOS Devices
To trigger a test on TestIO explicitly for Android or iOS devices the same steps as described for [Default Devices](#for-the-default-devices-in-your-account)
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 ` where `` is one of `android` or `ios`.
- 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:
```json
"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 and `max` optional.
- If `max` is not provided TestIO automatically sets it to `latest`.
## Run Tests
- 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
## FAQs
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.

## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## License
This project is licensed under the Apache-2.0 License - see the [LICENSE.md](LICENSE) 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