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 24H
Parameters
DATASET"suite-runs" | "test-runs"required
Positional dataset to aggregate: complete suite-runs or individual test-runs.
--metric"count" | "pass-rate" | "average-duration"required
Aggregate metric to calculate.
--group-by"outcome" | "branch" | "test" | "project"
Dimension to split series by. suite-runs cannot be grouped by test or project.
--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, or M. Defaults to 7D (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 }
      ]
    }
  ]
}
Toolanalytics_query
Example 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.

Parameters
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-runs cannot be grouped by test or project.
wherestring
Optional filter expression, such as branch = main. See Filter syntax below.
periodstring
Positive integer followed by H, D, W, or M. Defaults to 7D (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.

  1. Open Overview, Analytics, or Test health in the Endform dashboard.
  2. Choose a time window (for example Last 7 days) and filter by suite or branch.
  3. Review overall pass rate, run counts, duration trends, and the Flakiest tests ranking.

Datasets, metrics, and grouping

ParameterAllowed valuesNotes
datasetsuite-runs, test-runssuite-runs aggregates complete suite runs; test-runs aggregates individual Playwright test results.
metriccount, pass-rate, average-durationSets the response unit to count, percent, or seconds.
groupBy / --group-byoutcome, branch, test, projectsuite-runs supports outcome and branch only (test and project require test-runs).

Time windows

  • --period / period: A positive integer followed by H (hours), D (days), W (weeks), or M (months). Defaults to 7D.
  • --ending-at / endingAt: An optional ISO 8601 UTC timestamp where the window ends (for example 2026-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/endform

See Samples -> Filter syntax for the complete list of keys and operators.

Last updated