List test runs
Returns a paginated list of test runs for the scoped project, with optional filtering by id, branch, state, result, environment, and time window.
curl --request GET \
--url https://api.empirical.run/api/test-runs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.empirical.run/api/test-runs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.empirical.run/api/test-runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.empirical.run/api/test-runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.empirical.run/api/test-runs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.empirical.run/api/test-runs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/test-runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"project": {
"id": 123,
"name": "<string>",
"slug": "<string>",
"repo_name": "<string>"
},
"test_runs": {
"items": [
{
"id": 123,
"state": "pending",
"total_count": 123,
"success_count": 123,
"failed_count": 123,
"skipped_count": 123,
"flaky_count": 123,
"duration": 123,
"test_run_branch": "<string>",
"environment_slug": "<string>",
"environment_name": "<string>",
"build_url": "<string>",
"build_branch": "<string>",
"commit": "<string>",
"created_at": "<string>",
"concurrency": {
"group": "<string>",
"on_conflict": "cancel"
}
}
]
}
},
"pagination": {
"page": 123,
"per_page": 123,
"total": 123,
"total_pages": 123
}
}{
"data": "<unknown>",
"error": {
"message": "<string>"
}
}{
"data": "<unknown>",
"error": {
"message": "<string>"
}
}| State | Description |
|---|---|
pending | Run is queued behind other runs (concurrency limit reached) |
queued | Run is queued and will start soon |
started | Run is currently executing |
ended | Run finished executing; inspect its result counts to determine whether tests passed |
error | Run failed with an error |
cancelling | Run is being cancelled |
cancelled | Run was cancelled |
| Error code | Description |
|---|---|
branch_missing | Explicitly requested test branch does not exist |
provider_error | Test-code provider failed during branch resolution |
merge_conflict | Merge conflict detected when merging the test branch |
dispatch_failed | Failed to dispatch the test run to workers |
report_not_generated | Test report was not generated |
run_failed_with_error | Test run failed with an error during execution |
worker_interrupted | Test run worker was interrupted |
run_timed_out | Test run exceeded the maximum duration |
merge_reports_failed | Failed to merge sharded reports |
empty_selection | The run’s selection (tags or test case ids) matched no tests |
repo_checkout_failed | The test repository could not be fetched from the git host |
unsupported_config | The Playwright config uses globalSetup, globalTeardown or chained teardown projects |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Return only the test run with this exact ID.
x >= 1Items per page (max 100). Defaults to 20.
1 <= x <= 100Page number (1-indexed). Defaults to 1.
x >= 1Filter to runs on this test repo branch.
Restrict to runs created in the last N days.
x >= 1Restrict to runs created at or after this time.
Restrict to runs created before this time.
Filter by run state (e.g. queued, ended); comma-separated for several.
Filter by overall run result.
passed, failed Filter to one environment. Combined with environment_ids when both are provided.
x >= 1Comma-separated environment IDs to filter by. Combined with environment_id when both are provided.
Filter to runs created in this concurrency group (exact match on the run's concurrency.group).
1 - 512Was this page helpful?
curl --request GET \
--url https://api.empirical.run/api/test-runs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.empirical.run/api/test-runs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.empirical.run/api/test-runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.empirical.run/api/test-runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.empirical.run/api/test-runs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.empirical.run/api/test-runs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/test-runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"project": {
"id": 123,
"name": "<string>",
"slug": "<string>",
"repo_name": "<string>"
},
"test_runs": {
"items": [
{
"id": 123,
"state": "pending",
"total_count": 123,
"success_count": 123,
"failed_count": 123,
"skipped_count": 123,
"flaky_count": 123,
"duration": 123,
"test_run_branch": "<string>",
"environment_slug": "<string>",
"environment_name": "<string>",
"build_url": "<string>",
"build_branch": "<string>",
"commit": "<string>",
"created_at": "<string>",
"concurrency": {
"group": "<string>",
"on_conflict": "cancel"
}
}
]
}
},
"pagination": {
"page": 123,
"per_page": 123,
"total": 123,
"total_pages": 123
}
}{
"data": "<unknown>",
"error": {
"message": "<string>"
}
}{
"data": "<unknown>",
"error": {
"message": "<string>"
}
}