TestRelic

Package Overview

What @testrelic/playwright-analytics provides: the reporter, the enhanced test fixture, the API fixture, and the shard-merge utility.

@testrelic/playwright-analytics is the SDK package for Playwright browser test analytics. It plugs into Playwright's reporter pipeline and an enhanced test fixture to capture rich test data with zero changes to your test logic.

What does this package provide?

ExportImport pathWhat it does
Reporter class@testrelic/playwright-analyticsDrop-in Playwright reporter — add to the reporter array in playwright.config.ts
Enhanced fixture@testrelic/playwright-analytics/fixtureRe-exports test and expect with automatic navigation tracking
API fixture@testrelic/playwright-analytics/api-fixturetestRelicApiFixture for extending API-only test fixtures
Merge utility@testrelic/playwright-analytics/mergemergeReports() — combine shard reports into one file

How do I install it?

AI Prompt — Install and configure
Install @testrelic/playwright-analytics in this project and set it up:

1. Run: npm install --save-dev @testrelic/playwright-analytics
2. Add it to playwright.config.ts reporter array:
   ['@testrelic/playwright-analytics', {
     outputPath: './test-results/analytics-timeline.json',
     includeNetworkStats: true,
   }]
3. In test files, change the import from '@playwright/test' to
   '@testrelic/playwright-analytics/fixture'

Show me the updated config and one example test file.

Testing with Appium / mobile?

For the @testrelic/appium-analytics package, see the Appium Package Overview.

Next steps

Was this page helpful?

On this page