@reportforge/playwright-pdf 0.6.2 → 0.7.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
+ ## [0.6.3] — 2026-06-27
7
+
8
+ ### Fixed
9
+
10
+ - **Demo command now resolves under `npx`** — the documented `npx @reportforge/playwright-pdf reportforge-demo` could never run: with two package bins and neither matching the package's unscoped name (`playwright-pdf`), npx aborted with `could not determine executable to run`. The package now ships a single dispatcher bin named `playwright-pdf`, so `npx @reportforge/playwright-pdf <command>` resolves correctly.
11
+
12
+ ### Changed
13
+
14
+ - **CLI is now subcommand-based.** The `reportforge-demo` and `reportforge-export-feedback` bins are consolidated into one `playwright-pdf` bin with subcommands:
15
+ - `npx @reportforge/playwright-pdf demo [--template=minimal|detailed|executive] [--output=<path>]`
16
+ - `npx @reportforge/playwright-pdf export-feedback`
17
+ - This is breaking **only** if you relied on the old `reportforge-demo` / `reportforge-export-feedback` names on your `PATH` after a global install; the `npx` invocations gain capability and lose none.
18
+
19
+ ---
20
+
6
21
  ## [0.6.2] — 2026-06-23
7
22
 
8
23
  ### Fixed
package/README.md CHANGED
@@ -46,18 +46,18 @@ Three templates, one reporter. Every PDF is fully offline — fonts, charts, and
46
46
  ## Features
47
47
 
48
48
  - **3 templates** — `minimal` (developer), `detailed` (QA team), `executive` (stakeholders)
49
- - **Detailed reports** — KPI dashboard, suite breakdown, failure deep-dive with screenshots, CI/CD environment
49
+ - **Detailed reports** — KPI dashboard, suite breakdown with inline failure detail (error, screenshot, root-cause chip) under each failed test, CI/CD environment
50
50
  - **Embedded Chart.js** — pass-rate doughnut + per-suite bar chart, bundled inline (no CDN)
51
51
  - **Self-contained PDFs** — screenshots, fonts, logos all embedded; share or archive with confidence
52
52
  - **Custom branding** — logo, primary/accent colours, watermark, PDF password encryption
53
53
  - **Dynamic filenames** — `{date}`, `{branch}`, `{status}` tokens in the output path
54
- - **Instant demo report** — `npx @reportforge/playwright-pdf reportforge-demo` generates a realistic sample PDF before subscribing — no license key required
54
+ - **Instant demo report** — `npx @reportforge/playwright-pdf demo` generates a realistic sample PDF before subscribing — no license key required
55
55
  - **CI/CD snippets** — GitHub Actions, GitLab CI, Bitbucket Pipelines, Jenkins, Azure DevOps
56
56
  - **Shard merging** — combine N Playwright JSON shard reports into one PDF via `shardResults`; accepts glob patterns or explicit paths
57
57
  - **Notifications** — post pass/fail summaries to Slack, Teams, Discord, or email after each run; configurable trigger (`always` / `failure` / `success`) per channel; email supports optional PDF attachment via `attachPdf`
58
58
  - **Flakiness trend** — top-N flakiest tests table with per-test dot sparkline across stored history runs in the `detailed` template; `flakinessTopN` option (default 5, `0` disables)
