CI Integration
Running tests on every change you introduce to your software is crucial to ensure your application behaves as expected. Stably allows you to run your tests from any CI / CD environment. You can either use our GitHub Action or call our API to execute a test programmatically.
Get API Key
Go to the settings page on the Web UI to get your API key.
Add to CI / CD
If you use GitHub
If you use GitHub
-
Create a secret for your API Key: Go to your GitHub repository, click on “Settings” > “Secrets and variables” > “Actions”. Then create a new Repository Secret named
STABLY_API_KEY
and paste your API Key into the secret value. -
From a test suite’s page, click on the
Add to CI
button to get the code snippet that contains the test suite ID. -
After copying the code snippet, create the file
.github/workflows/stably.yaml
in your GitHub repository and paste the code snippet there.
The code snippet should look like this example:
Testing your Pull Requests
Considering you already have a Test Suite to test a live environment, you can reuse that same test suite to run your Pull Request checks. For this, you must use the url-replacement
option:
If you use other CI / CD
If you use other CI / CD
The Stably API enables you to execute test suites programmatically. To authenticate and run tests, you’ll need two required information:
-
A Stably API key for authentication
-
A test suite ID that specifies which tests to run
To execute a test, simply run this curl
command: