Test Object
Each entry in the tests array represents a single executed test case. A test object captures the identity, outcome, timing, diagnostics, and optional retry data for that test.
Properties
| Name | Type | Required | Description |
|---|---|---|---|
id | String | Optional | Legacy UUID identifier retained for compatibility. New producers should prefer testId; consumers should prefer testId when both are present. |
testId | String | Optional | Stable, non-empty identifier for the logical test case. It should be deterministic across runs within the producer's documented scope. |
executionId | String | Optional | Non-empty identifier for this specific execution of the test case within a run. UUID is recommended and the value should not be reused across runs. |
name | String | Required | The name or title of the test case. Must be a non-empty string. |
status | String | Required | The final outcome of the test. Must be one of: passed, failed, skipped, pending, other. |
duration | Number | Required | The total execution time for the test case, in milliseconds. |
start | Integer | Optional | When test execution began, in milliseconds since the Unix epoch. |
stop | Integer | Optional | When test execution ended, in milliseconds since the Unix epoch. |
suite | Array of Strings | Optional | Suite hierarchy from top-level suite to the immediate parent of the test. Useful for logical grouping. |
message | String | Optional | A user-visible error or failure message associated with the test result. |
trace | String | Optional | A stack trace or structured trace information describing the failure. |
snippet | String | Optional | A code snippet or relevant source excerpt associated with the failure. |
ai | String | Optional | AI-generated diagnostic data, commentary, or suggestions related to the test. |
line | Integer | Optional | The line number associated with the test definition. |
rawStatus | String | Optional | The original status from the source tool before CTRF normalization. |
tags | Array of Strings | Optional | Simple keyless classifications (e.g., ["smoke", "regression"]). |
labels | Object | Optional | Structured key-value metadata. Values may be strings, numbers, booleans, or non-empty arrays of those primitive types. |
type | String | Optional | A classification for the test (e.g., "unit", "integration", "e2e"). |
filePath | String | Optional | The path to the file that defines the test case. |
retries | Integer | Optional | Number of re-executions after the initial attempt. Must be a non-negative integer. When greater than zero, requires retryAttempts with exactly this many entries. When zero, retryAttempts must be absent. |
flaky | Boolean | Optional | Whether the test is considered flaky. True only if final status is passed after one or more failed attempts. |
stdout | Array of Strings | Optional | Lines of standard output generated during test execution. |
stderr | Array of Strings | Optional | Lines of standard error output generated during test execution. |
threadId | String | Optional | Identifies the thread or worker on which the test executed. |
browser | String | Optional | The browser used during test execution (for browser-based tests). |
device | String | Optional | The device or device profile used during test execution. |
screenshot | String | Optional | A single base64-encoded screenshot captured during execution. Must not be a URL or file path. |
parameters | Object | Optional | Test parameters, input values, or contextual data relevant to the execution. See Parameters Object. |
steps | Array of Objects | Optional | Test steps or sub-operations performed during the test. See Step Object. |
attachments | Array of Objects | Optional | Additional artifacts associated with the test case. See Attachment Object. |
retryAttempts | Array of Objects | Optional | Ordered history of attempts completed before the final attempt represented by the test object. See Retry Attempt Object. |
insights | Object | Optional | Derived metrics specific to this test case across runs. See Insights Object. |
extra | Object | Optional | Extension point for arbitrary test-specific metadata. |
Example
{
"testId": "authentication/login/valid-credentials",
"executionId": "2cf7e0b4-ea0c-4ef4-a18a-b9d6f6f0e100",
"name": "should authenticate user with valid credentials",
"status": "passed",
"duration": 1200,
"suite": ["Authentication", "Login"],
"filePath": "tests/auth/login.spec.ts",
"tags": ["smoke", "auth"],
"labels": {
"priority": "high",
"owners": ["qa", "platform"],
"category": ["smoke", "staging"]
}
}
Use tags for simple keyless categorization. Use labels when metadata has a named key or may have multiple values. Label arrays must contain at least one value. Mixed primitive arrays are valid, though producers should use one primitive type per key where practical.
Attachment Object
The attachment object supports additional contextual information for test results, such as screenshots, logs, videos, or other artifacts. This enables better debugging and enhanced insights into test executions.
Attachment Properties
| Property | Type | Required | Description |
|---|---|---|---|
attachmentId | String | Optional | Non-empty identifier for this attachment reference. UUID is recommended and the value should be unique within the containing test or attempt. |
name | String | Required | A display name for the attachment (e.g., "failure-screenshot"). |
contentType | String | Required | The MIME type of the attachment (e.g., image/png, text/plain, video/mp4). |
path | String | Required | The path or URI to the attachment file. |
extra | Object | Optional | Extension point for arbitrary attachment-specific metadata. |
Attachment Example
{
"attachments": [
{
"attachmentId": "72d531af-9d77-4f3b-bf67-0d8ec26c2001",
"name": "failure-screenshot",
"contentType": "image/png",
"path": "./artifacts/screenshots/login-failure.png"
}
]
}
Step Object
The step object supports Behavior-Driven Development (BDD) style testing. It provides a structured way to describe each step in a test scenario, along with its outcome.
Step Properties
| Property | Type | Required | Description |
|---|---|---|---|
name | String | Required | The name or description of the test step. |
status | String | Required | The outcome of the step. Must be one of: passed, failed, skipped, pending, other. |
extra | Object | Optional | Extension point for arbitrary step-specific metadata. |
Step Example
"steps": [
{ "name": "Navigate to login page", "status": "passed" },
{ "name": "Enter user credentials", "status": "passed" },
{ "name": "Click submit button", "status": "failed" }
]
Retry Attempt Object
The retryAttempts array records attempts completed before the final attempt represented by the test object. It includes the initial attempt when a retry occurs and excludes the final attempt. Entries must be ordered, unique, and contiguous from attempt number 1. When present, the array must be non-empty and retries must also be present with exactly the same count. A positive retries value requires this array; retries: 0 requires it to be absent. The final attempt number is retries + 1.
Retry Attempt Properties
| Property | Type | Required | Description |
|---|---|---|---|
attempt | Integer | Required | Original sequence number for this attempt. Starts at 1 and forms a contiguous sequence within retryAttempts. |
attemptId | String | Optional | Non-empty identifier for this individual attempt. UUID is recommended and the value should be unique within the execution. |
status | String | Required | The outcome of this attempt. Must be one of: passed, failed, skipped, pending, other. |
duration | Number | Optional | The non-negative execution time for this attempt, in milliseconds. |
message | String | Optional | Error or failure message for this attempt. |
trace | String | Optional | Stack trace for this attempt. |
line | Integer | Optional | Line number associated with the failure. |
snippet | String | Optional | Code snippet for this attempt. |
stdout | Array of Strings | Optional | Standard output lines from this attempt. |
stderr | Array of Strings | Optional | Standard error lines from this attempt. |
start | Integer | Optional | When this attempt started, in milliseconds since the Unix epoch. |
stop | Integer | Optional | When this attempt ended, in milliseconds since the Unix epoch. |
attachments | Array of Objects | Optional | Artifacts captured during this specific attempt. |
extra | Object | Optional | Extension point for arbitrary attempt-specific metadata. |
Retry Attempt Example
"retryAttempts": [
{
"attempt": 1,
"attemptId": "48c3f90b-95a9-4c13-a42f-0888bb0b1001",
"status": "failed",
"duration": 500,
"message": "Element not found"
}
]
In this example, the test object contains the final attempt. With one entry in
retryAttempts, retries must be 1 and the final attempt number is 2.
Parameters Object
The parameters object supports parameterized tests by storing test-specific input values. This is an unstructured object allowing flexible key-value pairs representing parameters relevant to test execution.
Parameters Example
"parameters": {
"username": "testUser",
"password": "testPass123",
"environment": "staging"
}