ReferenceActions
Analytics
Query pass rates, run counts and average durations of your Playwright suite runs and test runs over time, and rank the flakiest or slowest tests.
Analytics aggregates historical Endform runs into time series so you can spot pass-rate drops, rank flakiest or slowest tests, and track suite health across branches or Playwright projects. Use analytics to identify a trend or test worth investigating, then follow up with samples to inspect concrete executions and errors.
Query run analytics
Query run analytics
Aggregates suite-run or test-run counts, pass rates, and average durations over a time window, optionally grouped by branch, outcome, project, or test.
$ npx endform@latest analytics suite-runs --metric count$ npx endform@latest analytics test-runs --metric pass-rate --group-by test --where 'branch = main' --period 7D$ npx endform@latest analytics test-runs --metric average-duration --group-by project --period 24HDATASET"suite-runs" | "test-runs"required- Positional dataset to aggregate: complete
suite-runsor individualtest-runs. --metric"count" | "pass-rate" | "average-duration"required- Aggregate metric to calculate.
--group-by"outcome" | "branch" | "test" | "project"- Dimension to split series by.
suite-runscannot be grouped bytestorproject. --wherestring- Comma-separated filter expression, such as
branch = main, suite.repository = org/repo. See Filter syntax below. --periodstring- Lookback window as a positive integer followed by
H,D,W, orM. Defaults to7D(cannot start more than 60 days ago). --ending-atstring- ISO 8601 timestamp where the period ends. Defaults to the current time.
--organization-idstring- Organization ID. Inferred from your repository config or active login when omitted.
Output
Prints JSON with unit (count, percent, or seconds), interval (hour, day, or week), from, to, and series (plus organizationHasRuns when no records match). When grouped by test, series[].group holds the test ID and series[].test holds identity metadata.
{
"unit": "percent",
"interval": "day",
"from": "2026-11-20T00:00:00.000Z",
"to": "2026-11-27T00:00:00.000Z",
"series": [
{
"group": "test_01J...",
"test": {
"fileName": "tests/checkout.spec.ts",
"describes": ["Checkout"],
"name": "completes booking"
},
"overall": { "value": 92.5, "observations": 40 },
"points": [
{ "start": "2026-11-26T00:00:00.000Z", "value": 90.0, "observations": 10 }
]
}
]
}analytics_queryExample promptShow the tests with the lowest pass rate on main over the last 7 days so we can fix the top flakes first.
Renders an interactive chart in MCP hosts that support MCP Apps. When grouped by test, follow up with samples_query using a returned series[].group value as test.id to inspect failing attempts.
organizationIdstringrequired- Organization ID from
organization_list. Hosted logins with a single organization do not see this argument. dataset"suite-runs" | "test-runs"required- Whether to aggregate suite-level or individual test-run records.
metric"count" | "pass-rate" | "average-duration"required- Aggregate metric to calculate.
groupBy"outcome" | "branch" | "test" | "project"- Optional grouping dimension.
suite-runscannot be grouped bytestorproject. wherestring- Optional filter expression, such as
branch = main. See Filter syntax below. periodstring- Positive integer followed by
H,D,W, orM. Defaults to7D(cannot start more than 60 days ago). endingAtstring- Optional ISO 8601 timestamp at which the period ends. Defaults to request time.
Output
Returns the same time-series JSON (unit, interval, from, to, series, and organizationHasRuns when no records match) and an interactive chart view in MCP hosts that support MCP Apps.
- Open Overview, Analytics, or Test health in the Endform dashboard.
- Choose a time window (for example Last 7 days) and filter by suite or branch.
- Review overall pass rate, run counts, duration trends, and the Flakiest tests ranking.
Datasets, metrics, and grouping
| Parameter | Allowed values | Notes |
|---|---|---|
dataset | suite-runs, test-runs | suite-runs aggregates complete suite runs; test-runs aggregates individual Playwright test results. |
metric | count, pass-rate, average-duration | Sets the response unit to count, percent, or seconds. |
groupBy / --group-by | outcome, branch, test, project | suite-runs supports outcome and branch only (test and project require test-runs). |
Time windows
--period/period: A positive integer followed byH(hours),D(days),W(weeks), orM(months). Defaults to7D.--ending-at/endingAt: An optional ISO 8601 UTC timestamp where the window ends (for example2026-11-27T12:00:00Z). Defaults to the current time.- Lookback limit: An analytics period cannot start more than 60 days before the request time.
Filter syntax
Analytics uses the same --where / where filter expression grammar as samples. Pass comma-separated key operator value clauses, quoting values that contain spaces, commas, or pipes:
branch = main, suite.repository = endformdev/endformSee Samples -> Filter syntax for the complete list of keys and operators.
Last updated