Spec Files

API Reference - Spec Files resource

This resource represents the Spec Files and their performance metrics

The results are sorted according to the order parameter. Using this query would allow to programmatically access the data that is available in Test Suite Explorer.

This resource uses Offset Pagination as documented at Pagination

List Spec Files

GET v1/spec-files/:projectId

Querying this resource returns a list of spec files for a project, including the metrics calculated based on the data matching the provided filters.

The following metrics are available:

  • overallExecutions - overall executions included in the aggregation.

  • avgDuration - average duration of non-failed executions, in seconds;

    • set includeFailedInDuration to true to include failed executions in the calculation

  • failedExecutions - number of executions with at least 1 failed test.

  • flakyExecutions - number of executions with at least 1 flaky test.

  • timeoutExecutions - number of executions that were marked as timed out.

  • fullyReported - count of executions with all the known tests fully completed and reported

  • suiteSize - maximum number of tests across all the included executions

  • failureRate - the ratio failedExecutions / overallExecutions

  • timeoutRate - the ratio timeoutExecutions / overallExecutions

  • flakeRate - the ratio flakyExecutions / overallExecutions

Path Parameters

Name
Type
Description

projectId*

String

Your project ID

Query Parameters

Name
Type
Description

limit

Number

Pagination limit 1-50. Default: 50

page

Number

Page 0+. Default: 0. See Pagination

date_start*

ISOString

Date start - the test results included within the date range will be included.

date_end*

ISOString

Date end - the test results included within the date range will be included.

tags[]

String[]

List of tags for filtering the included test results. To provide multiple values, use tags[]=valueA&tags[]=valueB

authors[]

String[]

List of authors for filtering the included test results. To provide multiple values, use authors[]=valueA&authors[]=valueB

branches[]

String[]

List of branches for filtering the included test results. To provide multiple values, use branches[]=valueA&branches[]=valueB

includeFailedInDuration

Boolean

Include failed spec files in duration calculation. Default: false.

order

Enum

Defines the attribute to order the spec files list. Default: avgDuration.

Valid values:

avgDuration

failedExecutions

failureRate

flakeRate

flakyExecutions

fullyReported

overallExecutions

suiteSize

timeoutExecutions

timeoutRate

specNameFilter

String

A string that is included in the spec file name. Default: empty.

dir

Enum

Sorting direction. Default: desc.

Options: asc, desc

{
    "status": "OK",
    "data": {
        "list": [
            {
                "signature": "326aafb71c1fda3085ebde3671f230f0",
                "spec": "feature.onboarding-25.spec.ts",
                "metrics": {
                    "overallExecutions": 3,
                    "avgDuration": 13184,
                    "failedExecutions": 0,
                    "flakyExecutions": 0,
                    "timeoutExecutions": 0,
                    "suiteSize": 2,
                    "failureRate": 0,
                    "timeoutRate": 0,
                    "flakeRate": 0,
                    "fullyReported": 3
                }
            }
        ],
        "total": 44, // the total number of spec files detected
        "nextPage": number | false // offset pagination hint
    }
}

Last updated

Was this helpful?