@allurereport/core 3.0.0-beta.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/dist/report.js ADDED
@@ -0,0 +1,188 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _AllureReport_instances, _AllureReport_reportUuid, _AllureReport_reportName, _AllureReport_store, _AllureReport_readers, _AllureReport_plugins, _AllureReport_reportFiles, _AllureReport_eventEmitter, _AllureReport_events, _AllureReport_qualityGate, _AllureReport_appendHistory, _AllureReport_historyPath, _AllureReport_realTime, _AllureReport_state, _AllureReport_stage, _AllureReport_update, _AllureReport_eachPlugin, _AllureReport_getPluginState;
13
+ import { allure1, allure2, attachments, junitXml } from "@allurereport/reader";
14
+ import { PathResultFile } from "@allurereport/reader-api";
15
+ import console from "node:console";
16
+ import { randomUUID } from "node:crypto";
17
+ import { EventEmitter } from "node:events";
18
+ import { readFileSync } from "node:fs";
19
+ import { opendir, realpath } from "node:fs/promises";
20
+ import { join, resolve } from "node:path";
21
+ import { createHistory, writeHistory } from "./history.js";
22
+ import { DefaultPluginState, PluginFiles } from "./plugin.js";
23
+ import { QualityGate } from "./qualityGate.js";
24
+ import { DefaultAllureStore } from "./store/store.js";
25
+ import { Events } from "./utils/event.js";
26
+ const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
27
+ const initRequired = "report is not initialised. Call the start() method first.";
28
+ export class AllureReport {
29
+ constructor(opts) {
30
+ _AllureReport_instances.add(this);
31
+ _AllureReport_reportUuid.set(this, void 0);
32
+ _AllureReport_reportName.set(this, void 0);
33
+ _AllureReport_store.set(this, void 0);
34
+ _AllureReport_readers.set(this, void 0);
35
+ _AllureReport_plugins.set(this, void 0);
36
+ _AllureReport_reportFiles.set(this, void 0);
37
+ _AllureReport_eventEmitter.set(this, void 0);
38
+ _AllureReport_events.set(this, void 0);
39
+ _AllureReport_qualityGate.set(this, void 0);
40
+ _AllureReport_appendHistory.set(this, void 0);
41
+ _AllureReport_historyPath.set(this, void 0);
42
+ _AllureReport_realTime.set(this, void 0);
43
+ _AllureReport_state.set(this, void 0);
44
+ _AllureReport_stage.set(this, "init");
45
+ this.readDirectory = async (resultsDir) => {
46
+ if (__classPrivateFieldGet(this, _AllureReport_stage, "f") !== "running") {
47
+ throw new Error(initRequired);
48
+ }
49
+ const resultsDirPath = resolve(resultsDir);
50
+ const dir = await opendir(resultsDirPath);
51
+ try {
52
+ for await (const dirent of dir) {
53
+ if (dirent.isFile()) {
54
+ const path = await realpath(join(dirent.parentPath, dirent.name));
55
+ await this.readResult(new PathResultFile(path, dirent.name));
56
+ }
57
+ }
58
+ }
59
+ catch (e) {
60
+ console.error("can't read directory", e);
61
+ }
62
+ };
63
+ this.readFile = async (resultsFile) => {
64
+ if (__classPrivateFieldGet(this, _AllureReport_stage, "f") !== "running") {
65
+ throw new Error(initRequired);
66
+ }
67
+ await this.readResult(new PathResultFile(resultsFile));
68
+ };
69
+ this.readResult = async (data) => {
70
+ if (__classPrivateFieldGet(this, _AllureReport_stage, "f") !== "running") {
71
+ throw new Error(initRequired);
72
+ }
73
+ for (const reader of __classPrivateFieldGet(this, _AllureReport_readers, "f")) {
74
+ try {
75
+ const processed = await reader.read(__classPrivateFieldGet(this, _AllureReport_store, "f"), data);
76
+ if (processed) {
77
+ return;
78
+ }
79
+ }
80
+ catch (ignored) { }
81
+ }
82
+ };
83
+ this.start = async () => {
84
+ if (__classPrivateFieldGet(this, _AllureReport_stage, "f") === "running") {
85
+ throw new Error("the report is already started");
86
+ }
87
+ if (__classPrivateFieldGet(this, _AllureReport_stage, "f") === "done") {
88
+ throw new Error("the report is already stopped, the restart isn't supported at the moment");
89
+ }
90
+ __classPrivateFieldSet(this, _AllureReport_stage, "running", "f");
91
+ await __classPrivateFieldGet(this, _AllureReport_eachPlugin, "f").call(this, true, async (plugin, context) => {
92
+ await plugin.start?.(context, __classPrivateFieldGet(this, _AllureReport_store, "f"), __classPrivateFieldGet(this, _AllureReport_events, "f"));
93
+ });
94
+ if (__classPrivateFieldGet(this, _AllureReport_realTime, "f")) {
95
+ await __classPrivateFieldGet(this, _AllureReport_update, "f").call(this);
96
+ __classPrivateFieldGet(this, _AllureReport_events, "f").onAll(async () => {
97
+ await __classPrivateFieldGet(this, _AllureReport_update, "f").call(this);
98
+ });
99
+ }
100
+ };
101
+ _AllureReport_update.set(this, async () => {
102
+ if (__classPrivateFieldGet(this, _AllureReport_stage, "f") !== "running") {
103
+ return;
104
+ }
105
+ await __classPrivateFieldGet(this, _AllureReport_eachPlugin, "f").call(this, false, async (plugin, context) => {
106
+ await plugin.update?.(context, __classPrivateFieldGet(this, _AllureReport_store, "f"));
107
+ });
108
+ });
109
+ this.done = async () => {
110
+ if (__classPrivateFieldGet(this, _AllureReport_stage, "f") !== "running") {
111
+ throw new Error(initRequired);
112
+ }
113
+ __classPrivateFieldGet(this, _AllureReport_events, "f").offAll();
114
+ __classPrivateFieldSet(this, _AllureReport_stage, "done", "f");
115
+ await __classPrivateFieldGet(this, _AllureReport_eachPlugin, "f").call(this, false, async (plugin, context) => {
116
+ await plugin.done?.(context, __classPrivateFieldGet(this, _AllureReport_store, "f"));
117
+ });
118
+ if (__classPrivateFieldGet(this, _AllureReport_appendHistory, "f")) {
119
+ const testResults = await __classPrivateFieldGet(this, _AllureReport_store, "f").allTestResults();
120
+ const testCases = await __classPrivateFieldGet(this, _AllureReport_store, "f").allTestCases();
121
+ const historyDataPoint = createHistory(__classPrivateFieldGet(this, _AllureReport_reportUuid, "f"), __classPrivateFieldGet(this, _AllureReport_reportName, "f"), testCases, testResults);
122
+ await writeHistory(__classPrivateFieldGet(this, _AllureReport_historyPath, "f"), historyDataPoint);
123
+ }
124
+ };
125
+ _AllureReport_eachPlugin.set(this, async (initState, consumer) => {
126
+ if (initState) {
127
+ __classPrivateFieldSet(this, _AllureReport_state, {}, "f");
128
+ }
129
+ for (let descriptor of __classPrivateFieldGet(this, _AllureReport_plugins, "f")) {
130
+ if (!descriptor.enabled) {
131
+ continue;
132
+ }
133
+ const id = descriptor.id;
134
+ const plugin = descriptor.plugin;
135
+ const pluginState = __classPrivateFieldGet(this, _AllureReport_instances, "m", _AllureReport_getPluginState).call(this, initState, id);
136
+ if (!pluginState) {
137
+ console.error("plugin error: state is empty");
138
+ continue;
139
+ }
140
+ const pluginFiles = new PluginFiles(__classPrivateFieldGet(this, _AllureReport_reportFiles, "f"), id);
141
+ const pluginContext = {
142
+ allureVersion: version,
143
+ reportUuid: __classPrivateFieldGet(this, _AllureReport_reportUuid, "f"),
144
+ reportName: __classPrivateFieldGet(this, _AllureReport_reportName, "f"),
145
+ state: pluginState,
146
+ reportFiles: pluginFiles,
147
+ };
148
+ try {
149
+ await consumer.call(this, plugin, pluginContext);
150
+ if (initState) {
151
+ __classPrivateFieldGet(this, _AllureReport_state, "f")[id] = pluginState;
152
+ }
153
+ }
154
+ catch (e) {
155
+ console.error(`plugin ${id} error`, e);
156
+ }
157
+ }
158
+ });
159
+ this.validate = async () => {
160
+ await __classPrivateFieldGet(this, _AllureReport_qualityGate, "f").validate(__classPrivateFieldGet(this, _AllureReport_store, "f"));
161
+ };
162
+ const { name, readers = [allure1, allure2, junitXml, attachments], plugins = [], history, known, reportFiles, qualityGate, realTime, appendHistory, historyPath, } = opts;
163
+ __classPrivateFieldSet(this, _AllureReport_reportUuid, randomUUID(), "f");
164
+ __classPrivateFieldSet(this, _AllureReport_reportName, name, "f");
165
+ __classPrivateFieldSet(this, _AllureReport_eventEmitter, new EventEmitter(), "f");
166
+ __classPrivateFieldSet(this, _AllureReport_events, new Events(__classPrivateFieldGet(this, _AllureReport_eventEmitter, "f")), "f");
167
+ __classPrivateFieldSet(this, _AllureReport_realTime, realTime, "f");
168
+ __classPrivateFieldSet(this, _AllureReport_appendHistory, appendHistory ?? true, "f");
169
+ __classPrivateFieldSet(this, _AllureReport_historyPath, historyPath ?? "./.allure/history.jsonl", "f");
170
+ __classPrivateFieldSet(this, _AllureReport_store, new DefaultAllureStore(history, known, __classPrivateFieldGet(this, _AllureReport_eventEmitter, "f")), "f");
171
+ __classPrivateFieldSet(this, _AllureReport_readers, [...readers], "f");
172
+ __classPrivateFieldSet(this, _AllureReport_plugins, [...plugins], "f");
173
+ __classPrivateFieldSet(this, _AllureReport_reportFiles, reportFiles, "f");
174
+ __classPrivateFieldSet(this, _AllureReport_qualityGate, new QualityGate(qualityGate), "f");
175
+ }
176
+ get store() {
177
+ return __classPrivateFieldGet(this, _AllureReport_store, "f");
178
+ }
179
+ get exitCode() {
180
+ return __classPrivateFieldGet(this, _AllureReport_qualityGate, "f").exitCode;
181
+ }
182
+ get validationResults() {
183
+ return __classPrivateFieldGet(this, _AllureReport_qualityGate, "f").result;
184
+ }
185
+ }
186
+ _AllureReport_reportUuid = new WeakMap(), _AllureReport_reportName = new WeakMap(), _AllureReport_store = new WeakMap(), _AllureReport_readers = new WeakMap(), _AllureReport_plugins = new WeakMap(), _AllureReport_reportFiles = new WeakMap(), _AllureReport_eventEmitter = new WeakMap(), _AllureReport_events = new WeakMap(), _AllureReport_qualityGate = new WeakMap(), _AllureReport_appendHistory = new WeakMap(), _AllureReport_historyPath = new WeakMap(), _AllureReport_realTime = new WeakMap(), _AllureReport_state = new WeakMap(), _AllureReport_stage = new WeakMap(), _AllureReport_update = new WeakMap(), _AllureReport_eachPlugin = new WeakMap(), _AllureReport_instances = new WeakSet(), _AllureReport_getPluginState = function _AllureReport_getPluginState(init, id) {
187
+ return init ? new DefaultPluginState({}) : __classPrivateFieldGet(this, _AllureReport_state, "f")?.[id];
188
+ };
@@ -0,0 +1,10 @@
1
+ import { AttachmentLink, TestCase, TestFixtureResult, TestResult } from "@allurereport/core-api";
2
+ import { RawFixtureResult, RawTestResult, ReaderContext } from "@allurereport/reader-api";
3
+ export declare const __unknown = "#___unknown_value___#";
4
+ export type StateData = {
5
+ testCases: Map<string, TestCase>;
6
+ attachments: Map<string, AttachmentLink>;
7
+ visitAttachmentLink: (link: AttachmentLink) => void;
8
+ };
9
+ export declare const testFixtureResultRawToState: (stateData: Pick<StateData, "attachments" | "visitAttachmentLink">, raw: RawFixtureResult, context: ReaderContext) => TestFixtureResult;
10
+ export declare const testResultRawToState: (stateData: StateData, raw: RawTestResult, context: ReaderContext) => TestResult;
@@ -0,0 +1,254 @@
1
+ import { notNull, } from "@allurereport/core-api";
2
+ import { findByLabelName } from "@allurereport/core-api";
3
+ import { md5 } from "@allurereport/plugin-api";
4
+ import MarkdownIt from "markdown-it";
5
+ import { randomUUID } from "node:crypto";
6
+ import { extname } from "node:path";
7
+ const defaultStatus = "unknown";
8
+ export const __unknown = "#___unknown_value___#";
9
+ export const testFixtureResultRawToState = (stateData, raw, context) => {
10
+ const name = raw.name || "Unknown test";
11
+ return {
12
+ id: md5(raw.uuid || randomUUID()),
13
+ testResultIds: raw.testResults?.filter(notNull).map(md5) ?? [],
14
+ type: raw.type,
15
+ name,
16
+ status: raw.status ?? defaultStatus,
17
+ message: raw.message,
18
+ trace: raw.trace,
19
+ ...processTimings(raw),
20
+ steps: convertSteps(stateData, raw.steps),
21
+ sourceMetadata: {
22
+ readerId: context.readerId,
23
+ metadata: context.metadata ?? {},
24
+ },
25
+ };
26
+ };
27
+ export const testResultRawToState = (stateData, raw, context) => {
28
+ const labels = convertLabels(raw.labels);
29
+ const hostId = findByLabelName(labels, "host");
30
+ const threadId = findByLabelName(labels, "thread");
31
+ const name = raw.name || "Unknown test";
32
+ const testCase = processTestCase(stateData, raw);
33
+ const parameters = convertParameters(raw.parameters);
34
+ return {
35
+ id: md5(raw.uuid || randomUUID()),
36
+ name,
37
+ testCase,
38
+ fullName: raw.fullName,
39
+ historyId: calculateHistoryId(testCase, parameters),
40
+ status: raw.status ?? defaultStatus,
41
+ message: raw.message,
42
+ trace: raw.trace,
43
+ ...processTimings(raw),
44
+ description: raw.description,
45
+ descriptionHtml: raw.descriptionHtml ?? markdownToHtml(raw.description),
46
+ precondition: raw.precondition,
47
+ preconditionHtml: raw.preconditionHtml ?? markdownToHtml(raw.precondition),
48
+ expectedResult: raw.expectedResult,
49
+ expectedResultHtml: raw.expectedResultHtml ?? markdownToHtml(raw.expectedResult),
50
+ flaky: raw.flaky ?? false,
51
+ muted: raw.muted ?? false,
52
+ known: raw.known ?? false,
53
+ hidden: false,
54
+ labels,
55
+ steps: convertSteps(stateData, raw.steps),
56
+ parameters,
57
+ links: convertLinks(raw.links),
58
+ hostId,
59
+ threadId,
60
+ sourceMetadata: {
61
+ readerId: context.readerId,
62
+ metadata: context.metadata ?? {},
63
+ },
64
+ };
65
+ };
66
+ const processTestCase = ({ testCases }, raw) => {
67
+ const [id, allureId] = calculateTestId(raw);
68
+ if (id) {
69
+ const maybeTestCase = testCases.get(id);
70
+ if (maybeTestCase) {
71
+ return maybeTestCase;
72
+ }
73
+ const testCase = {
74
+ id,
75
+ allureId,
76
+ name: raw.testCaseName ?? raw.name ?? __unknown,
77
+ fullName: raw.fullName,
78
+ };
79
+ testCases.set(id, testCase);
80
+ return testCase;
81
+ }
82
+ return undefined;
83
+ };
84
+ const createAttachmentStep = (link) => {
85
+ return {
86
+ link,
87
+ type: "attachment",
88
+ };
89
+ };
90
+ const processAttachmentLink = ({ attachments, visitAttachmentLink }, attach) => {
91
+ if (!attach.originalFileName) {
92
+ return createAttachmentStep({
93
+ id: randomUUID(),
94
+ originalFileName: undefined,
95
+ contentType: attach.contentType,
96
+ ext: "",
97
+ name: attach.name ?? __unknown,
98
+ missed: true,
99
+ used: true,
100
+ });
101
+ }
102
+ const id = md5(attach.originalFileName);
103
+ let previous = attachments.get(id);
104
+ if (!previous) {
105
+ const link = {
106
+ id,
107
+ originalFileName: attach.originalFileName,
108
+ ext: extname(attach.originalFileName),
109
+ name: attach.name ?? attach.originalFileName,
110
+ contentType: attach.contentType,
111
+ used: true,
112
+ missed: true,
113
+ };
114
+ attachments.set(id, link);
115
+ visitAttachmentLink(link);
116
+ return createAttachmentStep(link);
117
+ }
118
+ if (previous.used) {
119
+ return createAttachmentStep({
120
+ id: randomUUID(),
121
+ originalFileName: undefined,
122
+ ext: "",
123
+ name: attach.name ?? attach.originalFileName ?? __unknown,
124
+ contentType: attach.contentType,
125
+ missed: true,
126
+ used: true,
127
+ });
128
+ }
129
+ const link = {
130
+ ...previous,
131
+ id,
132
+ name: attach.name ?? previous.originalFileName,
133
+ contentType: attach.contentType ?? previous.contentType,
134
+ contentLength: previous.contentLength,
135
+ used: true,
136
+ missed: false,
137
+ };
138
+ attachments.set(id, link);
139
+ visitAttachmentLink(link);
140
+ return createAttachmentStep(link);
141
+ };
142
+ const processTimings = ({ start, stop, duration, }) => {
143
+ const effectiveDuration = duration ? Math.max(0, duration) : 0;
144
+ if (start !== undefined) {
145
+ if (stop !== undefined) {
146
+ if (stop < start) {
147
+ return { start, stop: start, duration: 0 };
148
+ }
149
+ return { start, stop, duration: stop - start };
150
+ }
151
+ return { start, stop: start + effectiveDuration, duration: effectiveDuration };
152
+ }
153
+ if (stop !== undefined) {
154
+ return { start: stop - effectiveDuration, stop, duration: effectiveDuration };
155
+ }
156
+ return { start: undefined, stop: undefined, duration };
157
+ };
158
+ const convertLabels = (labels) => {
159
+ return labels?.filter(notNull)?.map(convertLabel)?.flatMap(processTagLabels) ?? [];
160
+ };
161
+ const convertLabel = (label) => {
162
+ return {
163
+ name: label.name ?? __unknown,
164
+ value: label.value,
165
+ };
166
+ };
167
+ const convertSteps = (stateData, steps) => steps?.filter(notNull)?.map((step) => convertStep(stateData, step)) ?? [];
168
+ const convertStep = (stateData, step) => {
169
+ if (step.type === "step") {
170
+ return {
171
+ name: step.name ?? __unknown,
172
+ status: step.status ?? defaultStatus,
173
+ steps: convertSteps(stateData, step.steps),
174
+ parameters: convertParameters(step.parameters),
175
+ ...processTimings(step),
176
+ type: "step",
177
+ };
178
+ }
179
+ return {
180
+ ...processAttachmentLink(stateData, step),
181
+ };
182
+ };
183
+ const convertParameters = (parameters) => parameters
184
+ ?.filter(notNull)
185
+ ?.filter((p) => p.name)
186
+ ?.map(convertParameter) ?? [];
187
+ const convertParameter = (param) => ({
188
+ name: param.name ?? __unknown,
189
+ value: param.value ?? __unknown,
190
+ hidden: param.hidden ?? false,
191
+ excluded: param.excluded ?? false,
192
+ masked: param.masked ?? false,
193
+ });
194
+ const convertLinks = (links) => links
195
+ ?.filter(notNull)
196
+ ?.filter((l) => l.url)
197
+ ?.map(convertLink) ?? [];
198
+ const convertLink = (link) => ({
199
+ name: link.name,
200
+ url: link.url ?? __unknown,
201
+ type: link.type,
202
+ });
203
+ const markdownToHtml = (value) => (value ? new MarkdownIt().render(value) : undefined);
204
+ const calculateTestId = (raw) => {
205
+ const maybeAllureId = raw.labels?.find((label) => label.name === "ALLURE_ID" || label.name === "AS_ID")?.value;
206
+ if (maybeAllureId) {
207
+ return [md5(`ALLURE_ID=${maybeAllureId}`), maybeAllureId];
208
+ }
209
+ if (raw.testId) {
210
+ return [md5(raw.testId), undefined];
211
+ }
212
+ if (raw.fullName) {
213
+ return [md5(raw.fullName), undefined];
214
+ }
215
+ return [undefined, undefined];
216
+ };
217
+ const calculateHistoryId = (testCase, parameters) => {
218
+ if (!testCase) {
219
+ return undefined;
220
+ }
221
+ const paramsPart = stringifyParams(parameters);
222
+ return `${testCase.id}.${md5(paramsPart)}`;
223
+ };
224
+ const parametersCompare = (a, b) => {
225
+ return (a.name ?? "").localeCompare(b.name) || a.value.localeCompare(b.value ?? "");
226
+ };
227
+ const stringifyParams = (parameters) => {
228
+ if (!parameters) {
229
+ return "";
230
+ }
231
+ return parameters
232
+ .filter((p) => !p?.excluded)
233
+ .sort(parametersCompare)
234
+ .map((p) => `${p.name}:${p.value}`)
235
+ .join(",");
236
+ };
237
+ const idLabelMatcher = new RegExp("^@?allure\\.id[:=](?<id>.+)$");
238
+ const tagLabelMatcher = new RegExp("^@?allure\\.label\\.(?<name>.+)[:=](?<value>.+)$");
239
+ const processTagLabels = (label) => {
240
+ if (label.name === "tag" && label.value) {
241
+ const matchTag = label.value.match(idLabelMatcher);
242
+ if (matchTag) {
243
+ const id = matchTag?.groups?.["id"];
244
+ return id ? [{ name: "ALLURE_ID", value: id }] : [];
245
+ }
246
+ const matchLabel = label.value.match(tagLabelMatcher);
247
+ if (matchLabel) {
248
+ const name = matchLabel?.groups?.["name"];
249
+ const value = matchLabel?.groups?.["value"];
250
+ return name && value ? [{ name, value }] : [];
251
+ }
252
+ }
253
+ return label.name ? [{ name: label.name, value: label.value }] : [];
254
+ };
@@ -0,0 +1,49 @@
1
+ import { AttachmentLink, HistoryDataPoint, HistoryTestResult, KnownTestFailure, Statistic, TestCase, TestFixtureResult, TestResult } from "@allurereport/core-api";
2
+ import { AllureStore, ResultFile } from "@allurereport/plugin-api";
3
+ import type { RawFixtureResult, RawMetadata, RawTestResult, ReaderContext, ResultsVisitor } from "@allurereport/reader-api";
4
+ import { EventEmitter } from "node:events";
5
+ import { AllureStoreEvents } from "../utils/event.js";
6
+ export declare class DefaultAllureStore implements AllureStore, ResultsVisitor {
7
+ #private;
8
+ readonly indexTestResultByTestCase: Map<string, TestResult[]>;
9
+ readonly indexLatestTestResultByHistoryId: Map<string, TestResult>;
10
+ readonly indexTestResultByHistoryId: Map<string, TestResult[]>;
11
+ readonly indexAttachmentByTestResult: Map<string, AttachmentLink[]>;
12
+ readonly indexAttachmentByFixture: Map<string, AttachmentLink[]>;
13
+ readonly indexFixturesByTestResult: Map<string, TestFixtureResult[]>;
14
+ readonly indexKnownByHistoryId: Map<string, KnownTestFailure[]>;
15
+ constructor(history?: HistoryDataPoint[], known?: KnownTestFailure[], eventEmitter?: EventEmitter<AllureStoreEvents>);
16
+ visitTestResult(raw: RawTestResult, context: ReaderContext): Promise<void>;
17
+ visitTestFixtureResult(result: RawFixtureResult, context: ReaderContext): Promise<void>;
18
+ visitAttachmentFile(resultFile: ResultFile, context: ReaderContext): Promise<void>;
19
+ visitMetadata(metadata: RawMetadata, context: ReaderContext): Promise<void>;
20
+ allTestCases(): Promise<TestCase[]>;
21
+ allTestResults(options?: {
22
+ includeHidden: boolean;
23
+ }): Promise<TestResult[]>;
24
+ allAttachments(options?: {
25
+ includeMissed?: boolean;
26
+ includeUnused?: boolean;
27
+ }): Promise<AttachmentLink[]>;
28
+ allMetadata(): Promise<Record<string, any>>;
29
+ allFixtures(): Promise<TestFixtureResult[]>;
30
+ allHistoryDataPoints(): Promise<HistoryDataPoint[]>;
31
+ allKnownIssues(): Promise<KnownTestFailure[]>;
32
+ testCaseById(tcId: string): Promise<TestCase | undefined>;
33
+ testResultById(trId: string): Promise<TestResult | undefined>;
34
+ attachmentById(attachmentId: string): Promise<AttachmentLink | undefined>;
35
+ attachmentContentById(attachmentId: string): Promise<ResultFile | undefined>;
36
+ metadataByKey<T>(key: string): Promise<T | undefined>;
37
+ testResultsByTcId(tcId: string): Promise<TestResult[]>;
38
+ attachmentsByTrId(trId: string): Promise<AttachmentLink[]>;
39
+ retriesByTrId(trId: string): Promise<TestResult[]>;
40
+ historyByTrId(trId: string): Promise<HistoryTestResult[]>;
41
+ fixturesByTrId(trId: string): Promise<TestFixtureResult[]>;
42
+ failedTestResults(): Promise<TestResult[]>;
43
+ unknownFailedTestResults(): Promise<TestResult[]>;
44
+ testResultsByLabel(labelName: string): Promise<{
45
+ [x: string]: TestResult[];
46
+ _: TestResult[];
47
+ }>;
48
+ testsStatistic(): Promise<Statistic>;
49
+ }