59
- - **Offline failure analysis** — sorts failures into 7 root-cause buckets and clusters them, right inside the `detailed` PDF (one-liner in `executive`). No network, no AI service — a small embedded classifier that updates itself safely over your existing license refresh; pin it any time. Full details at [reportforge.org/docs/advanced/failure-analysis](https://reportforge.org/docs/advanced/failure-analysis).
60
- - `reportforge-export-feedback` — exports locally-collected unrecognized failures (tokenized, local-only) for optional manual sharing.
59
+ - **Offline failure analysis** — sorts each failure into one of 7 root-cause buckets and renders a per-test root-cause chip inline under the failed test in the `detailed` PDF (dominant-cause one-liner in `executive`). No network, no AI service — a small embedded classifier that updates itself safely over your existing license refresh; pin it any time. Full details at [reportforge.org/docs/advanced/failure-analysis](https://reportforge.org/docs/advanced/failure-analysis).
60
+ - `npx @reportforge/playwright-pdf export-feedback` — exports locally-collected unrecognized failures (tokenized, local-only) for optional manual sharing.
61
61
  - **Configurable sections** — add or remove any report section per template via `sections`.
62
62
  - **Hybrid licensing** — one short key unlocks it; reports keep rendering offline via a cached JWT between refreshes
63
63
 
@@ -92,7 +92,7 @@ npx playwright test
92
92
  # → reports/2026-05-01-main-failed.pdf
93
93
  ```
94
94
 
95
- > **See it first.** Run `npx @reportforge/playwright-pdf reportforge-demo` to generate a realistic sample PDF in under 60 seconds — no license key required. Supports `--template=minimal|detailed|executive` and `--output=<path>`.
95
+ > **See it first.** Run `npx @reportforge/playwright-pdf demo` to generate a realistic sample PDF in under 60 seconds — no license key required. Supports `--template=minimal|detailed|executive` and `--output=<path>`.
96
96
 
97
97
  > **License required.** Start a **[7-day free trial at reportforge.org/pricing](https://reportforge.org/pricing)** — card required, no charge until day 8. Paste the resulting `RFSU-…` key into `RF_LICENSE_KEY`. Without a valid license the reporter logs a warning and skips PDF generation; your Playwright tests still run normally.
98
98
 
@@ -198,6 +198,7 @@ All options are the second element of the reporter tuple.
198
198
  | `historySize` | `number` | `10` | Maximum number of test runs to keep in the history file (integer ≥ 2). Older runs are pruned on append. |
199
199
  | `showTrend` | `boolean` | `true` | Show the pass-rate sparkline and delta badge in the `detailed` template. Set to `false` to disable history tracking entirely. |
200
200
  | `flakinessTopN` | `number` | `5` | Maximum flaky tests to show in the flakiness table (`detailed` template). Set to `0` to disable the table entirely. |
201
+ | `slowTestThreshold` | `number` | `10` | Minimum timed-test count before `SLOW` badges appear in the suite breakdown. The badge marks the 10 slowest tests; below this many it stays hidden (every test would be trivially "slowest"). Set to `0` to always badge the slowest. |
201
202
  | `templatePath` | `string \| string[]` | — | Path to a custom Handlebars (`.hbs`) template file. Takes precedence over `template`. Pass an array to generate one PDF per custom template. See the Custom Templates docs. |
202
203
  | `sections` | `object` | per-template | Override which report sections appear, on top of the chosen template's defaults. Flat keys are the baseline for every chosen template; per-template keys (`minimal`\|`detailed`\|`executive`) override per template. Block toggles: `coverPage`, `analysisOneliner`, `releaseGate`, `summary`, `charts`, `trend`, `requirementsMatrix`, `ciEnvironment`, `suiteBreakdown`, `failureDeepDive`, `failureAnalysis`, `slowTests`, `defectLog`. Display modifiers: `passRate`, `fullEnvironment`, `retries`, `fullFailures`, `stackTraces`. See the Report Sections docs. |
203
204
  <!-- AUTOGEN:options-table END -->
@@ -391,10 +392,10 @@ reporter: [['@reportforge/playwright-pdf', {
391
392
  | `trend` | Pass-rate trend line, run-history table, and flakiness table (rendered inside `charts`) |
392
393
  | `requirementsMatrix` | Tests grouped by `@tag('REQ-…')` with coverage bars (requirements traceability) |
393
394
  | `ciEnvironment` | Branch, commit, browsers, CI provider, OS, Node, Playwright, projects, workers |
394
- | `suiteBreakdown` | Per-suite → per-test table (status, duration, tags, retries) |
395
- | `failureDeepDive` | Failure cards: error message, stack trace, screenshot, retry history |
396
- | `failureAnalysis` | Clustered root-cause buckets from the offline classifier |
397
- | `slowTests` | Slowest tests, duration-ranked |
395
+ | `suiteBreakdown` | Per-suite → per-test table (status, duration, tags, retries). Failed tests carry their failure detail, root-cause chip, and a `SLOW` badge inline (the three keys below) |
396
+ | `failureDeepDive` | Inline failure detail under each failed test in the breakdown: error message, stack trace, screenshot, retry history |
397
+ | `failureAnalysis` | Inline per-test root-cause chip under each failed test (category + representative error + match strength, from the offline classifier) |
398
+ | `slowTests` | `SLOW` badge on the duration-ranked slowest tests, shown inline in the breakdown |
398
399
  | `defectLog` | `DEF-####` numbered failure table (severity, retries) |
399
400
 
400
401
  #### Display modifiers — tune a section that's on
@@ -404,8 +405,8 @@ reporter: [['@reportforge/playwright-pdf', {
404
405
  | `passRate` | Show the pass-rate % on the Passed KPI card (`summary`) |
405
406
  | `fullEnvironment` | Full environment table instead of the compact grid (`ciEnvironment`) |
406
407
  | `retries` | Retries column in the suite breakdown (`suiteBreakdown`) |
407
- | `fullFailures` | Full failure cards instead of one-line summaries (`failureDeepDive`) |
408
- | `stackTraces` | Include `<pre>` stack traces in the failure cards (`failureDeepDive`) |
408
+ | `fullFailures` | Include the screenshot in the inline failure detail (compact templates omit it) (`failureDeepDive`) |
409
+ | `stackTraces` | Include `<pre>` stack traces in the inline failure detail (`failureDeepDive`) |
409
410
 
410
411
  #### Per-template defaults
411
412
 
@@ -421,7 +422,7 @@ Omit `sections` entirely and each template renders exactly this (✓ = on):
421
422
  | `trend` | – | ✓ | ✓ |
422
423
  | `requirementsMatrix` | – | ✓ | – |
423
424
  | `ciEnvironment` | ✓ | ✓ | ✓ |
424
- | `suiteBreakdown` | ✓ | ✓ | |
425
+ | `suiteBreakdown` | ✓ | ✓ | |
425
426
  | `failureDeepDive` | ✓ | ✓ | ✓ |
426
427
  | `failureAnalysis` | – | ✓ | – |
427
428
  | `slowTests` | – | ✓ | ✓ |
@@ -435,7 +436,8 @@ Omit `sections` entirely and each template renders exactly this (✓ = on):
435
436
  #### Dependencies & gotchas
436
437
 
437
438
  - **`trend` needs `charts`.** The trend line, run-history, and flakiness table live inside the charts block, so `trend: true` does nothing with `charts: false` (it's coerced off). It also needs history data — keep the top-level `showTrend` option on.
438
- - **Data-gated sections** `failureAnalysis`, `requirementsMatrix`, `slowTests`, `defectLog` render only when there's matching data (clusters, tagged tests, timed tests, failures). Toggling them on with no data shows nothing.
439
+ - **Inline failure detail needs `suiteBreakdown`.** `failureDeepDive` (failure detail), `failureAnalysis` (root-cause chip), and `slowTests` (`SLOW` badge) now render *inside* the suite breakdown, so they show nothing when `suiteBreakdown` is off. The chip (`failureAnalysis`) also needs `failureDeepDive` it lives inside the failure detail, so it's coerced off without it.
440
+ - **Data-gated sections** — `failureAnalysis`, `requirementsMatrix`, `slowTests`, `defectLog` render only when there's matching data (classified failures, tagged tests, a meaningful slow set, failures). Toggling them on with no data shows nothing.
439
441
  - **Render-layer only.** `sections` controls what's drawn, never what's collected — the data switches stay separate: `showTrend` (history), `flakinessTopN` (flaky-table size), `failureAnalysis.enabled` (classifier), `includeScreenshots` (images).
440
442
  - **Custom templates.** `sections` applies to the built-in templates; a custom `templatePath` controls its own layout (every section available) and ignores `sections` — you'll get a warning if both are set.
441
443