Tests
API Reference for Test resource
This resource allows you to programmatically fetch Test performance data that is available in Test Explorer. See Test Results if you are looking to get all the results for a particular test case.
List Tests
GET
v1/tests/:projectId
Querying this resource returns a list of tests for a project, including the metrics calculated based on the data matching the provided filters.
Path Parameters
projectId*
string
The project ID
Query Parameters
date_start*
string (ISO 8601)
Start date for filtering test results within the specified date range
date_end*
string (ISO 8601)
End date for filtering test results within the specified date range
limit
number
Pagination limit 1-50. Default: 50
page
number
Page number for pagination. Default: 0
tags[]
string[]
Filter by tag names. Multiple values: tags[]=valueA&tags[]=valueB
authors[]
string[]
Filter by author names. Multiple values: authors[]=valueA&authors[]=valueB
branches[]
string[]
Filter by branch names. Multiple values: branches[]=valueA&branches[]=valueB
groups[]
string[]
Filter by group names. Multiple values: groups[]=valueA&groups[]=valueB
order
enum
Defines the attribute to order the tests list. Values: duration
, executions
, failures
, flakiness
, passes
, title
, durationXSamples
, failRateXSamples
, failureRateDelta
, flakinessRateDelta
, flakinessXSamples.
Default: title
dir
enum
Sorting direction. Values: "asc"
, "desc"
. Default: "desc"
spec
string
Filter by spec file names containing this string.
title
string
Filter by test titles containing this string.
The following query parameters affect the metrics calculation. See Test Explorer.
min_executions
number
Filter results to those that has at least the number of executions defined on this parameter.
test_state[]
enum[]
Filter metrics calculations: executions
and avgDuration
to only calculate those with status defined in the list of this parameter.
Values: failed
, passed
, pending
, skipped
Response
{
"status": "OK",
"data": {
"list": [
{
"title": "should display welcome message",
"signature": "326aafb71c1fda3085ebde3671f230f0",
"spec": "feature.onboarding-25.spec.ts",
"metrics": {
"executions": 2,
"failures": 2,
"ignored": 1,
"passes": 10,
"flaky": 1,
"flakinessRate": 0.1,
"failureRate": 0.2,
"avgDuration": 1500,
"flakinessVolume": 150,
"failureVolume": 300,
"durationVolume": 15000
},
"latestTag": [
"development",
"PL"
],
"lastSeen": "2024-01-15T00:00:00.000Z"
}
],
"total": 44, // total number of tests detected
"nextPage": 1 // offset pagination hint (number or false)
}
}
Response Fields
Data
Test
title
string
The title/name of the test
spec
string
Name of the spec file containing the test
latestTag
string[]
List of latest tags used with the test
lastSeen
string (ISO 8601)
Date when the test was last seen
Metrics
executions
number
Number of total executions
failures
number
Number of failed executions
ignored
number
Number of ignored executions
passes
number
Number of passed executions
flaky
number
Number of flaky executions
flakinessRate
number
Ratio of flaky executions (0-1)
failureRate
number
Ratio of failed executions (0-1)
avgDurationMs
number
Average duration in milliseconds
Usage Examples
Basic Request
GET /v1/tests/project123?date_start=2024-01-01&date_end=2024-01-31
Filters and Pagination
GET /v1/tests/project123?date_start=2024-01-01&date_end=2024-01-31&tags[]=smoke&tags[]=regression&authors[]=john.doe&limit=25&page=1&order=failureRate&dir=desc
Search Filters
GET /v1/tests/project123?date_start=2024-01-01&date_end=2024-01-31&spec=login&title=authentication
Last updated
Was this helpful?