CI/CD
Learn how to connect DogQ tests to your CI/CD pipeline and parameterize your tests to cover more cases without changing the scripts themselves.
Last updated
Learn how to connect DogQ tests to your CI/CD pipeline and parameterize your tests to cover more cases without changing the scripts themselves.
Last updated
Today, CI/CD is one of the best practices development teams use to keep their production pipelines efficient. Automating build, test, and deployment processes helps save valuable time that can be used to focus more on development and innovation rather than manual, error-prone tasks.
Using DogQ API you can execute your test suites and receive back the results as well as parameterize your tests by setting up variables.
To trigger the external execution of a Project you need to send a POST request to our API and provide the Project token.
API endpoint: "https://dogq.io/projects/external_execute"
Token can be found at the bottom of the Project Settings .
Here's an example POST request:
Token triggers the execution of the whole Project, i.e. all active Modules and Scenarios will be executed. Project token can be changed. Clicking on the respective button next to the token will randomly generate a new one.
All such test executions will be available on the Executions page and have an External api call status in the "Created by" column.
The payload this webhook carries is an object with test results using which you can further automate your pipeline, e.g., if there are no failed test runs -> deploy to production.
project_id : the ID of your project
project_name : your project name
status : "passed" (if all tests passed successfully) or "failed" (if at least one test failed)
full_test_run_count : the overall number tests executed
test_runs_passed_count : the number of tests that passed successfully
test_runs_failed_count : the number of tests that have failed during the execution
test_runs_url : a URL to Executions page with the results
The Webhook Link feature, like other notifications, only works for scheduled and externally executed runs. Once you've provided the link DogQ will attempt to send a webhook every time the Project is executed via schedule or externally. If you would like DogQ to stop, remove the link from the settings.
If a test you're running via API call has variables in it, you can change the test behavior by setting the variables in the body of your POST request.
Ensure that the variables you define in your API request match the names used in your test scripts and use "variables" as it's a mandatory key word.
In the following example we're defining a variable with the name "var_url" and giving it a value of "staging-url.io":
And a Scenario in the Project we're executing via API request could look like this:
In case you need to set more than one variable for your tests, you can do so by listing them one by one, i.e. by adding multiple parameters.
For example:
curl --location --request POST "https://dogq.io/projects/external_execute"
--header "TOKEN: UXfEcQhKDn6dCXbt8YwxkJkz"
--data-urlencode "variables[url]=myapp-staging-url.io"
--data-urlencode "variables[email][email protected]"
--data-urlencode "variables[password]=12345"
Also in the Project Settings inside Notifications there's a field for a Webhook Link. Here you can specify a URL of an open endpoint for DogQ to send POST requests to.