Skip to main content

Insights Object

The insights object contains derived or aggregated metrics computed across one or more test runs. Insights help identify trends, patterns, and changes in test behavior over time, enabling cross-run analysis, flakiness detection, and baseline comparisons.

info

The insights object is optional and is typically added by consumers during post-processing rather than by test reporters directly.

Run-Level vs Test-Level Insights​

Insights can be computed at two levels:

Run-Level Insights​

The insights object at the root level contains metrics aggregated across multiple test runs. These provide an overall view of test health and trends.

Test-Level Insights​

The insights object within individual test objects contains metrics for that specific test case across multiple executions. This enables per-test trend analysis and flakiness detection.


Run-Level Insights Properties​

PropertyTypeRequiredDescription
passRatemetricDeltaOptionalOverall pass rate across all tests, with baseline comparison.
failRatemetricDeltaOptionalOverall failure rate across all tests.
flakyRatemetricDeltaOptionalRate of flaky tests across all tests.
averageRunDurationmetricDeltaOptionalAverage total duration of test runs.
p95RunDurationmetricDeltaOptional95th percentile of total test run duration.
averageTestDurationmetricDeltaOptionalAverage duration per individual test.
runsAnalyzedIntegerOptionalNumber of historical runs included in the insights calculation.
extraObjectOptionalExtension point for custom metrics or metadata.

Test-Level Insights Properties​

PropertyTypeRequiredDescription
passRatemetricDeltaOptionalPass rate for this specific test across runs.
failRatemetricDeltaOptionalFailure rate for this specific test.
flakyRatemetricDeltaOptionalFlaky rate for this specific test.
averageTestDurationmetricDeltaOptionalAverage duration of all attempts of this test across analyzed runs.
p95TestDurationmetricDeltaOptional95th percentile execution duration for this test.
executedInRunsIntegerOptionalNumber of runs in which this test was executed.
extraObjectOptionalExtension point for custom metrics or metadata.

Metric Delta​

The metricDelta object represents a metric's value with optional baseline comparison, enabling delta analysis between runs.

PropertyTypeRequiredDescription
currentNumberOptionalThe current value of the metric.
baselineNumberOptionalThe value of the metric from the baseline run for comparison.
changeNumberOptionalThe computed difference between current and baseline values.

Example​

{
"insights": {
"runsAnalyzed": 10,
"passRate": { "current": 0.95, "baseline": 0.92, "change": 0.03 },
"failRate": { "current": 0.05, "baseline": 0.08, "change": -0.03 },
"flakyRate": { "current": 0.02, "baseline": 0.03, "change": -0.01 },
"averageRunDuration": { "current": 45000, "baseline": 42000, "change": 3000 }
},
"results": {
"tests": [
{
"name": "should authenticate user",
"status": "passed",
"duration": 300,
"insights": {
"passRate": { "current": 0.90, "baseline": 0.85, "change": 0.05 },
"flakyRate": { "current": 0.10, "baseline": 0.15, "change": -0.05 },
"averageTestDuration": { "current": 280, "baseline": 250, "change": 30 },
"executedInRuns": 10
}
}
]
}
}

See the Metrics Reference for detailed definitions of each metric and the Baseline Object for information on baseline comparisons.