@orieken/saturday-reporting 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2026 Saturday reporting contributors
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ Saturday reporting packages
2
+ Copyright 2026 Saturday reporting contributors
3
+
4
+ Gallery presentation adapted from the testing-with-certs matrix gallery.
5
+ Playwright and Cucumber are separate projects with their own licenses.
package/README.md CHANGED
@@ -1,3 +1,41 @@
1
- # Temporary Holding Version
1
+ # Saturday reporting
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Portable HTML test reports with a gallery, heatmap, split inspector, search, themes, attempt history, steps, and video playback. No Go binary or Saturday test framework is required.
4
+
5
+ Use `@orieken/saturday-playwright-reporter` for Playwright Test or `@orieken/saturday-cucumber-formatter` for Cucumber.js. This package supplies their shared renderer, types, and merge CLI.
6
+
7
+ ## Merge reports
8
+
9
+ ```sh
10
+ npx saturday-report merge --output combined-report \
11
+ playwright-report/report.json cucumber-report/report.json
12
+ ```
13
+
14
+ Install this package directly to use its CLI. Inputs must be portable Saturday schema v1 reports, with their media directories intact. Set the same `runId` and distinct `shard` values for shards of one run. Runner, run ID, and shard identify each input; duplicate identities fail rather than double-counting results. Test IDs are local to those identities. Attempts stay with their original test and shard.
15
+
16
+ ## API
17
+
18
+ ```ts
19
+ import { writeReport, mergeReports, type Report } from '@orieken/saturday-reporting';
20
+ writeReport(report satisfies Report, {
21
+ outputDir: 'saturday-report',
22
+ title: 'My test report',
23
+ artifactRoots: [process.cwd()],
24
+ });
25
+ ```
26
+
27
+ `Report` contains `schemaVersion: 1`, `title`, and `runs`. Runs contain identity, runner, status, optional timing, metadata, and tests. Each test retains its suite, optional source location, metadata, outcome, and attempts. Attempts retain normalized and raw statuses, durations, nested steps, and attachments. A failed attempt followed by a passing attempt is flaky. See the shipped declarations for the complete contract.
28
+
29
+ Input attachments can contain `path` or `body: Uint8Array`. Output attachments contain only a relative media path and availability. Supported media: WebM, MP4, PNG, JPEG, and GIF. Explicitly attached media is deduplicated by content; matching bytes never infer a scenario association.
30
+
31
+ ## Output and privacy
32
+
33
+ The output directory contains `index.html`, `report.json`, optional `media/`, and an ownership marker. Move or archive the entire directory. HTML works offline and uses no CDN fonts or runtime network requests. Ordinary static hosting also works; automatic publishing is outside this package.
34
+
35
+ Only supported, explicitly attached media is copied. Missing files retain their test result and show an unavailable notice. Disabled recording requires explicit producer metadata. Unsupported attachment contents, raw errors, stdout, environment variables, and Playwright HTML archives are excluded. This is not automatic secret redaction: titles, step names, labels, screenshots, and videos still contain producer-supplied data. Review them before sharing.
36
+
37
+ File attachments must stay inside `artifactRoots` and cannot traverse symlinks. New output directories are created atomically. Existing output is replaced only when it has the Saturday ownership marker; unrelated directories are refused. Keep report output separate from test artifacts and use a separate output directory for each concurrent invocation.
38
+
39
+ ## Compatibility and release
40
+
41
+ Initial version: **0.1.0**. Node **24.x**, ESM only. Runner versions are declared by the adapter packages. Build with `pnpm build:reporting`; verify packed standalone installs with `pnpm test:reporting`. Add `--browser` to the verification script to include recorded browser playback. The repository guide documents release verification and limits.
@@ -0,0 +1,5 @@
1
+ import type { Attachment } from './model.js';
2
+ export declare function inside(root: string, target: string): boolean;
3
+ /** Check every existing ancestor, including a symlinked directory above the file. */
4
+ export declare function rejectSymlinks(target: string): void;
5
+ export declare function portableAttachment(attachment: Attachment, destination: string, roots: string[]): Attachment;
@@ -0,0 +1,53 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { existsSync, lstatSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
3
+ import { isAbsolute, join, parse, relative, resolve, sep } from 'node:path';
4
+ const extensions = {
5
+ 'video/webm': '.webm', 'video/mp4': '.mp4', 'image/png': '.png', 'image/jpeg': '.jpg', 'image/gif': '.gif',
6
+ };
7
+ export function inside(root, target) {
8
+ const rel = relative(resolve(root), resolve(target));
9
+ return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`));
10
+ }
11
+ /** Check every existing ancestor, including a symlinked directory above the file. */
12
+ export function rejectSymlinks(target) {
13
+ const absolute = resolve(target);
14
+ let current = parse(absolute).root;
15
+ for (const part of absolute.slice(current.length).split(sep)) {
16
+ current = join(current, part);
17
+ try {
18
+ if (lstatSync(current).isSymbolicLink())
19
+ throw new Error('Report paths must not contain symlinks');
20
+ }
21
+ catch (error) {
22
+ if (error.code !== 'ENOENT')
23
+ throw error;
24
+ }
25
+ }
26
+ }
27
+ export function portableAttachment(attachment, destination, roots) {
28
+ const saved = { name: attachment.name, contentType: attachment.contentType };
29
+ if (attachment.availability === 'disabled' || attachment.availability === 'omitted')
30
+ return { ...saved, availability: attachment.availability };
31
+ const extension = extensions[attachment.contentType];
32
+ if (!extension)
33
+ return { ...saved, availability: 'omitted' };
34
+ let bytes = attachment.body;
35
+ if (attachment.path !== undefined) {
36
+ const source = resolve(attachment.path);
37
+ if (!roots.some(root => inside(root, source)))
38
+ throw new Error('Attachment escapes configured artifact roots');
39
+ rejectSymlinks(source);
40
+ if (!existsSync(source))
41
+ return { ...saved, availability: 'missing' };
42
+ if (!lstatSync(source).isFile())
43
+ throw new Error('Attachment must be a regular file');
44
+ bytes = readFileSync(source);
45
+ }
46
+ if (!bytes?.byteLength)
47
+ return { ...saved, availability: 'missing' };
48
+ const hash = createHash('sha256').update(bytes).digest('hex');
49
+ const path = `media/${hash}${extension}`;
50
+ mkdirSync(join(destination, 'media'), { recursive: true });
51
+ writeFileSync(join(destination, path), bytes);
52
+ return { ...saved, path, availability: 'available' };
53
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import { mergeReports } from './index.js';
3
+ const args = process.argv.slice(2);
4
+ try {
5
+ if (args.shift() !== 'merge')
6
+ throw new Error('Usage: saturday-report merge --output DIR [--title TITLE] report.json ...');
7
+ const files = [];
8
+ let outputDir = 'saturday-merged-report', title;
9
+ while (args.length) {
10
+ const arg = args.shift();
11
+ if (arg === '--output' || arg === '--title') {
12
+ const value = args.shift();
13
+ if (!value || value.startsWith('--'))
14
+ throw new Error(`Missing value for ${arg}`);
15
+ if (arg === '--output')
16
+ outputDir = value;
17
+ else
18
+ title = value;
19
+ }
20
+ else if (arg.startsWith('--'))
21
+ throw new Error(`Unknown option ${arg}`);
22
+ else
23
+ files.push(arg);
24
+ }
25
+ console.log(mergeReports(files, { outputDir, title }));
26
+ }
27
+ catch (error) {
28
+ console.error(error instanceof Error ? error.message : 'Report merge failed');
29
+ process.exitCode = 1;
30
+ }
@@ -0,0 +1,10 @@
1
+ import type { Report, ReportOptions } from './model.js';
2
+ import { renderReport } from './render.js';
3
+ import { validateReport } from './validate.js';
4
+ export * from './model.js';
5
+ export { renderReport, validateReport };
6
+ /** Writes a complete portable report; only replaces directories owned by Saturday. */
7
+ export declare function writeReport(report: Report, options?: ReportOptions): string;
8
+ /** Merge completed portable reports, rejecting duplicate runner/run/shard identities. */
9
+ export declare function mergeReports(files: string[], options?: ReportOptions): string;
10
+ export declare function newRunId(): string;
package/dist/index.js ADDED
@@ -0,0 +1,91 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
3
+ import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
4
+ import { inside, portableAttachment, rejectSymlinks } from './artifacts.js';
5
+ import { renderReport } from './render.js';
6
+ import { validateReport } from './validate.js';
7
+ export * from './model.js';
8
+ export { renderReport, validateReport };
9
+ function portableStep(step) {
10
+ return { title: step.title, status: step.status, durationMs: step.durationMs, category: step.category, steps: step.steps?.map(portableStep) };
11
+ }
12
+ /** Writes a complete portable report; only replaces directories owned by Saturday. */
13
+ export function writeReport(report, options = {}) {
14
+ validateReport(report);
15
+ const destination = resolve(options.outputDir ?? 'saturday-report');
16
+ rejectSymlinks(destination);
17
+ const marker = join(destination, '.saturday-report');
18
+ if (existsSync(destination) && (!existsSync(marker) || readFileSync(marker, 'utf8') !== 'saturday-report-v1\n')) {
19
+ throw new Error('Output directory already exists and is not owned by Saturday reporting');
20
+ }
21
+ mkdirSync(dirname(destination), { recursive: true });
22
+ const stage = mkdtempSync(join(dirname(destination), `.${basename(destination)}-`));
23
+ const backup = `${stage}-previous`;
24
+ try {
25
+ const portable = {
26
+ schemaVersion: 1, title: options.title ?? report.title,
27
+ runs: report.runs.map(run => ({
28
+ id: run.id, shard: run.shard, runner: run.runner, status: run.status,
29
+ startedAt: run.startedAt, durationMs: run.durationMs, metadata: run.metadata,
30
+ tests: run.tests.map(test => ({
31
+ id: test.id, title: test.title, suite: test.suite, metadata: test.metadata,
32
+ location: test.location ? { file: test.location.file, line: test.location.line } : undefined,
33
+ expectedStatus: test.expectedStatus, outcome: test.outcome,
34
+ attempts: test.attempts.map(attempt => ({
35
+ index: attempt.index, status: attempt.status, rawStatus: attempt.rawStatus,
36
+ durationMs: attempt.durationMs, steps: attempt.steps.map(portableStep),
37
+ attachments: attempt.attachments.map(a => portableAttachment(a, stage, options.artifactRoots ?? [process.cwd()])),
38
+ })),
39
+ })),
40
+ })),
41
+ };
42
+ writeFileSync(join(stage, 'report.json'), JSON.stringify(portable, null, 2) + '\n');
43
+ writeFileSync(join(stage, 'index.html'), renderReport(portable));
44
+ writeFileSync(join(stage, '.saturday-report'), 'saturday-report-v1\n');
45
+ if (existsSync(destination))
46
+ renameSync(destination, backup);
47
+ try {
48
+ renameSync(stage, destination);
49
+ }
50
+ catch (error) {
51
+ if (existsSync(backup))
52
+ renameSync(backup, destination);
53
+ throw error;
54
+ }
55
+ rmSync(backup, { recursive: true, force: true });
56
+ return join(destination, 'index.html');
57
+ }
58
+ finally {
59
+ rmSync(stage, { recursive: true, force: true });
60
+ }
61
+ }
62
+ /** Merge completed portable reports, rejecting duplicate runner/run/shard identities. */
63
+ export function mergeReports(files, options = {}) {
64
+ if (!files.length)
65
+ throw new Error('At least one report.json input is required');
66
+ const merged = { schemaVersion: 1, title: options.title ?? 'Saturday test report', runs: [] };
67
+ const roots = [];
68
+ for (const file of files) {
69
+ rejectSymlinks(file);
70
+ const report = JSON.parse(readFileSync(file, 'utf8'));
71
+ validateReport(report);
72
+ const root = dirname(resolve(file));
73
+ roots.push(root);
74
+ for (const run of report.runs)
75
+ for (const test of run.tests)
76
+ for (const attempt of test.attempts)
77
+ for (const attachment of attempt.attachments) {
78
+ if (attachment.body !== undefined)
79
+ throw new Error('Portable input must not contain attachment bodies');
80
+ if (attachment.path !== undefined) {
81
+ if (isAbsolute(attachment.path) || !inside(root, resolve(root, attachment.path)))
82
+ throw new Error('Portable attachment path escapes report directory');
83
+ attachment.path = resolve(root, attachment.path);
84
+ }
85
+ }
86
+ merged.runs.push(...report.runs);
87
+ }
88
+ validateReport(merged);
89
+ return writeReport(merged, { ...options, artifactRoots: roots });
90
+ }
91
+ export function newRunId() { return randomUUID(); }
@@ -0,0 +1,72 @@
1
+ /** Portable report format. Paths in saved reports are relative to report.json. */
2
+ export type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'undefined' | 'ambiguous' | 'timedOut' | 'interrupted' | 'unknown';
3
+ export type Outcome = Status | 'flaky';
4
+ export type Metadata = Record<string, string>;
5
+ export interface Attachment {
6
+ name: string;
7
+ contentType: string;
8
+ path?: string;
9
+ /** Input only; never serialized. */
10
+ body?: Uint8Array;
11
+ availability?: 'available' | 'missing' | 'disabled' | 'omitted';
12
+ }
13
+ export interface Step {
14
+ title: string;
15
+ status: Status;
16
+ durationMs: number;
17
+ category?: string;
18
+ steps?: Step[];
19
+ }
20
+ export interface Attempt {
21
+ index: number;
22
+ status: Status;
23
+ rawStatus: string;
24
+ durationMs: number;
25
+ steps: Step[];
26
+ attachments: Attachment[];
27
+ }
28
+ export interface TestCase {
29
+ id: string;
30
+ title: string;
31
+ suite: string[];
32
+ location?: {
33
+ file: string;
34
+ line: number;
35
+ };
36
+ metadata: Metadata;
37
+ expectedStatus?: string;
38
+ outcome: Outcome;
39
+ attempts: Attempt[];
40
+ }
41
+ export interface Run {
42
+ id: string;
43
+ shard: string;
44
+ runner: 'playwright' | 'cucumber';
45
+ status: Status;
46
+ startedAt?: string;
47
+ durationMs?: number;
48
+ metadata: Metadata;
49
+ tests: TestCase[];
50
+ }
51
+ export interface Report {
52
+ schemaVersion: 1;
53
+ title: string;
54
+ runs: Run[];
55
+ }
56
+ export interface ReportOptions {
57
+ outputDir?: string;
58
+ title?: string;
59
+ /** Reuse across shards of one run; generated automatically otherwise. */
60
+ runId?: string;
61
+ shard?: string;
62
+ metadata?: Metadata;
63
+ /** Set false for credential-sensitive suites whose runner step titles may contain input values. */
64
+ includeSteps?: boolean;
65
+ /** Additional directories from which explicitly attached media may be copied. */
66
+ artifactRoots?: string[];
67
+ }
68
+ export declare function normalizeStatus(value: string): Status;
69
+ export declare function outcome(attempts: Attempt[]): Outcome;
70
+ export declare function metadata(value: unknown): Metadata;
71
+ /** Opt-in annotations/tags use saturday:key=value; ordinary projects need none. */
72
+ export declare function labelMetadata(labels: string[]): Metadata;
package/dist/model.js ADDED
@@ -0,0 +1,26 @@
1
+ export function normalizeStatus(value) {
2
+ const key = value.toLowerCase();
3
+ if (key === 'timedout')
4
+ return 'timedOut';
5
+ const statuses = ['passed', 'failed', 'skipped', 'pending', 'undefined', 'ambiguous', 'interrupted'];
6
+ return statuses.find(status => status === key) ?? 'unknown';
7
+ }
8
+ export function outcome(attempts) {
9
+ const last = attempts.at(-1)?.status ?? 'unknown';
10
+ return last === 'passed' && attempts.some(a => a.status !== 'passed' && a.status !== 'skipped') ? 'flaky' : last;
11
+ }
12
+ export function metadata(value) {
13
+ if (!value || typeof value !== 'object' || Array.isArray(value))
14
+ throw new Error('Metadata must be a string map');
15
+ const entries = Object.entries(value);
16
+ if (entries.some(([key, item]) => !key || typeof item !== 'string'))
17
+ throw new Error('Metadata must be a string map');
18
+ return Object.fromEntries(entries);
19
+ }
20
+ /** Opt-in annotations/tags use saturday:key=value; ordinary projects need none. */
21
+ export function labelMetadata(labels) {
22
+ return Object.fromEntries(labels.flatMap(label => {
23
+ const match = label.match(/^@?saturday:([^=]+)=(.*)$/);
24
+ return match ? [[match[1], match[2]]] : [];
25
+ }));
26
+ }
@@ -0,0 +1,3 @@
1
+ import type { Report } from './model.js';
2
+ export declare const escapeHTML: (value: unknown) => string;
3
+ export declare function renderReport(report: Report): string;
package/dist/render.js ADDED
@@ -0,0 +1,63 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { validateReport } from './validate.js';
3
+ export const escapeHTML = (value) => String(value).replace(/[&<>"']/g, character => ({
4
+ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;',
5
+ })[character]);
6
+ const e = escapeHTML;
7
+ function steps(items) {
8
+ return `<ol class="steps">${items.map(step => `<li><span class="badge ${e(step.status)}">${e(step.status)}</span> ${e(step.title)} <small>${step.durationMs.toFixed(0)} ms</small>${step.steps?.length ? steps(step.steps) : ''}</li>`).join('')}</ol>`;
9
+ }
10
+ function media(attachment) {
11
+ const name = e(attachment.name);
12
+ if (attachment.availability !== 'available' || !attachment.path) {
13
+ const notices = { missing: 'Missing or expired recording', disabled: 'Recording intentionally disabled', omitted: 'Attachment omitted from portable output' };
14
+ return `<p class="notice">${name}: ${notices[attachment.availability] ?? 'Attachment unavailable'}</p>`;
15
+ }
16
+ // Only publisher-generated relative media paths may become links, never arbitrary URLs.
17
+ if (!/^media\/[a-f0-9]{64}\.(webm|mp4|png|jpg|gif)$/.test(attachment.path))
18
+ throw new Error('Unsafe portable media path');
19
+ const url = e(attachment.path);
20
+ if (attachment.contentType.startsWith('video/'))
21
+ return `<div class="recording"><video controls preload="none" playsinline aria-label="${name}"><source src="${url}" type="${e(attachment.contentType)}"></video><div class="card-playback-bar"><div class="speed-btn-group"><button data-speed="1">1×</button><button data-speed="1.5">1.5×</button><button data-speed="2">2×</button></div><button class="btn-theater" data-theater="${url}" data-title="${name}">Theater ⤢</button><a href="${url}" download>Download</a></div></div>`;
22
+ return `<figure><img loading="lazy" src="${url}" alt="${name}"><figcaption><a href="${url}" download>${name}</a></figcaption></figure>`;
23
+ }
24
+ function card(test, run, index) {
25
+ const metadata = { ...run.metadata, ...test.metadata, runner: run.runner, status: test.outcome };
26
+ const suite = test.suite.join(' / ');
27
+ const attachments = test.attempts.flatMap(attempt => attempt.attachments);
28
+ return `<article class="video-card" data-card="${index}" data-labels="${e(JSON.stringify(metadata))}" data-suite="${e(suite)}" data-name="${e(test.title)}">
29
+ <div class="card-info"><div class="card-top"><span class="spec">${e(suite || run.runner)}</span><span class="badge ${e(test.outcome)}">${e(test.outcome)}</span></div><h3 class="case-name">${e(test.title)}</h3><p class="meta">${e(test.location ? `${test.location.file}:${test.location.line}` : '')}</p><p class="meta">${Object.entries(metadata).filter(([key]) => !['runner', 'status'].includes(key)).map(([key, value]) => `<span class="chip">${e(key)}: ${e(value)}</span>`).join('')}</p></div>
30
+ ${attachments.length ? test.attempts.filter(a => a.attachments.length).map(a => `<div class="attempt-media"><p class="media-label">Attempt ${a.index + 1} attachments</p>${a.attachments.map(media).join('')}</div>`).join('') : '<p class="notice">No recording attached. The saved test result is unchanged.</p>'}
31
+ <details class="attempts"><summary>${test.attempts.length} attempt${test.attempts.length === 1 ? '' : 's'} · ${test.attempts.reduce((sum, a) => sum + a.durationMs, 0).toFixed(0)} ms${test.expectedStatus ? ` · expected ${e(test.expectedStatus)}` : ''}</summary>${test.attempts.map(attempt => `<section><h4>Attempt ${attempt.index + 1} · ${e(attempt.rawStatus)} · ${attempt.durationMs.toFixed(0)} ms</h4>${steps(attempt.steps)}</section>`).join('')}</details>
32
+ <p class="run">${e(run.runner)} · run ${e(run.id)} · shard ${e(run.shard)} · ${e(test.id)}</p>
33
+ </article>`;
34
+ }
35
+ function filters(report) {
36
+ const values = new Map([['runner', new Set()], ['status', new Set()]]);
37
+ for (const run of report.runs)
38
+ for (const test of run.tests) {
39
+ for (const [key, value] of Object.entries({ ...run.metadata, ...test.metadata, runner: run.runner, status: test.outcome })) {
40
+ if (!values.has(key))
41
+ values.set(key, new Set());
42
+ values.get(key).add(value);
43
+ }
44
+ }
45
+ return [...values].map(([key, options]) => `<label class="filter-label">${e(key)}<select data-filter="${e(key)}" aria-label="${e(key)}"><option value="">All</option>${[...options].sort().map(value => `<option value="${e(value)}">${e(value)}</option>`).join('')}</select></label>`).join('');
46
+ }
47
+ export function renderReport(report) {
48
+ validateReport(report);
49
+ const css = readFileSync(new URL('./ui/gallery.css', import.meta.url), 'utf8');
50
+ const js = readFileSync(new URL('./ui/gallery.js', import.meta.url), 'utf8');
51
+ const tests = report.runs.flatMap(run => run.tests);
52
+ let index = 0;
53
+ return `<!doctype html><html lang="en" data-theme="dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${e(report.title)}</title><style>${css}</style></head><body>
54
+ <header><div class="brand"><span class="brand-icon">▶</span><strong>Saturday <span class="muted">/ Test reports</span></strong></div><nav class="view-mode-tabs" aria-label="Report views"><button class="view-tab active" data-view="gallery" aria-pressed="true">Visual gallery</button><button class="view-tab" data-view="heatmap" aria-pressed="false">Heatmap &amp; triage</button><button class="view-tab" data-view="inspector" aria-pressed="false">Split inspector</button></nav><div class="nav-links"><a href="report.json">Report JSON ↗</a><button id="theme-btn" class="theme-btn" aria-label="Toggle theme">◐</button></div></header>
55
+ <main><div class="eyebrow">Saturday · Test evidence</div><h1>${e(report.title)}</h1><p class="intro">Scenario results, attempts, steps, and recordings across your test runs.</p><div class="stats"><div class="stat"><span>Tests</span><strong>${tests.length}</strong></div><div class="stat good"><span>Passed</span><strong>${tests.filter(t => t.outcome === 'passed').length}</strong></div><div class="stat bad"><span>Failed / unresolved</span><strong>${tests.filter(t => !['passed', 'skipped', 'flaky'].includes(t.outcome)).length}</strong></div><div class="stat"><span>Flaky</span><strong>${tests.filter(t => t.outcome === 'flaky').length}</strong></div></div>
56
+ <p class="run-status">${report.runs.map(run => `${e(run.runner)} run ${e(run.id)} / ${e(run.shard)}: <span class="badge ${e(run.status)}">${e(run.status)}</span>`).join(' · ') || 'No runs'}</p>
57
+ <div class="toolbar" role="search" aria-label="Filter tests"><input id="search" type="search" aria-label="Search tests" placeholder="Search tests, specs, or metadata…">${filters(report)}<span id="shown" class="shown" role="status" aria-live="polite"></span></div>
58
+ <p class="empty" id="empty" hidden>No tests match these filters.</p><section id="heatmap-view" hidden><div class="heatmap-table-wrap"><table class="heatmap-table" aria-label="Coverage heatmap"><thead><tr><th>Suite</th><th>Runner / platform</th><th>Passed</th><th>Flaky</th><th>Failed / unresolved</th><th>Skipped</th></tr></thead><tbody id="heatmap-body"></tbody></table></div></section>
59
+ <section id="inspector-view" hidden><div class="saturday-inspector"><div id="inspector-rail" class="inspector-rail"></div><div id="inspector-drawer" class="inspector-drawer"></div></div></section>
60
+ <div id="selection-stream" class="grid">${report.runs.map(run => run.tests.map(test => card(test, run, index++)).join('')).join('')}</div>
61
+ <details class="notes"><summary>About this report</summary><p>Test counts represent scenarios, not video files or attempts. Flaky tests passed after an unsuccessful attempt. Each attempt retains its original runner status. Missing recordings retain their test results. Only explicitly attached supported media is copied; raw logs and errors are excluded. Titles, labels, steps, and media are supplied by your tests: review their contents before sharing.</p></details></main>
62
+ <dialog id="theater-modal"><div class="modal-head"><h3 id="theater-title">Recording</h3><button id="close-theater" aria-label="Close recording">✕</button></div><div class="modal-body"><video id="theater-player" controls playsinline></video></div></dialog><script>${js}</script></body></html>`;
63
+ }