@andrii_kremlovskyi/playwright-traces-reader 1.3.0 → 1.3.1
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.
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ Use this skill when the user asks about test failures, API payloads in tests, sl
|
|
|
9
9
|
|
|
10
10
|
## Prerequisites
|
|
11
11
|
|
|
12
|
-
This skill requires the `@
|
|
12
|
+
This skill requires the `@andrii_kremlovskyi/playwright-traces-reader` npm package in the project:
|
|
13
13
|
```bash
|
|
14
14
|
npm install @andrii_kremlovskyi/playwright-traces-reader
|
|
15
15
|
```
|
|
@@ -315,7 +315,7 @@ console.log(`[${summary.status.toUpperCase()}] ${summary.testTitle ?? summary.ti
|
|
|
315
315
|
Takes a single path (directory or `.zip`) and returns a `TraceContext`. Use this when you have a specific trace path rather than a whole `data/` directory.
|
|
316
316
|
|
|
317
317
|
```typescript
|
|
318
|
-
import { prepareTraceDir } from '@
|
|
318
|
+
import { prepareTraceDir } from '@andrii_kremlovskyi/playwright-traces-reader';
|
|
319
319
|
|
|
320
320
|
const ctx = await prepareTraceDir('/path/to/playwright-report/data/<sha1>');
|
|
321
321
|
// or a zip:
|
|
@@ -383,7 +383,7 @@ Using a fixed, recognisable filename makes it easy to spot and clean up if the a
|
|
|
383
383
|
|
|
384
384
|
- **Starting point for report-level failures**: Use `getFailedTestSummaries(dataDir)` — returns `TraceSummary[]` for every unique failing test with retries deduplicated (by `testId` from `report.json`) and passing tests excluded. Each result has an `outcome` field (`'unexpected'`, `'flaky'`, `'skipped'`, or `null`). Pass `{ excludeSkipped: true }` to exclude skipped tests.
|
|
385
385
|
- **Starting point for per-context analysis**: Use `getSummary(ctx, { reportMetadata: meta })` on a specific `TraceContext` from `listTraces()` — it gives `testTitle`, status, error, slowest steps, API calls, and the DOM snapshot closest to the failure in one call. Pass `reportMetadata: null` if `index.html` is unavailable.
|
|
386
|
-
- **Accurate failure count**: `getFailedTestSummaries()` deduplicates by `testId` from `report.json` (falls back to `testTitle` then `traceDir`)
|
|
386
|
+
- **Accurate failure count**: `getFailedTestSummaries()` deduplicates by `testId` from `report.json` (falls back to `testTitle` then `traceDir`).
|
|
387
387
|
- **Drill into failures**: Each `TestStep` in `topLevelSteps` includes `.children`. Walk them recursively to find the specific assertion or action that failed within the test.
|
|
388
388
|
- **Failures**: The `error.message` in a `TraceSummary` contains the full diff for assertion failures.
|
|
389
389
|
- **Network issues**: `summary.networkCalls` contains all HTTP calls (API and browser). Filter by `source === 'api'` for Node.js `APIRequestContext` calls or `source === 'browser'` for XHR/fetch/navigation. Check `status >= 400` for HTTP errors.
|