Skip to main content

Welcome to TestRelic Documentation

· 3 min read
TestRelic Team
TestRelic Maintainers

Welcome to the official TestRelic documentation! We're excited to help you get started with comprehensive test analytics for your Playwright test suites.

What is TestRelic?

TestRelic is a test analytics toolkit designed specifically for Playwright that generates structured JSON reports from your test runs. Unlike traditional test reporters that only show pass/fail results, TestRelic captures a rich timeline of your test execution including:

  • Every page navigation during your tests
  • Network request statistics for each page
  • Detailed failure diagnostics with code snippets
  • CI/CD integration metadata
  • And much more!

Why TestRelic?

Modern web applications are complex, and understanding test failures often requires more context than just an error message. TestRelic provides that context by:

  1. Navigation Timeline — See exactly which pages your tests visited and in what order
  2. Network Insights — Understand how much data was transferred and which requests failed
  3. Failure Context — Get code snippets showing exactly where tests failed
  4. CI Integration — Automatically capture CI metadata for correlation with builds

Key Features

Automatic Navigation Tracking

Simply use our custom fixture in your tests, and TestRelic automatically tracks all navigations:

import { test, expect } from '@testrelic/playwright-analytics/fixture';

test('user journey', async ({ page }) => {
await page.goto('https://example.com');
await page.click('a[href="/products"]');
await page.click('.product:first-child');
// All navigations tracked automatically!
});

Network Statistics

For each navigation, TestRelic captures:

  • Total requests and failed requests
  • Bytes transferred
  • Breakdown by resource type (scripts, images, stylesheets, fonts, XHR)

This helps identify performance bottlenecks and understand test behavior.

Failure Diagnostics

When tests fail, TestRelic includes:

  • Error message and type
  • Source code snippet showing the failure line
  • Optional full stack trace
  • File path and line number

CI/CD Ready

TestRelic automatically detects your CI environment and captures:

  • Build ID and run number
  • Commit SHA and branch name
  • CI provider information
  • Custom metadata you define

Supports GitHub Actions, GitLab CI, Jenkins, CircleCI, and more.

Getting Started

Ready to add TestRelic to your project? It only takes a few minutes:

  1. Install the package:

    npm install @testrelic/playwright-analytics
  2. Configure the reporter in playwright.config.ts:

    reporter: [
    ['@testrelic/playwright-analytics', {
    outputPath: './test-results/analytics-timeline.json'
    }]
    ]
  3. Use the fixture in your tests:

    import { test, expect } from '@testrelic/playwright-analytics/fixture';
  4. Run your tests and view the JSON report!

Check out the Installation Guide for detailed instructions.

What's in the Documentation?

Our documentation covers everything you need:

  • Getting Started — Quick installation and setup guide
  • Package — Detailed information about the TestRelic package
  • Configuration — All available options and how to use them
  • Advanced — Merging shard reports and advanced use cases
  • Examples — Real-world examples against popular websites

Real-World Examples

We've created example projects that demonstrate TestRelic against real websites:

  • Wikipedia — Multi-page navigation, search, and media-heavy pages
  • Flipkart — E-commerce flows with product search and details
  • Google — Simple search queries and results navigation

Each example is a complete Playwright project you can run and learn from. Check out the Examples page for more details.

Free to Use

TestRelic is free to use and published under the MIT license. Get started today and enhance your Playwright test analytics!

What's Next?

We're excited to see what you build with TestRelic! If you have questions, feedback, or ideas, please reach out on GitHub.

Happy testing! 🎉