Test Execution API Workflow
This guide shows the full flow for starting a new test execution, checking the job that was created, and then loading the final test run report.
- You can use our swagger interface to send requests and explore the API.
- You can also use any API client like Postman or Insomnia, or write your own scripts to automate the execution and reporting.
1. Start a new test execution
- Send a request to
POST /api/testExecution/{projId}. - Include your project API key in the
x-api-keyheader. - Pass
action: "executeTests"and add the filters that describe what should run. - If you have remote agents connected, you can also pass
agentNameto route the job to a specific runner. - Save the returned
jobId, because you will use it to track the execution job.
The request body below starts a run for a feature. You can swap featureId for testSuiteId, testId, or tests
depending on what you want to execute.
{
"action": "executeTests",
"featureId": "67f8cb3fe236b8d41b7700ac",
"agentName": "my-agent"
}
The API response tells you whether the job was accepted and gives you the job identifier.
{
"success": true,
"scheduleStatus": "Success",
"jobId": "6804f1d1d2d4e0a1c1a0d123"
}
What the request fields mean
featureIdruns every test that belongs to one feature.testSuiteIdruns every test in one test suite.testIdruns one test.testsruns a custom list of test ids.agentNameroutes the job to a specific agent when you want to target one runner.
If the API returns AlreadyExists, the same execution job is already queued, so you should reuse the existing jobId
instead of creating a duplicate run.
2. Monitor the job status
- Send a request to
POST /api/jobs/{projId}. - Pass the
jobIdsyou want to inspect. - Poll this endpoint until the job reaches a terminal state.
- Use the returned
testRunIdto open the final run report.
The request body below checks one job. You can include more job ids in the same array if you want to poll several
executions at once.
You can also omit the jobIds field to get a list of all active jobs for the project from the last month, but that is
not recommended for regular polling because the response will be larger and less efficient to process.
{
"jobIds": ["6804f1d1d2d4e0a1c1a0d123"]
}
A typical status response contains the current job state, the last update time, and the linked test run id when it becomes available.
{
"success": true,
"jobs": [
{
"jobId": "6804f1d1d2d4e0a1c1a0d123",
"status": "InProgress",
"updatedAt": "2026-04-20T10:15:30.000Z",
"testRunId": "6804f1e2d2d4e0a1c1a0d456"
}
],
"missingJobIds": []
}
How to read the job status
Pendingmeans the job has been created and is waiting to start.PendingAgentConnectionmeans the job is waiting for an agent to connect.InProgressmeans execution has started.SuccessorFailedmeans the job is finished.updatedAttells you when the backend last changed the job record.testRunIdappears when the execution has produced a test run record.missingJobIdslists ids that were invalid, missing, or did not belong to the project.
3. Monitor the test run status and result
- Wait until the job response includes a
testRunId. - Send a request to
GET /api/testRun/{projId}/{runId}. - Read the overall run summary first, then inspect each test result.
- Use the per-test status, timeline, and video link to understand what happened during execution.
The run report response gives you the full result set for the execution.
{
"runId": "6804f1e2d2d4e0a1c1a0d456",
"projectId": "67f8cb3fe236b8d41b7700ac",
"status": "Completed",
"startTime": "2026-04-20T10:15:31.000Z",
"testsInProjectCount": 24,
"title": "Regression run",
"statuses": [
{
"label": "Passed",
"count": 18
},
{
"label": "Failed",
"count": 2
},
{
"label": "Skipped",
"count": 4
}
],
"tests": [
{
"_id": "6804f1f1d2d4e0a1c1a0d789",
"title": "Login works for valid users",
"status": "Passed",
"duration": 1240,
"hasVideo": true,
"videoLink": "https://example.com/videos/run-1",
"startTime": "2026-04-20T10:15:40.000Z",
"timeline": []
}
]
}
What to look for in the run report
statusshows the overall run state.statusesgives the summary counts for passed, failed, skipped, running, and scheduled tests.testscontains the individual test results.durationshows how long each test took.timelinehelps you inspect the execution steps for a specific test.videoLinkpoints to the recorded run when a video is available.errorexplains why a test failed when the execution did not succeed.
4. Suggested polling flow
- Create the execution job.
- Poll
/api/jobs/{projId}until the job status becomesInProgressorSuccessand atestRunIdis present. - Load
/api/testRun/{projId}/{runId}with thattestRunId. - Keep refreshing the run report if you want to watch live progress while the job is still running.
5. Authentication and access
All documented endpoints expect the project API key in the x-api-key header.
x-api-key: your_project_api_key
If the key is missing or invalid, the API rejects the request before it reaches the execution or status logic.
6. Quick reference
POST /api/testExecution/{projId}starts a new execution.POST /api/jobs/{projId}checks execution job status.GET /api/testRun/{projId}/{runId}loads the final run report.
Use the job response to find the run id, then use the run report to inspect the final result details.