reporting-labs 0.4.1 → 0.4.3
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/README.md +50 -2
- package/bin/config-template.txt +14 -2
- package/dist/template.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,17 @@ Done. Everything below is optional.
|
|
|
53
53
|
|
|
54
54
|
> **In a hurry?** Skip the config file and pass options inline: `reporter: [['reporting-labs', { title: 'My app' }]]`.
|
|
55
55
|
|
|
56
|
+
## See everything the report can do
|
|
57
|
+
|
|
58
|
+
Every card and tab is switched on. What you see depends on what your tests give it:
|
|
59
|
+
|
|
60
|
+
1. **Add `meta()` to your tests** and the report ranks failures by priority, groups them by owner and feature, and links to your stories. See [the helpers](#add-details-to-your-tests-3-small-helpers).
|
|
61
|
+
2. **Run the suite twice** and the Trend chart, "new vs known" failures, flaky dots and "Got slower" appear. History is kept in `reporting-labs.history.json`.
|
|
62
|
+
3. **Turn on Playwright's `screenshot`, `video` and `trace`** in `playwright.config.ts` and they show up on every failed test.
|
|
63
|
+
4. **Have more than one Playwright project** (say chromium and webkit) and you get a feature × project heatmap.
|
|
64
|
+
|
|
65
|
+
The report tells you about these itself: a card that has nothing to show yet explains what to do.
|
|
66
|
+
|
|
56
67
|
## Add details to your tests (3 small helpers)
|
|
57
68
|
|
|
58
69
|
The report already shows steps, screenshots, videos, traces and errors on its own. Three small helpers add the rest. Import them from `reporting-labs` and call them inside a test.
|
|
@@ -73,6 +84,7 @@ One line per test. With this the report can rank failures by priority, group the
|
|
|
73
84
|
- Known keys: `priority`, `severity`, `owner`, `feature`, `epic`, `story`, `issue`, `component`, `team`. Any other key you pass is shown too.
|
|
74
85
|
- Your Playwright tags like `@sanity` or `@regression` stay as they are and still show on the test.
|
|
75
86
|
- To make story and epic keys clickable, set `links` in the config: `links: { story: 'https://yourteam.atlassian.net/browse/{id}' }`.
|
|
87
|
+
- `priority`, `severity`, `feature` and `owner` each get a tab in the Breakdown chart and a filter on the Tests page. Want the same for your own key, say `meta({ team: 'web' })`? Add it to `dimensions` in the config: `dimensions: ['priority', 'severity', 'feature', 'owner', 'team']`.
|
|
76
88
|
|
|
77
89
|
### `log()`: a line in the report
|
|
78
90
|
|
|
@@ -219,6 +231,42 @@ Every outcome Playwright can produce, not just pass and fail:
|
|
|
219
231
|
- interrupted runs show a banner with how many tests did not finish
|
|
220
232
|
- the Environment card shows Playwright and Node versions, OS, browsers, workers, shard, the CI job link and the git commit
|
|
221
233
|
|
|
234
|
+
## How it compares
|
|
235
|
+
|
|
236
|
+
Legend: ✅ built in · 🟡 possible with manual setup or extra config · ❌ not in the official docs
|
|
237
|
+
|
|
238
|
+
| Feature | Playwright HTML | Allure | reportingLabs |
|
|
239
|
+
|---|:---:|:---:|:---:|
|
|
240
|
+
| Single HTML file, opens without a server | ❌ folder, served by `show-report` | 🟡 single-file mode (2.24+, Allure 3 plugin), otherwise `allure open` | ✅ |
|
|
241
|
+
| No extra tooling | ✅ | ❌ CLI needed; Allure 2 needs Java | ✅ npm package only |
|
|
242
|
+
| Setup | ✅ built in | 🟡 reporter + generate step | ✅ one line in `reporter:` |
|
|
243
|
+
| Steps, screenshots, videos, traces | ✅ | ✅ | ✅ |
|
|
244
|
+
| Visual comparison viewer (slider, side by side, diff) | ❌ | ❌ | ✅ |
|
|
245
|
+
| Tags and annotations shown | ✅ | ✅ labels via runtime API | ✅ `meta()` + tags |
|
|
246
|
+
| Priority / severity / owner / feature / epic / story | 🟡 custom annotations | ✅ labels | ✅ |
|
|
247
|
+
| Links to Jira, TMS | 🟡 annotation with a URL | ✅ `issue()`, `tms()` | ✅ `links` templates |
|
|
248
|
+
| Failures ranked by priority and severity | ❌ | ❌ | ✅ Needs attention |
|
|
249
|
+
| Failures by owner | ❌ | 🟡 owner label, no rollup documented | ✅ |
|
|
250
|
+
| History across runs | ❌ | 🟡 History Trend when historical data is accumulated | ✅ history file, zero setup |
|
|
251
|
+
| New vs known failures ("failing since #1840") | ❌ | ❌ | ✅ |
|
|
252
|
+
| Flaky detection | ✅ `flaky` outcome per run | 🟡 `@Flaky` annotation (Java) | ✅ outcome + flakiest over last runs |
|
|
253
|
+
| Got slower vs last run | ❌ | ❌ | ✅ |
|
|
254
|
+
| Trend chart | ❌ | ✅ | ✅ |
|
|
255
|
+
| Failures grouped by root cause | ❌ | 🟡 `categories.json` with regex | ✅ automatic clusters |
|
|
256
|
+
| Failures explained in plain words | ❌ | ❌ | ✅ 18 kinds |
|
|
257
|
+
| Bug report in one click | ❌ | ❌ | ✅ Markdown, Jira, text |
|
|
258
|
+
| Environment info | ❌ | 🟡 `environment.properties` | ✅ automatic + `env` option |
|
|
259
|
+
| API calls with request/response | ❌ | 🟡 manual attachments | ✅ automatic, Copy as cURL |
|
|
260
|
+
| Logs and test data blocks | 🟡 attachments | 🟡 attachments, parameters | ✅ `log()`, `testData()` |
|
|
261
|
+
| Secrets masked | ❌ | 🟡 parameter masking | ✅ automatic |
|
|
262
|
+
| CSV / JSON export of failures, Slack summary | ❌ | ❌ | ✅ |
|
|
263
|
+
| Timeline by worker | ❌ | ✅ | ✅ |
|
|
264
|
+
| Combine shards / several runs | ✅ blob + `merge-reports` | ✅ Launches | ❌ on the roadmap |
|
|
265
|
+
| Frameworks beyond Playwright | ❌ | ✅ many languages | ❌ on the roadmap |
|
|
266
|
+
| Free and open source | ✅ | ✅ (Allure TestOps is a separate paid product) | ✅ MIT |
|
|
267
|
+
|
|
268
|
+
Based on the official docs as of September 2026. ❌ means the feature is not described in the tool's documentation, not that it is impossible. Sources: Playwright [reporters](https://github.com/microsoft/playwright/blob/main/docs/src/test-reporters-js.md), [annotations](https://github.com/microsoft/playwright/blob/main/docs/src/test-annotations-js.md), [retries](https://github.com/microsoft/playwright/blob/main/docs/src/test-retries-js.md), [sharding](https://github.com/microsoft/playwright/blob/main/docs/src/test-sharding-js.md), [trace viewer](https://github.com/microsoft/playwright/blob/main/docs/src/trace-viewer-intro-js.md); Allure [allure-playwright](https://github.com/allure-framework/allure-js/blob/main/packages/allure-playwright/README.md), [Allure 3](https://github.com/allure-framework/allure3), [Allure 2.24.0 release](https://github.com/allure-framework/allure2/releases/tag/2.24.0), [Allure docs: command line](https://github.com/allure-framework/allure-docs/blob/main/content/reporting/commandline.md), [features](https://github.com/allure-framework/allure-docs/blob/main/content/gettingstarted/features.md), [report structure](https://github.com/allure-framework/allure-docs/blob/main/content/gettingstarted/report-structure.md). If something here is out of date, open an issue and it will be fixed.
|
|
269
|
+
|
|
222
270
|
## All options
|
|
223
271
|
|
|
224
272
|
Every option is optional. `npx reporting-labs init` writes them all, with comments, into `reporting-labs.config.ts` (`--js` for JavaScript, `--force` to overwrite).
|
|
@@ -232,8 +280,8 @@ Every option is optional. `npx reporting-labs init` writes them all, with commen
|
|
|
232
280
|
| `env` | – | Extra rows on the Environment card |
|
|
233
281
|
| `links` | `{}` | Turn meta keys into links. `{id}` is replaced by the value |
|
|
234
282
|
| `maskKeys` | `[]` | Extra keys to mask as `****` |
|
|
235
|
-
| `dimensions` | `['priority','severity','feature','owner']` |
|
|
236
|
-
| `dimensionOrder` | P0…P4, blocker…trivial |
|
|
283
|
+
| `dimensions` | `['priority','severity','feature','owner']` | Which `meta()` keys get a tab in the Breakdown chart and a dropdown filter on the Tests page. Add your own key, e.g. `'team'`, to get a chart for it |
|
|
284
|
+
| `dimensionOrder` | P0…P4, blocker…trivial | The order values appear in those charts and filters. Only needed for your own values, e.g. `{ severity: ['high','medium','low'] }` |
|
|
237
285
|
| `widgets` | all on | Hide cards: `{ tags: false, timeline: false, ... }`. Failure clusters and the Trend chart are always shown |
|
|
238
286
|
| `sections` | `[]` | Extra HTML below the summary, e.g. release notes |
|
|
239
287
|
| `history` | `{ enabled: true, keep: 30 }` | Run history file; `file` sets a custom path |
|
package/bin/config-template.txt
CHANGED
|
@@ -3,6 +3,9 @@ import type { ReportingLabsOptions } from 'reporting-labs';
|
|
|
3
3
|
|
|
4
4
|
// reportingLabs configuration.
|
|
5
5
|
// Every option is optional. Lines that start with // show the default; uncomment and change what you need.
|
|
6
|
+
// All cards and tabs are on by default. What the report shows depends on your tests: add meta() for
|
|
7
|
+
// priorities and owners, run the suite twice for trends and flaky detection, and keep Playwright's
|
|
8
|
+
// screenshot / video / trace settings on. A card with nothing to show yet tells you what to do.
|
|
6
9
|
// Docs: https://github.com/naveenautomationlabs/reporting-labs#options
|
|
7
10
|
|
|
8
11
|
const config: ReportingLabsOptions = {
|
|
@@ -35,8 +38,17 @@ const config: ReportingLabsOptions = {
|
|
|
35
38
|
|
|
36
39
|
// ── Test details ─────────────────────────────────────────────────────────────
|
|
37
40
|
// Values come from meta({ priority, severity, owner, feature, epic, story, ... }) in your tests.
|
|
38
|
-
//
|
|
39
|
-
//
|
|
41
|
+
//
|
|
42
|
+
// dimensions: which meta keys get their own tab in the Breakdown chart and a dropdown filter on the
|
|
43
|
+
// Tests page. Default: priority, severity, feature, owner. Add your own key when you want a chart
|
|
44
|
+
// for it, e.g. meta({ team: 'web' }) + 'team' here = a "Team" tab showing pass/fail per team.
|
|
45
|
+
// Keys like epic and story do not need to be here: they show as chips and links on every test anyway.
|
|
46
|
+
// dimensions: ['priority', 'severity', 'feature', 'owner', 'team'],
|
|
47
|
+
//
|
|
48
|
+
// dimensionOrder: the order values appear in those charts and filters. Priority (P0..P4) and
|
|
49
|
+
// severity (blocker..trivial) are already ordered. Set this only for your own values,
|
|
50
|
+
// e.g. { severity: ['high', 'medium', 'low'] } or { team: ['web', 'api', 'mobile'] }.
|
|
51
|
+
// dimensionOrder: { severity: ['high', 'medium', 'low'] },
|
|
40
52
|
// links: { // turn meta keys into links; {id} is the value
|
|
41
53
|
// story: 'https://acme.atlassian.net/browse/{id}',
|
|
42
54
|
// epic: 'https://acme.atlassian.net/browse/{id}',
|
package/dist/template.js
CHANGED
|
@@ -268,6 +268,7 @@ a{color:var(--accent)}
|
|
|
268
268
|
.item .tt .n{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
269
269
|
.item .d{font:11px var(--mono);color:var(--ink-3);margin-top:3px}
|
|
270
270
|
.empty{padding:40px 20px;text-align:center;color:var(--ink-3)}
|
|
271
|
+
.nudge{font-size:var(--fs-s);color:var(--ink-2);background:var(--surface-2);border:1px dashed var(--line);border-radius:var(--radius);padding:10px 12px;margin-bottom:10px;line-height:1.5} .nudge code{font-family:var(--mono);font-size:12px} .nudge b{color:var(--ink)}
|
|
271
272
|
|
|
272
273
|
/* ---------- detail ---------- */
|
|
273
274
|
.detail{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px;min-width:0}
|
|
@@ -872,6 +873,7 @@ function summary(){
|
|
|
872
873
|
if(W.skipped!==false) { const sc=skippedCard(); if(sc) g.push(sc); }
|
|
873
874
|
if(W.environment!==false) { const ec=envCard(); if(ec) g.push(ec); }
|
|
874
875
|
if(data.history.length>1) g.push(h('div',{class:'card w12'}, h('h2',{},'Trend', h('span',{class:'hint'},'last '+data.history.length+' runs')), trend()));
|
|
876
|
+
else if(data.history.length===1) g.push(h('div',{class:'card w12'}, h('h2',{},'Trend', h('span',{class:'hint'},'from the second run')), h('div',{class:'nudge'}, h('b',{},'First run recorded.'),' Run the suite once more and this card shows the pass-rate trend, and every failure gets "new this run" or "failing since #…", last-10-runs dots, a Flakiest tests card and a Got slower tab. History lives in ',h('code',{},data.historyFile||'reporting-labs.history.json'),', commit it or cache it in CI.')));
|
|
875
877
|
const ge=data.globalErrors||[], go=data.globalOutput||[];
|
|
876
878
|
if(ge.length||go.some(x=>x.stream==='err')) g.unshift(h('div',{class:'card w12 fail-rail'}, h('h2',{}, ge.length? ge.length+' error'+(ge.length>1?'s':'')+' outside tests' : 'Output outside tests', h('span',{class:'hint'},'spec files that failed to load, global setup, worker crashes')),
|
|
877
879
|
...ge.map(errorView), go.length? h('details',{class:'errfull'}, h('summary',{},'Console output outside tests ('+go.length+' chunks)'), h('pre',{class:'txt'}, go.map(x=>(x.stream==='err'?'[stderr] ':'')+x.text).join(''))) : null));
|
|
@@ -1137,10 +1139,11 @@ function breakdown(){
|
|
|
1137
1139
|
if(data.options.widgets.tags&&data.tests.some(t=>t.tags.length)) tabs.push(['tags','Tags',tagsChart]);
|
|
1138
1140
|
if(data.projects.length>1&&DIMS.length) tabs.push(['heat','Heatmap',heatmap]);
|
|
1139
1141
|
if(!tabs.length) return h('div',{class:'empty'},'Add meta({ priority, severity, owner, feature }) to your tests to see breakdowns here.');
|
|
1142
|
+
const nudge=!DIMS.length? h('div',{class:'nudge'}, h('b',{},'Tip:'),' add ',h('code',{},"meta({ priority: 'P1', severity: 'major', owner: 'priya', feature: 'checkout' })"),' at the top of a test and this card gains Priority, Severity, Feature and Owner tabs, the failures get ranked, and owners get their own rollup.') : null;
|
|
1140
1143
|
let cur=tabs[0][0]; const bar=h('div',{class:'bk-tabs'}), body=h('div',{});
|
|
1141
1144
|
const render=()=>{ body.innerHTML=''; body.append(tabs.find(t=>t[0]===cur)[2]()); bar.querySelectorAll('button').forEach(b=>b.setAttribute('aria-selected',b.dataset.k===cur)); };
|
|
1142
1145
|
for(const [k,l] of tabs) bar.append(h('button',{'data-k':k,onclick:()=>{cur=k;render();}},l));
|
|
1143
|
-
render(); return h('div',{}, bar, body);
|
|
1146
|
+
render(); return h('div',{}, nudge, bar, body);
|
|
1144
1147
|
}
|
|
1145
1148
|
function errorSignature(msg){
|
|
1146
1149
|
return (msg||'').split('\n')[0].replace(/\d+(\.\d+)?(ms|s)\b/g,'N').replace(/\b\d{2,}\b/g,'N').replace(/["'][^"']{0,60}["']/g,'"…"').replace(/\s+/g,' ').trim().slice(0,160);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reporting-labs",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "reportingLabs – beautiful, customizable single-file HTML test reports. One line of config. Playwright adapter included, more runners on the way.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"test-report",
|