Analytics
Monitor your project's test health at a glance with summary cards, trend charts, and flaky test detection — all calculated automatically from your run history.
Overview
The Analytics dashboard (the Project Dashboard page) provides a comprehensive view of your project's testing health. It aggregates data from all test runs in a project and presents it through summary cards, a 30-day trend chart, flaky test detection, and a test health breakdown.
To access the dashboard, navigate to your project's test list and click the Dashboard link. The dashboard loads data from three API endpoints: summary, trends, and flaky tests.
Analytics are calculated entirely from your existing run history data. No separate tracking or configuration is needed — every test run automatically contributes to your analytics.
Summary Cards
The top of the dashboard displays four summary cards that give you an immediate snapshot of your project's health:
| Card | Description | Calculation |
|---|---|---|
| Total Tests | The total number of tests defined in the project. | Count of all test records in the project. |
| Pass Rate | The percentage of runs that passed, displayed as a percentage. | Math.round((passedRuns / totalRuns) * 100). Returns 0% if no runs exist. |
| Total Runs | The total number of individual test executions across all tests. | Count of all run records for tests in the project. |
| Average Duration | The mean execution time across all runs, displayed in a human-readable format (e.g., "2.3s" or "1m 15s"). | Math.round(totalDurationMs / totalRuns). Returns 0 if no runs exist. |
The summary endpoint returns all four values in a single response:
{
"totalTests": 24,
"totalRuns": 156,
"passRate": 87,
"avgDuration": 4523,
"testStatusCounts": {
"passing": 18,
"failing": 4,
"noRuns": 2
}
}
Trend Chart
The trend section displays a 30-day stacked bar chart showing daily pass and fail counts. Each bar represents a single day, with green segments for passed runs and red segments for failed runs. A pass rate percentage is calculated for each day.
The trend data is fetched from the trends endpoint, which accepts an optional days query parameter (defaults to 30):
GET /api/projects/:projectId/analytics/trends?days=30
The response contains a dailyStats array sorted chronologically. Each entry includes:
{
"dailyStats": [
{
"date": "2026-01-21",
"totalRuns": 12,
"passed": 10,
"failed": 2,
"passRate": 83
},
{
"date": "2026-01-22",
"totalRuns": 8,
"passed": 8,
"failed": 0,
"passRate": 100
}
]
}
The chart groups runs by the date portion of their createdAt timestamp (the YYYY-MM-DD part). Days with no runs are omitted from the array. The pass rate per day is calculated as Math.round((passed / totalRuns) * 100).
Flaky Test Detection
The flaky tests section identifies tests with inconsistent results. A flaky test is one that alternates between passing and failing across recent runs, which makes it unreliable and difficult to trust.
Flakiness Algorithm
QA Studio calculates a flakiness score for each test using the following algorithm:
Fetch Recent Runs
The last 10 runs for each test are retrieved, ordered by most recent first. Tests with fewer than 2 runs are excluded from flaky analysis.
Count Status Alternations
The algorithm walks through the run history and counts every time the status changes from one run to the next. A pass-to-fail transition or a fail-to-pass transition each count as one alternation.
Calculate Score
The flakiness score is computed as:
flakinessScore = alternations / (recentRuns.length - 1)
The result is rounded to two decimal places. A score of 0 means the test is completely stable (all runs have the same status). A score of 1.0 means every consecutive run alternated status (maximum flakiness).
Here are some example scores to illustrate:
| Run History (newest first) | Alternations | Score | Interpretation |
|---|---|---|---|
| pass, pass, pass, pass, pass | 0 | 0.00 | Stable — consistently passing |
| fail, fail, fail, fail, fail | 0 | 0.00 | Stable — consistently failing |
| pass, pass, fail, fail, pass | 2 | 0.50 | Moderately flaky |
| pass, fail, pass, fail, pass | 4 | 1.00 | Highly flaky — alternating every run |
Flaky Test Display
The flaky tests list is sorted by flakiness score in descending order (most flaky first). Each entry shows:
- Test name — links to the test in the builder
- Flakiness score — the numerical score (0.00 to 1.00)
- Recent result dots — a row of colored circles representing the last 10 runs: green dots for passed runs and red dots for failed runs
{
"flakyTests": [
{
"testId": "abc123",
"testName": "Login Flow",
"flakinessScore": 0.67,
"recentResults": [
{ "status": "passed", "createdAt": "2026-02-20T10:00:00Z" },
{ "status": "failed", "createdAt": "2026-02-19T10:00:00Z" },
{ "status": "passed", "createdAt": "2026-02-18T10:00:00Z" },
{ "status": "passed", "createdAt": "2026-02-17T10:00:00Z" }
]
}
]
}
Regularly check the flaky tests section to identify unreliable tests. Flaky tests erode confidence in your test suite and should be investigated promptly. Common causes include timing-dependent assertions, external service dependencies, and non-deterministic page content.
Test Health Breakdown
The summary endpoint also returns a testStatusCounts object that categorizes every test in the project into one of three groups based on its most recent run:
| Category | Criteria | Description |
|---|---|---|
| Passing | Latest run status is passed |
Tests whose most recent execution succeeded. |
| Failing | Latest run status is failed |
Tests whose most recent execution failed. These need attention. |
| No Runs | No run records exist for the test | Tests that have been created but never executed. |
The breakdown is displayed visually on the dashboard, often as a pie chart or segmented bar, giving you a quick understanding of how many tests are healthy versus needing attention.
Accessing the Dashboard
To open the analytics dashboard:
Navigate to Your Project
From the home screen, click on the project you want to analyze. This takes you to the project's test list page.
Click Dashboard
On the project test list page, click the Dashboard link in the top navigation area. This opens the ProjectDashboardPage, which fetches and displays all analytics data.
Review the Data
The dashboard loads all three analytics endpoints (summary, trends, and flaky) in parallel. Data is displayed immediately as each request completes, thanks to independent TanStack Query hooks for each section.
API Endpoints
The analytics feature exposes three REST endpoints, all scoped to a specific project:
| Endpoint | Method | Description |
|---|---|---|
/api/projects/:projectId/analytics/summary |
GET | Returns total tests, total runs, pass rate, average duration, and test status counts. |
/api/projects/:projectId/analytics/trends |
GET | Returns daily pass/fail statistics. Accepts optional ?days=N query parameter (default: 30). |
/api/projects/:projectId/analytics/flaky |
GET | Returns all tests with flakiness scores, sorted by most flaky first. |