tolkira 0.2.0 → 0.4.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/DESIGN.md +131 -9
- package/GLOSSARY.md +201 -1
- package/README.md +413 -29
- package/SECURITY.md +3 -0
- package/dist/attachment.d.ts +33 -0
- package/dist/attempt-diagnostics.d.ts +2 -0
- package/dist/ci.d.ts +12 -0
- package/dist/cli.js +6881 -2691
- package/dist/cli.js.map +4 -4
- package/dist/compat/cucumber-html-reporter.cjs +12 -0
- package/dist/compat/cucumber-html-reporter.d.cts +10 -0
- package/dist/compat/cucumber-html-reporter.js +263 -26
- package/dist/compat/cucumber-html-reporter.js.map +4 -4
- package/dist/compat/options.d.ts +4 -0
- package/dist/email.d.ts +18 -0
- package/dist/history.d.ts +41 -0
- package/dist/i18n/catalogs.d.ts +7 -0
- package/dist/index.d.ts +15 -7
- package/dist/index.js +5301 -1709
- package/dist/index.js.map +4 -4
- package/dist/input/background.d.ts +4 -0
- package/dist/input/detect.d.ts +30 -0
- package/dist/input/load.d.ts +3 -0
- package/dist/input/playwright.d.ts +14 -0
- package/dist/options.d.ts +18 -0
- package/dist/output.d.ts +9 -1
- package/dist/pdf.d.ts +9 -0
- package/dist/render/ansi.d.ts +2 -0
- package/dist/render/attachments.d.ts +3 -0
- package/dist/render/ci.d.ts +4 -0
- package/dist/render/client-bundle.d.ts +1 -0
- package/dist/render/client-i18n.d.ts +7 -0
- package/dist/render/details.d.ts +5 -0
- package/dist/render/dom-contract.d.ts +42 -0
- package/dist/render/format.d.ts +34 -0
- package/dist/render/html.d.ts +2 -9
- package/dist/render/i18n.d.ts +30 -0
- package/dist/render/markdown.d.ts +2 -0
- package/dist/render/matrix.d.ts +3 -0
- package/dist/render/print-script.d.ts +1 -0
- package/dist/render/report-client.d.ts +1 -0
- package/dist/render/report.d.ts +4 -0
- package/dist/render/search.d.ts +21 -0
- package/dist/render/trends.d.ts +7 -0
- package/dist/render/triage.d.ts +5 -0
- package/dist/render/types.d.ts +26 -0
- package/dist/report/index-run.d.ts +69 -0
- package/dist/report/model.d.ts +96 -6
- package/dist/report/status.d.ts +12 -0
- package/dist/stream.d.ts +15 -0
- package/dist/summary.d.ts +17 -2
- package/dist/text.d.ts +15 -0
- package/dist/warnings.d.ts +6 -0
- package/docs/AGENT-INTERFACE.md +504 -33
- package/docs/CI.md +185 -0
- package/docs/COMPATIBILITY.md +121 -16
- package/docs/CUCUMBER-COMPATIBILITY.md +232 -15
- package/docs/EMAIL.md +273 -0
- package/docs/I18N.md +241 -0
- package/docs/JUNIT-XML.md +46 -4
- package/docs/LIMITATIONS.md +21 -0
- package/docs/PDF.md +255 -0
- package/llms.txt +63 -0
- package/package.json +46 -8
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Background } from '@cucumber/messages';
|
|
2
|
+
/** Marks the Background node legacy normalisation invents for step resolution. */
|
|
3
|
+
export declare function markSyntheticBackground(background: Background): void;
|
|
4
|
+
export declare function isSyntheticBackground(background: Background): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface InputIdentity {
|
|
2
|
+
file: string;
|
|
3
|
+
explicit: boolean;
|
|
4
|
+
}
|
|
5
|
+
export type InputDecision = {
|
|
6
|
+
kind: 'legacy';
|
|
7
|
+
parsed: unknown[];
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'legacy-validation';
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'junit';
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'junit-validation';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'messages';
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'messages-validation';
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'playwright';
|
|
20
|
+
parsed: unknown;
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'json-validation';
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'skip';
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Pure decision table over content and file identity. It performs no I/O and
|
|
28
|
+
* throws no validation errors; the loader runs the selected adapter.
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectInput(content: string, identity: InputIdentity): InputDecision;
|
package/dist/input/load.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Envelope } from '@cucumber/messages';
|
|
2
|
+
export declare const MAX_TOTAL_INPUT_BYTES: number;
|
|
3
|
+
export declare function addInputBytes(totalBytes: number, size: number): number;
|
|
2
4
|
export interface LoadedInput {
|
|
3
5
|
file: string;
|
|
4
6
|
envelopes: Envelope[];
|
|
7
|
+
skippedAttachments: number;
|
|
5
8
|
}
|
|
6
9
|
export declare function loadInputs(inputs: string | string[]): Promise<LoadedInput[]>;
|
|
7
10
|
export declare function loadEnvelopes(inputs: string | string[]): Promise<Envelope[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Envelope } from '@cucumber/messages';
|
|
2
|
+
export interface PlaywrightJsonOptions {
|
|
3
|
+
idPrefix?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface PlaywrightParseResult {
|
|
6
|
+
envelopes: Envelope[];
|
|
7
|
+
skippedAttachments: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Normalises a Playwright JSON reporter file into Cucumber Messages. It builds
|
|
11
|
+
* the envelopes directly so retries stay separate attempts; the latest attempt
|
|
12
|
+
* is the rendered result.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parsePlaywrightJson(parsed: unknown, source: string, options?: PlaywrightJsonOptions): Promise<PlaywrightParseResult>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HistoryRun } from './history.js';
|
|
2
|
+
export interface RenderReportOptions {
|
|
3
|
+
title?: string;
|
|
4
|
+
metadata?: Record<string, string>;
|
|
5
|
+
logo?: string;
|
|
6
|
+
accent?: string;
|
|
7
|
+
/** Report UI language tag; defaults to English. */
|
|
8
|
+
locale?: string;
|
|
9
|
+
/** Prior aggregate runs; renderReport only renders them, generateReport appends. */
|
|
10
|
+
history?: HistoryRun[];
|
|
11
|
+
}
|
|
12
|
+
export declare function renderOptions(options: RenderReportOptions): {
|
|
13
|
+
title: string;
|
|
14
|
+
metadata: Record<string, string> | undefined;
|
|
15
|
+
logo: string | undefined;
|
|
16
|
+
accent: string | undefined;
|
|
17
|
+
locale: string | undefined;
|
|
18
|
+
};
|
package/dist/output.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/** True when writing `output` would replace an input file or the logo. */
|
|
2
|
+
export declare function outputOverwritesInput(inputs: string[], output: string, logo?: string): Promise<boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* True when both paths name the same file. Windows and macOS compare
|
|
5
|
+
* case-insensitively; symlinked or junctioned parents resolve even when the
|
|
6
|
+
* target file does not exist yet.
|
|
7
|
+
*/
|
|
8
|
+
export declare function samePath(a: string, b: string): boolean;
|
|
9
|
+
export declare function writeAtomic(output: string, content: string | Uint8Array): Promise<void>;
|
package/dist/pdf.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PdfOptions {
|
|
2
|
+
/** Print timeout in milliseconds; defaults to five minutes. */
|
|
3
|
+
timeoutMs?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Prints report HTML to A4 PDF bytes with Chromium. Writes no file and starts
|
|
7
|
+
* no server; the native print lifecycle supplies `beforeprint`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderPdf(html: string, options?: PdfOptions): Promise<Uint8Array>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReportModel } from '../report/model.js';
|
|
2
|
+
import type { Translator } from './i18n.js';
|
|
3
|
+
export declare function ciHeaderMarkup(ci: NonNullable<ReportModel['environment']>['ci'], t: Translator): string;
|
|
4
|
+
export declare function ciDetailRows(ci: NonNullable<ReportModel['environment']>['ci'], t: Translator): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CLIENT_SCRIPT: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type ClientParams = Record<string, string | number>;
|
|
2
|
+
export interface ClientFormatter {
|
|
3
|
+
lang: string;
|
|
4
|
+
format(template: string, params?: ClientParams): string;
|
|
5
|
+
number(value: number): string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createClientFormatter(lang: string): ClientFormatter;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReportModel } from '../report/model.js';
|
|
2
|
+
import type { ReportSummary } from '../summary.js';
|
|
3
|
+
import type { Translator } from './i18n.js';
|
|
4
|
+
import type { RenderOptions } from './types.js';
|
|
5
|
+
export declare function renderAnalysisView(model: ReportModel, options: RenderOptions, summary: ReportSummary, t: Translator): string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReportStatus } from '../report/status.js';
|
|
2
|
+
export declare const SCENARIO_ATTRIBUTE = "data-scenario";
|
|
3
|
+
export declare const STATUS_ATTRIBUTE = "data-status";
|
|
4
|
+
export declare const FILTER_STATUS_ATTRIBUTE = "data-filter-status";
|
|
5
|
+
export declare const FILTER_PRESET_ATTRIBUTE = "data-filter-preset";
|
|
6
|
+
export declare const DOM_IDS: {
|
|
7
|
+
readonly reportView: 'report-view';
|
|
8
|
+
readonly analysisView: 'analysis-view';
|
|
9
|
+
readonly trendsView: 'trends-view';
|
|
10
|
+
readonly live: 'tolkira-live';
|
|
11
|
+
readonly searchNote: 'tolkira-search-note';
|
|
12
|
+
readonly copyLive: 'tolkira-copy-live';
|
|
13
|
+
readonly emptyResults: 'empty-results';
|
|
14
|
+
readonly lightbox: 'tolkira-lightbox';
|
|
15
|
+
readonly i18nMessages: 'tolkira-messages';
|
|
16
|
+
};
|
|
17
|
+
export declare function featureId(index: number): string;
|
|
18
|
+
export declare function scenarioId(featureIndex: number, scenarioIndex: number): string;
|
|
19
|
+
export interface ScenarioFacts {
|
|
20
|
+
/** Executed result; absent when the row has no result. */
|
|
21
|
+
status?: ReportStatus;
|
|
22
|
+
name: string;
|
|
23
|
+
uri: string;
|
|
24
|
+
tags: string[];
|
|
25
|
+
example?: string;
|
|
26
|
+
examplesName?: string;
|
|
27
|
+
search: string;
|
|
28
|
+
}
|
|
29
|
+
export type ScenarioAttribute = readonly [name: string, value: string];
|
|
30
|
+
export declare function encodeScenario(facts: ScenarioFacts): ScenarioAttribute[];
|
|
31
|
+
export interface AttributeSource {
|
|
32
|
+
getAttribute(name: string): string | null;
|
|
33
|
+
}
|
|
34
|
+
export declare function decodeScenario(source: AttributeSource): ScenarioFacts;
|
|
35
|
+
export interface ScenarioVisibility {
|
|
36
|
+
query: string;
|
|
37
|
+
tag: string;
|
|
38
|
+
hidden: ReadonlySet<string>;
|
|
39
|
+
expression?: (tags: string[]) => boolean;
|
|
40
|
+
groupSearch?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function scenarioVisible(facts: ScenarioFacts, filter: ScenarioVisibility): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReportFeature, ReportHook, ReportModel, ReportRunHook, ReportScenario } from '../report/model.js';
|
|
2
|
+
import { type ReportStatus } from '../report/status.js';
|
|
3
|
+
import { type StatusCounts } from '../summary.js';
|
|
4
|
+
import type { Translator } from './i18n.js';
|
|
5
|
+
import type { DisplayStatus, OrderedFeature } from './types.js';
|
|
6
|
+
export declare function statusLabel(status: ReportStatus, t: Translator): string;
|
|
7
|
+
export declare function statusClass(status: ReportStatus): string;
|
|
8
|
+
export declare const STEP_GLYPHS: Record<ReportStatus, string>;
|
|
9
|
+
export declare function durationLabel(milliseconds: number, t: Translator): string;
|
|
10
|
+
export declare function dateLabel(iso: string | undefined, t: Translator): string;
|
|
11
|
+
export declare const ALL_STATUSES: DisplayStatus[];
|
|
12
|
+
export declare function displayStatuses(model: ReportModel): DisplayStatus[];
|
|
13
|
+
export declare function compareStatus(a: ReportStatus, b: ReportStatus): number;
|
|
14
|
+
export declare function orderFeatures(features: ReportFeature[]): OrderedFeature[];
|
|
15
|
+
export declare function countStatuses(scenarios: Array<{
|
|
16
|
+
status: ReportStatus;
|
|
17
|
+
}>): Partial<Record<ReportStatus, number>>;
|
|
18
|
+
export declare function attentionCounts(scenarios: ReportScenario[], t: Translator): string;
|
|
19
|
+
export declare function executedOnly(scenarios: ReportScenario[]): ReportScenario[];
|
|
20
|
+
export declare function featureBar(scenarios: ReportScenario[]): string;
|
|
21
|
+
export declare function scenarioSourceLabel(scenario: ReportScenario): string;
|
|
22
|
+
export declare function featureSourceLabel(feature: ReportFeature, t: Translator): string;
|
|
23
|
+
export declare function passRate(counts: StatusCounts): {
|
|
24
|
+
attempted: number;
|
|
25
|
+
percent: number | null;
|
|
26
|
+
};
|
|
27
|
+
export declare function healthMarkup(model: ReportModel, t: Translator): string;
|
|
28
|
+
export declare function tagsMarkup(tags: string[], extraClass?: string): string;
|
|
29
|
+
export declare function isFlakyScenario(scenario: ReportScenario): boolean;
|
|
30
|
+
export declare function flakyScenarioCount(model: ReportModel): number;
|
|
31
|
+
export declare function statusBar(model: ReportModel): string;
|
|
32
|
+
export declare function countPills(model: ReportModel, t: Translator): string;
|
|
33
|
+
export declare function safeHttpUrl(value: string | undefined): string | undefined;
|
|
34
|
+
export declare function hookLabel(hook: ReportHook | ReportRunHook, bareName?: boolean): string;
|
package/dist/render/html.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import type { Envelope } from '@cucumber/messages';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
title: string;
|
|
5
|
-
metadata?: Record<string, string>;
|
|
6
|
-
logo?: string;
|
|
7
|
-
accent?: string;
|
|
8
|
-
summary?: ReportSummary;
|
|
9
|
-
provenance?: Map<string, string>;
|
|
10
|
-
}
|
|
2
|
+
import type { RenderOptions } from './types.js';
|
|
3
|
+
export type { RenderOptions } from './types.js';
|
|
11
4
|
export declare function renderHtml(envelopes: Envelope[], options: RenderOptions): Promise<string>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type MessageKey } from '../i18n/catalogs.js';
|
|
2
|
+
export type { MessageKey };
|
|
3
|
+
export interface ResolvedLocale {
|
|
4
|
+
requested: string;
|
|
5
|
+
lang: string;
|
|
6
|
+
dir: 'ltr' | 'rtl';
|
|
7
|
+
catalog: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const SUPPORTED_LOCALES: readonly string[];
|
|
10
|
+
/** Catalog messages longer than this are a mistake, not a translation. */
|
|
11
|
+
export declare const MAX_MESSAGE_LENGTH = 2000;
|
|
12
|
+
export declare function resolveLocale(tag?: string): ResolvedLocale;
|
|
13
|
+
export declare function formatMessage(message: string, params: Record<string, string | number>, locale: string): string;
|
|
14
|
+
export interface TranslatorOptions {
|
|
15
|
+
/** Test seam: replaces the active catalog for the locale. */
|
|
16
|
+
catalog?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export interface Translator {
|
|
19
|
+
locale: string;
|
|
20
|
+
lang: string;
|
|
21
|
+
dir: 'ltr' | 'rtl';
|
|
22
|
+
t(key: MessageKey, params?: Record<string, string | number>): string;
|
|
23
|
+
number(value: number): string;
|
|
24
|
+
percent(value: number): string;
|
|
25
|
+
duration(milliseconds: number): string;
|
|
26
|
+
date(iso: string | undefined): string;
|
|
27
|
+
/** Serialized, escaped JSON for the client.* keys only. */
|
|
28
|
+
clientMessages(): string;
|
|
29
|
+
}
|
|
30
|
+
export declare function createTranslator(locale?: string, options?: TranslatorOptions): Translator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PRINT_SCRIPT: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const SEARCH_OPEN_CAP = 20;
|
|
2
|
+
export declare const UNEXECUTED_HIDE = "unexecuted";
|
|
3
|
+
export declare function isFailedOnlyState(hidden: readonly string[], present: readonly string[]): boolean;
|
|
4
|
+
export declare function pruneFailedOnly(hidden: readonly string[], present: readonly string[]): string[];
|
|
5
|
+
export declare function isTagExpression(query: string): boolean;
|
|
6
|
+
export type TagExpressionEvaluator = (tags: string[]) => boolean;
|
|
7
|
+
export declare function compileTagExpression(query: string): TagExpressionEvaluator | undefined;
|
|
8
|
+
export declare function evaluateTagExpression(query: string, tags: string[]): boolean | undefined;
|
|
9
|
+
export interface UrlState {
|
|
10
|
+
query: string;
|
|
11
|
+
hidden: string[];
|
|
12
|
+
tag: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseUrlState(search: string, knownStatuses: readonly string[], knownTags: readonly string[]): UrlState;
|
|
15
|
+
export declare function serializeUrlState(current: string, state: UrlState): string;
|
|
16
|
+
export interface OpenRow {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
open: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function rowsToOpen(rows: readonly OpenRow[], cap?: number): number[];
|
|
21
|
+
export declare function rememberHiddenOpen(open: boolean, openedBySearch: boolean): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HistoryRun } from '../history.js';
|
|
2
|
+
import type { Translator } from './i18n.js';
|
|
3
|
+
/**
|
|
4
|
+
* The third view: the latest runs newest first, with the pass-rate trend as a
|
|
5
|
+
* decorative sparkline (oldest to newest). The table carries the data.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderTrendsView(history: HistoryRun[], t: Translator): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReportModel } from '../report/model.js';
|
|
2
|
+
import type { Translator } from './i18n.js';
|
|
3
|
+
import type { OrderedFeature } from './types.js';
|
|
4
|
+
export declare function renderTriage(features: OrderedFeature[], t: Translator): string;
|
|
5
|
+
export declare function renderSourceStrip(model: ReportModel, t: Translator): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { HistoryRun } from '../history.js';
|
|
2
|
+
import type { RunIndex } from '../report/index-run.js';
|
|
3
|
+
import type { ReportFeature, ReportScenario } from '../report/model.js';
|
|
4
|
+
import type { ReportStatus } from '../report/status.js';
|
|
5
|
+
import type { ReportSummary } from '../summary.js';
|
|
6
|
+
export interface RenderOptions {
|
|
7
|
+
title: string;
|
|
8
|
+
metadata?: Record<string, string>;
|
|
9
|
+
logo?: string;
|
|
10
|
+
accent?: string;
|
|
11
|
+
/** Report UI language tag; defaults to English. */
|
|
12
|
+
locale?: string;
|
|
13
|
+
/** Prior aggregate runs; two or more render the Trends view. */
|
|
14
|
+
history?: HistoryRun[];
|
|
15
|
+
summary?: ReportSummary;
|
|
16
|
+
provenance?: Map<string, string>;
|
|
17
|
+
/** Index already built from the sanitized envelopes; internal fast path. */
|
|
18
|
+
index?: RunIndex;
|
|
19
|
+
/** Path attachments skipped because they resolve outside every allowed root. */
|
|
20
|
+
skippedAttachments?: number;
|
|
21
|
+
}
|
|
22
|
+
export type DisplayStatus = ReportStatus;
|
|
23
|
+
export interface OrderedFeature {
|
|
24
|
+
feature: ReportFeature;
|
|
25
|
+
scenarios: ReportScenario[];
|
|
26
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Attachment, Envelope, Examples, Feature, Hook, Pickle, Rule, Scenario, Step, TestCase, TestCaseStarted, TestRunHookFinished, TestRunHookStarted, TestStepFinished } from '@cucumber/messages';
|
|
2
|
+
export interface RunFeatureDocument {
|
|
3
|
+
feature: Feature;
|
|
4
|
+
uri: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RunScenarioNode {
|
|
7
|
+
scenario: Scenario;
|
|
8
|
+
rule?: Rule;
|
|
9
|
+
}
|
|
10
|
+
export interface RunOutlineExample {
|
|
11
|
+
uri: string;
|
|
12
|
+
scenario: Scenario;
|
|
13
|
+
examples: Examples;
|
|
14
|
+
examplesIndex: number;
|
|
15
|
+
exampleIndex: number;
|
|
16
|
+
}
|
|
17
|
+
export interface RunSuggestion {
|
|
18
|
+
language?: string;
|
|
19
|
+
code: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RunStepDefinition {
|
|
22
|
+
pattern: string;
|
|
23
|
+
uri: string;
|
|
24
|
+
line?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Shared projection of the Cucumber Messages envelopes used by both the report
|
|
28
|
+
* model and the machine-readable summary. Each consumer applies its own
|
|
29
|
+
* presentation policy on top; the index only keeps facts both need.
|
|
30
|
+
*/
|
|
31
|
+
export interface RunIndex {
|
|
32
|
+
/** Unique feature documents in first-appearance order. */
|
|
33
|
+
featureDocuments: RunFeatureDocument[];
|
|
34
|
+
/** First feature per `uri || name`; the report model's fallback. */
|
|
35
|
+
featuresByKey: Map<string, Feature>;
|
|
36
|
+
/** Last feature per URI; the summary's fallback. */
|
|
37
|
+
featuresByUri: Map<string, Feature>;
|
|
38
|
+
/** Last feature per AST scenario id. */
|
|
39
|
+
featureByScenarioId: Map<string, Feature>;
|
|
40
|
+
/** Last AST scenario node per id, with its rule. */
|
|
41
|
+
scenarioTree: Map<string, RunScenarioNode>;
|
|
42
|
+
/** Last examples row per AST id. */
|
|
43
|
+
outlineRows: Map<string, RunOutlineExample>;
|
|
44
|
+
/** Last AST step per id. */
|
|
45
|
+
steps: Map<string, Step>;
|
|
46
|
+
pickles: Map<string, Pickle>;
|
|
47
|
+
testCases: Map<string, TestCase>;
|
|
48
|
+
testCasesByPickle: Map<string, TestCase[]>;
|
|
49
|
+
/** Latest started attempt per pickle id. */
|
|
50
|
+
attempts: Map<string, TestCaseStarted>;
|
|
51
|
+
results: Map<string, TestStepFinished[]>;
|
|
52
|
+
hooks: Map<string, Hook>;
|
|
53
|
+
runHookStarts: Map<string, TestRunHookStarted>;
|
|
54
|
+
runHookFinishes: Map<string, TestRunHookFinished>;
|
|
55
|
+
/** Attachments without a test-run hook owner, grouped by test case start id. */
|
|
56
|
+
caseAttachments: Map<string, Attachment[]>;
|
|
57
|
+
/** Attachments owned by a test-run hook start. */
|
|
58
|
+
runHookAttachments: Map<string, Attachment[]>;
|
|
59
|
+
/** Every attachment with a test case start id; the summary's view. */
|
|
60
|
+
attachmentsByStarted: Map<string, Attachment[]>;
|
|
61
|
+
/** Every attachment envelope in input order. */
|
|
62
|
+
attachments: Attachment[];
|
|
63
|
+
/** Attachments without a test case or run-hook owner. */
|
|
64
|
+
runAttachments: Attachment[];
|
|
65
|
+
suggestions: Map<string, RunSuggestion[]>;
|
|
66
|
+
definitions: Map<string, RunStepDefinition>;
|
|
67
|
+
}
|
|
68
|
+
/** Builds the shared envelope index in one pass over a run's messages. */
|
|
69
|
+
export declare function indexRun(envelopes: Envelope[]): RunIndex;
|
package/dist/report/model.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import type { Envelope } from '@cucumber/messages';
|
|
2
|
-
|
|
2
|
+
import { type AttachmentKind, type AttachmentTextFormat } from '../attachment.js';
|
|
3
|
+
import { type RunIndex } from './index-run.js';
|
|
4
|
+
import { type ReportStatus } from './status.js';
|
|
5
|
+
export type { ReportStatus } from './status.js';
|
|
3
6
|
export interface ReportAttachment {
|
|
4
7
|
fileName: string;
|
|
5
8
|
mediaType: string;
|
|
6
|
-
kind:
|
|
9
|
+
kind: AttachmentKind;
|
|
10
|
+
/** Internal text presentation; never written to HTML or the summary. */
|
|
11
|
+
textFormat: AttachmentTextFormat;
|
|
7
12
|
dataUri?: string;
|
|
8
13
|
text?: string;
|
|
9
14
|
bytes: number;
|
|
10
15
|
}
|
|
11
16
|
export interface ReportStep {
|
|
12
17
|
id: string;
|
|
18
|
+
order: number;
|
|
13
19
|
keyword: string;
|
|
14
20
|
text: string;
|
|
15
21
|
status: ReportStatus;
|
|
@@ -17,8 +23,67 @@ export interface ReportStep {
|
|
|
17
23
|
message?: string;
|
|
18
24
|
docString?: string;
|
|
19
25
|
dataTable?: string[][];
|
|
26
|
+
suggestions?: Array<{
|
|
27
|
+
language?: string;
|
|
28
|
+
code: string;
|
|
29
|
+
}>;
|
|
30
|
+
definitions?: Array<{
|
|
31
|
+
pattern: string;
|
|
32
|
+
source?: string;
|
|
33
|
+
}>;
|
|
34
|
+
parameters?: Array<{
|
|
35
|
+
start: number;
|
|
36
|
+
value: string;
|
|
37
|
+
type: string;
|
|
38
|
+
}>;
|
|
20
39
|
attachments: ReportAttachment[];
|
|
21
|
-
|
|
40
|
+
}
|
|
41
|
+
export interface ReportHook {
|
|
42
|
+
id: string;
|
|
43
|
+
order: number;
|
|
44
|
+
type: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
status: ReportStatus;
|
|
47
|
+
durationMs: number;
|
|
48
|
+
message?: string;
|
|
49
|
+
attachments: ReportAttachment[];
|
|
50
|
+
}
|
|
51
|
+
export interface ReportRunHook {
|
|
52
|
+
id: string;
|
|
53
|
+
type: string;
|
|
54
|
+
name?: string;
|
|
55
|
+
status: ReportStatus;
|
|
56
|
+
durationMs: number;
|
|
57
|
+
message?: string;
|
|
58
|
+
attachments: ReportAttachment[];
|
|
59
|
+
}
|
|
60
|
+
export interface ReportOutline {
|
|
61
|
+
id: string;
|
|
62
|
+
keyword: string;
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
tags: string[];
|
|
66
|
+
examplesId: string;
|
|
67
|
+
examplesKeyword: string;
|
|
68
|
+
examplesName: string;
|
|
69
|
+
examplesDescription: string;
|
|
70
|
+
examplesTags: string[];
|
|
71
|
+
examplesIndex: number;
|
|
72
|
+
exampleIndex: number;
|
|
73
|
+
}
|
|
74
|
+
export interface ReportBackground {
|
|
75
|
+
id: string;
|
|
76
|
+
keyword: string;
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ReportRule {
|
|
81
|
+
id: string;
|
|
82
|
+
keyword: string;
|
|
83
|
+
name: string;
|
|
84
|
+
description: string;
|
|
85
|
+
tags: string[];
|
|
86
|
+
backgrounds: ReportBackground[];
|
|
22
87
|
}
|
|
23
88
|
export interface ReportScenario {
|
|
24
89
|
id: string;
|
|
@@ -26,16 +91,28 @@ export interface ReportScenario {
|
|
|
26
91
|
keyword: string;
|
|
27
92
|
description: string;
|
|
28
93
|
uri: string;
|
|
94
|
+
/** Pickle location line; render metadata only, never in the summary. */
|
|
95
|
+
line?: number;
|
|
29
96
|
featureName: string;
|
|
30
97
|
ruleName?: string;
|
|
98
|
+
rule?: ReportRule;
|
|
31
99
|
status: ReportStatus;
|
|
100
|
+
/** True when the selected test case reported at least one raw result. */
|
|
101
|
+
executed: boolean;
|
|
32
102
|
durationMs: number;
|
|
33
103
|
attempt: number;
|
|
34
104
|
startedAt?: string;
|
|
105
|
+
/** Scenario tags from the AST; examples-block tags for outline rows. */
|
|
106
|
+
ownTags: string[];
|
|
107
|
+
/** Inherited pickle tags, kept for filtering and search. */
|
|
35
108
|
tags: string[];
|
|
109
|
+
outline?: ReportOutline;
|
|
36
110
|
steps: ReportStep[];
|
|
111
|
+
hooks: ReportHook[];
|
|
37
112
|
attachments: ReportAttachment[];
|
|
38
113
|
extraAttachments: ReportAttachment[];
|
|
114
|
+
/** Path attachments skipped outside the roots on this scenario's final attempt. */
|
|
115
|
+
skippedAttachments?: number;
|
|
39
116
|
}
|
|
40
117
|
export interface ReportFeature {
|
|
41
118
|
id: string;
|
|
@@ -44,6 +121,7 @@ export interface ReportFeature {
|
|
|
44
121
|
uri: string;
|
|
45
122
|
description: string;
|
|
46
123
|
tags: string[];
|
|
124
|
+
backgrounds: ReportBackground[];
|
|
47
125
|
status: ReportStatus;
|
|
48
126
|
durationMs: number;
|
|
49
127
|
scenarios: ReportScenario[];
|
|
@@ -58,15 +136,27 @@ export interface ReportCounts {
|
|
|
58
136
|
steps: Record<ReportStatus, number> & {
|
|
59
137
|
total: number;
|
|
60
138
|
};
|
|
139
|
+
hooks: Record<ReportStatus, number> & {
|
|
140
|
+
total: number;
|
|
141
|
+
};
|
|
61
142
|
attachments: number;
|
|
62
143
|
attachmentBytes: number;
|
|
63
144
|
}
|
|
145
|
+
export interface ReportCi {
|
|
146
|
+
name?: string;
|
|
147
|
+
url?: string;
|
|
148
|
+
remote?: string;
|
|
149
|
+
revision?: string;
|
|
150
|
+
branch?: string;
|
|
151
|
+
tag?: string;
|
|
152
|
+
}
|
|
64
153
|
export interface ReportEnvironment {
|
|
65
154
|
producer?: string;
|
|
66
155
|
runtime?: string;
|
|
67
156
|
os?: string;
|
|
68
157
|
cpu?: string;
|
|
69
158
|
protocol?: string;
|
|
159
|
+
ci?: ReportCi;
|
|
70
160
|
}
|
|
71
161
|
export interface ReportModel {
|
|
72
162
|
features: ReportFeature[];
|
|
@@ -77,8 +167,8 @@ export interface ReportModel {
|
|
|
77
167
|
source: string;
|
|
78
168
|
environment?: ReportEnvironment;
|
|
79
169
|
scenarios: ReportScenario[];
|
|
170
|
+
runHooks: ReportRunHook[];
|
|
80
171
|
runAttachments: ReportAttachment[];
|
|
81
172
|
}
|
|
82
|
-
|
|
83
|
-
export declare function
|
|
84
|
-
export declare function buildReportModel(envelopes: Envelope[], provenance?: Map<string, string>): ReportModel;
|
|
173
|
+
export declare function positiveLine(value: number | undefined): number | undefined;
|
|
174
|
+
export declare function buildReportModel(envelopes: Envelope[], provenance?: Map<string, string>, index?: RunIndex): ReportModel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ReportStatus = 'passed' | 'failed' | 'skipped' | 'pending' | 'undefined' | 'ambiguous' | 'unknown';
|
|
2
|
+
/** Raw Cucumber ordinal; the report comparator forces passed last. */
|
|
3
|
+
export declare function statusSeverity(status: ReportStatus): number;
|
|
4
|
+
export interface ExecutedStatus {
|
|
5
|
+
executed: boolean;
|
|
6
|
+
status: ReportStatus;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Worst status across executed rows only: passed when every executed row
|
|
10
|
+
* passed, unknown when nothing executed. Unexecuted rows never contribute.
|
|
11
|
+
*/
|
|
12
|
+
export declare function worstExecutedStatus(scenarios: readonly ExecutedStatus[]): ReportStatus;
|
package/dist/stream.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Transform, type TransformCallback } from 'node:stream';
|
|
2
|
+
import type { Envelope } from '@cucumber/messages';
|
|
3
|
+
import { type RenderReportOptions } from './options.js';
|
|
4
|
+
/**
|
|
5
|
+
* A `CucumberHtmlStream`-shaped adapter for Cucumber Messages. It collects
|
|
6
|
+
* envelopes and renders one HTML document on flush with the same options and
|
|
7
|
+
* renderer as `renderReport`.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CucumberHtmlStream extends Transform {
|
|
10
|
+
private readonly options;
|
|
11
|
+
private readonly envelopes;
|
|
12
|
+
constructor(options?: RenderReportOptions);
|
|
13
|
+
_transform(envelope: Envelope, _encoding: BufferEncoding, callback: TransformCallback): void;
|
|
14
|
+
_flush(callback: TransformCallback): void;
|
|
15
|
+
}
|