In this tutorial, we'll run tests after a deployment.
Click the Triggers
button in the sidebar of the dashboard.
Click Create Trigger
.
You can rename your trigger, or use the default name.
You can choose to run all your tests, or only tests with specific tags.
If you have created any environments, choose the one to use when your tests run.
Choose Deployment
from the Run tests on
dropdown.
You can run your tests on all deployments (preview and production), just preview deployments, or just production deployments.
To run the tests on specific branches only, choose Select
and enter a comma-separated list of branches: develop,main
.
For example, at QA Wolf we have a group of tests that we run when staging is deployed. We deploy to staging automatically when we merge to the develop
branch.
Once you are done, click the Create trigger
button to save your trigger.
After your deployment succeeds, send us an HTTP POST request. If the deployment matches the filters on this trigger, we will run a test suite.
If you are logged in, your team's API key is included in the example.
curl -H "Authorization: API_KEY_HERE" -H "Content-Type: application/json" https://www.qawolf.com/api/webhooks/deploy_success
You can optionally provide us the branch, deployment_type, deployment_url, commit SHA or custom one time environment variables.
curl -H "Authorization: API_KEY_HERE" -H "Content-Type: application/json" https://www.qawolf.com/api/webhooks/deploy_success -d '{"branch": "fixed-login", "deployment_type": "preview", "deployment_url": "https://todomvc.com", "sha": "de12adda500f2bc5a29dbd89f4fb1b0e1a31de81", "variables": { "custom": "value" }}'
The POST
request to the deploy_success
webhook includes a few parts:
-H "Authorization: API_KEY_HERE"
.branch
string. If a Git commit triggered this deploy, send us the relevant branch so that we can display it in the UI and find any pull requests on the GitHub repo linked to any triggers that match.deployment_type
. Send this if you filter by deployment type in the trigger.deployment_url
. If you send this, it will be available in your tests as process.env.URL for any runs created by this deployment notification.sha
. If a Git commit triggered this deploy, send us the commit SHA so that we can create GitHub commit checks if you have a GitHub repo linked to any triggers that match. We also use this to display a link to the commit in the run UI.variables
list. If you send this, it will be injected in the environment used in the suite.After you run the curl command in your terminal, you'll get a response like this:
{"results": [{"created_suite_id":"cl1f6i0in15676w115vt43vw2","trigger_id":"ckzoog9wy01720xyrvl8ah7gu"}]}
You can connect your GitHub repository to QA Wolf to see status checks on commits.
A new tab will open and visit GitHub. You will be asked to choose the repo(s) you want QA Wolf to access.
Choose the repo(s) you want to test and click the green Install
button. After the installation succeeds, the new tab will close.
Confirm the repo you want to test is now selected in the dropdown.
When you push a commit to GitHub, your tests will run after your deployment succeeds.
QA Wolf will comment on a pull request with the most recent test suite. As your tests run, the comment is updated to report the latest results.
🎉 Congratulations - now your tests will run when you deploy in 100% parallel!
You can see your test runs in the Run history
page of the dashboard.