@testrelic/playwright-analytics 2.3.10 → 2.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +42 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -359,6 +359,23 @@ Each navigation in the timeline includes detailed network statistics:
359
359
 
360
360
  Disable with `includeNetworkStats: false`.
361
361
 
362
+ ## Viewing Reports
363
+
364
+ For **small test suites** (< 50 tests), the report is a self-contained HTML file — just open it in your browser.
365
+
366
+ For **large test suites** (50+ tests), TestRelic uses streaming mode to avoid memory issues. Test details are stored as separate files and loaded on demand via a local server. After tests complete, the terminal shows:
367
+
368
+ ```
369
+ [testrelic] View report: npx testrelic serve ./test-results/.testrelic-report
370
+ ```
371
+
372
+ Run that command and open `http://127.0.0.1:9323` in your browser. The server auto-starts after test runs when not in CI, but if you need to restart it later:
373
+
374
+ ```bash
375
+ npx testrelic serve ./test-results/.testrelic-report
376
+ npx testrelic serve ./test-results/.testrelic-report --port 9400 # custom port
377
+ ```
378
+
362
379
  ## Merging Shard Reports
363
380
 
364
381
  When running Playwright with sharding, each shard produces its own report. Merge them with the CLI:
@@ -415,6 +432,31 @@ test('CRUD operations', { tag: ['@api'] }, async ({ request }) => {
415
432
  });
416
433
  ```
417
434
 
435
+ ### Custom Page Fixtures (authenticated pages, etc.)
436
+
437
+ If your tests create pages manually via `browser.newContext()` / `context.newPage()` (e.g., for auth with `storageState`), the built-in `page` fixture is bypassed and **no network/console/navigation data is captured**. Use `trackPage()` to enable tracking on any manually-created page:
438
+
439
+ ```typescript
440
+ import { test as base, expect, trackPage } from '@testrelic/playwright-analytics/fixture';
441
+
442
+ type MyFixtures = {
443
+ authenticatedPage: Page;
444
+ };
445
+
446
+ export const test = base.extend<MyFixtures>({
447
+ authenticatedPage: async ({ browser }, use, testInfo) => {
448
+ const ctx = await browser.newContext({ storageState: 'auth.json' });
449
+ const page = await ctx.newPage();
450
+ const cleanup = await trackPage(page, testInfo); // ← enables tracking
451
+ await use(page);
452
+ await cleanup(); // ← flushes data to report
453
+ await ctx.close();
454
+ },
455
+ });
456
+ ```
457
+
458
+ > **Important:** Without `trackPage()`, custom page fixtures will only show screenshots, videos, and action steps — but no network requests, console logs, or navigation timeline.
459
+
418
460
  ### Unified Testing (Browser + API)
419
461
 
420
462
  Use the unified fixture which provides **both** `page` and `request` — the TestRelic report shows navigation timeline AND API call details for the same test. This is ideal for:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testrelic/playwright-analytics",
3
- "version": "2.3.10",
3
+ "version": "2.3.11",
4
4
  "description": "Playwright test analytics reporter with E2E navigation tracking, API call capture, network stats, failure diagnostics, and interactive HTML reports",
5
5
  "keywords": [
6
6
  "playwright",
@@ -81,7 +81,7 @@
81
81
  "@playwright/test": ">=1.35.0"
82
82
  },
83
83
  "dependencies": {
84
- "@testrelic/core": "2.3.10"
84
+ "@testrelic/core": "2.3.11"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@playwright/test": "^1.35.0",