Running Tests via API
Learn how to trigger and manage test executions in Verex using the API.
API Key Authentication
To run tests via the API, organizations must generate an API Key:
- API Keys can be created and managed under Settings > API Keys.
- The API Key must be included in the request headers as a Bearer token.
- Learn more at API Keys.
Triggering Test Runs via API
You can run tests via the API in two ways:
1. Run a Test Suite
Triggers all tests within a given Test Suite.
Endpoint:
Headers:
Request Body:
Required Parameters:
suiteId
(path) – The ID of the test suite to run.
Response Format:
Note: A test suite run will only be marked as
PASSED
if all underlying test runs complete with thePASSED
status. If any test run returnsFAILED
orSTOPPED
, the test suite run will be marked asFAILED
.
2. Run an Individual Test
Triggers a single test from a suite.
Endpoint:
Headers:
Request Body:
Required Parameters:
testId
(path) – The ID of the test to run.
Response Format:
Note: Only enabled tests will be executed. When running a test suite, any disabled tests will be ignored. If you attempt to run a disabled individual test, the API will return a 403 Forbidden response.
Fetching Test Run Results
Once a test or test suite is executed, you can retrieve its results:
1. Get Test Suite Run Details
Retrieves details of a Test Suite Run, including test execution history.
Endpoint:
Query Parameters:
includeTestRuns
(optional) – "true" or "false" (default: "false").
Required Parameters:
testSuiteRunId
(path) – The ID of the test suite run.
Response Format:
2. Get Individual Test Run Details
Fetches the result of a specific test execution.
Endpoint:
Required Parameters:
testRunId
(path) – The ID of the test run.
Response Format:
Note: All
startedAt
andcompletedAt
timestamps are returned in ISO 8601 format (e.g.,2024-03-20T13:45:00.000Z
).
Possible Test Statuses
The status
field returned in API responses will always be in uppercase. Possible values include:
PENDING
– The test has been queued and is waiting to start.RUNNING
– The test is currently in progress.PASSED
– The test ran successfully and met all criteria.FAILED
– The test ran but did not meet the criteria.STOPPED
– The test was manually stopped (e.g., via the UI).
Stopping a Test Run
Currently, stopping a test run via the API is not supported. This feature will be added in a future update.