@allurereport/plugin-classic 3.0.0-beta.8 → 3.0.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/README.md +4 -1
- package/dist/categories.d.ts +7 -6
- package/dist/converters.d.ts +5 -11
- package/dist/converters.js +44 -174
- package/dist/generators.d.ts +15 -31
- package/dist/generators.js +202 -216
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -2
- package/dist/model.d.ts +18 -138
- package/dist/model.js +1 -2
- package/dist/plugin.d.ts +7 -5
- package/dist/plugin.js +79 -53
- package/dist/writer.d.ts +9 -9
- package/dist/writer.js +8 -7
- package/package.json +11 -8
- package/dist/tree.d.ts +0 -44
- package/dist/tree.js +0 -112
- package/dist/utils.d.ts +0 -8
- package/dist/utils.js +0 -43
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
## Overview
|
|
14
14
|
|
|
15
|
-
The plugin generates
|
|
15
|
+
The plugin generates brand new Allure Report with modern design and new features.
|
|
16
16
|
|
|
17
17
|
## Install
|
|
18
18
|
|
|
@@ -51,4 +51,7 @@ The plugin accepts the following options:
|
|
|
51
51
|
|------------------|-------------------------------------------------|--------------------------------------------------------------|-----------------|
|
|
52
52
|
| `reportName` | Name of the report | `string` | `Allure Report` |
|
|
53
53
|
| `singleFile` | Writes the report as a single `index.html` file | `boolean` | `false` |
|
|
54
|
+
| `logo` | Path to the logo image | `string` | `null` |
|
|
55
|
+
| `theme` | Default color theme of the report | `light \| dark` | OS theme |
|
|
54
56
|
| `reportLanguage` | Default language of the report | `string` | OS language |
|
|
57
|
+
| `ci` | CI data which will be rendered in the report | `{ type: "github" \| "jenkins", url: string, name: string }` | `undefined` |
|
package/dist/categories.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { TestStatus } from "@allurereport/core-api";
|
|
2
|
+
import type { ClassicCategory } from "./model.js";
|
|
3
|
+
export declare const matchCategories: (categories: ClassicCategory[], result: {
|
|
4
|
+
message?: string;
|
|
5
|
+
trace?: string;
|
|
6
|
+
status: TestStatus;
|
|
6
7
|
flaky: boolean;
|
|
7
|
-
}) =>
|
|
8
|
+
}) => ClassicCategory[];
|
package/dist/converters.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
categories: Allure2Category[];
|
|
7
|
-
retries: TestResult[];
|
|
8
|
-
history: HistoryTestResult[];
|
|
9
|
-
};
|
|
10
|
-
export declare const convertTestResult: (context: ConvertContext, test: TestResult) => Allure2TestResult;
|
|
11
|
-
export {};
|
|
1
|
+
import type { TestFixtureResult, TestResult, TestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import type { ClassicFixtureResult, ClassicTestResult, ClassicTestStepResult } from "@allurereport/web-classic";
|
|
3
|
+
export declare const convertTestResult: (tr: TestResult) => ClassicTestResult;
|
|
4
|
+
export declare const convertTestStepResult: (tsr: TestStepResult) => ClassicTestStepResult;
|
|
5
|
+
export declare const convertFixtureResult: (fr: TestFixtureResult) => ClassicFixtureResult;
|
package/dist/converters.js
CHANGED
|
@@ -1,182 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
name: "test",
|
|
10
|
-
steps: result.steps,
|
|
11
|
-
start: result.start,
|
|
12
|
-
stop: result.stop,
|
|
13
|
-
duration: result.duration,
|
|
14
|
-
status: result.status,
|
|
15
|
-
parameters: [],
|
|
16
|
-
type: "step",
|
|
17
|
-
});
|
|
18
|
-
return testStage;
|
|
1
|
+
const mapLabelsByName = (labels) => {
|
|
2
|
+
return labels.reduce((acc, { name, value }) => {
|
|
3
|
+
acc[name] = acc[name] || [];
|
|
4
|
+
if (value) {
|
|
5
|
+
acc[name].push(value);
|
|
6
|
+
}
|
|
7
|
+
return acc;
|
|
8
|
+
}, {});
|
|
19
9
|
};
|
|
20
|
-
const
|
|
21
|
-
if (isStep(step)) {
|
|
22
|
-
const name = step.name;
|
|
23
|
-
const steps = step.steps.map((child) => convertStep(context, child));
|
|
24
|
-
const stepsCount = steps.length;
|
|
25
|
-
const parameters = step.parameters;
|
|
26
|
-
const parametersCount = parameters.length;
|
|
27
|
-
const statusMessage = step.error?.message;
|
|
28
|
-
const shouldDisplayMessage = !!statusMessage || steps.findIndex((s) => s.statusMessage === statusMessage) > 0;
|
|
29
|
-
return {
|
|
30
|
-
name,
|
|
31
|
-
time: {
|
|
32
|
-
start: step.start,
|
|
33
|
-
stop: step.stop,
|
|
34
|
-
duration: step.duration,
|
|
35
|
-
},
|
|
36
|
-
status: step.status,
|
|
37
|
-
statusMessage,
|
|
38
|
-
statusTrace: step.error?.trace,
|
|
39
|
-
steps,
|
|
40
|
-
attachments: [],
|
|
41
|
-
parameters,
|
|
42
|
-
stepsCount,
|
|
43
|
-
attachmentsCount: 0,
|
|
44
|
-
hasContent: stepsCount + parametersCount > 0 || shouldDisplayMessage,
|
|
45
|
-
shouldDisplayMessage,
|
|
46
|
-
attachmentStep: false,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const stepName = step.link.name;
|
|
10
|
+
export const convertTestResult = (tr) => {
|
|
50
11
|
return {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
12
|
+
id: tr.id,
|
|
13
|
+
name: tr.name,
|
|
14
|
+
start: tr.start,
|
|
15
|
+
stop: tr.stop,
|
|
16
|
+
duration: tr.duration,
|
|
17
|
+
status: tr.status,
|
|
18
|
+
fullName: tr.fullName,
|
|
19
|
+
historyId: tr.historyId,
|
|
20
|
+
flaky: tr.flaky,
|
|
21
|
+
muted: tr.muted,
|
|
22
|
+
known: tr.known,
|
|
23
|
+
hidden: tr.hidden,
|
|
24
|
+
labels: tr.labels,
|
|
25
|
+
groupedLabels: mapLabelsByName(tr.labels),
|
|
26
|
+
parameters: tr.parameters,
|
|
27
|
+
links: tr.links,
|
|
28
|
+
steps: tr.steps,
|
|
29
|
+
error: tr.error,
|
|
30
|
+
testCase: tr.testCase,
|
|
31
|
+
setup: [],
|
|
32
|
+
teardown: [],
|
|
33
|
+
history: [],
|
|
34
|
+
retries: [],
|
|
35
|
+
breadcrumbs: [],
|
|
36
|
+
retry: false,
|
|
37
|
+
transition: tr.transition,
|
|
66
38
|
};
|
|
67
39
|
};
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
name: link.name,
|
|
71
|
-
source: context.attachmentMap.get(link.id) ?? link.originalFileName,
|
|
72
|
-
type: link.contentType,
|
|
73
|
-
size: !link.missed ? link.contentLength : undefined,
|
|
74
|
-
});
|
|
75
|
-
const findAllLabels = (test, labelName) => {
|
|
76
|
-
return test.labels
|
|
77
|
-
.filter((label) => label.name === labelName)
|
|
78
|
-
.map((label) => label.value)
|
|
79
|
-
.filter((value) => value)
|
|
80
|
-
.map((value) => value);
|
|
40
|
+
export const convertTestStepResult = (tsr) => {
|
|
41
|
+
return tsr;
|
|
81
42
|
};
|
|
82
|
-
const
|
|
83
|
-
return test.labels.find((label) => label.name === labelName)?.value;
|
|
84
|
-
};
|
|
85
|
-
const extractSeverity = (test) => {
|
|
86
|
-
const maybeSeverity = findLabelValue(test, "severity")?.toLowerCase();
|
|
87
|
-
return (maybeSeverity ? severityValues.find((value) => value === maybeSeverity) : undefined) ?? "normal";
|
|
88
|
-
};
|
|
89
|
-
const importantStatuses = ["failed", "broken", "passed"];
|
|
90
|
-
export const convertTestResult = (context, test) => {
|
|
91
|
-
const testStage = convertStageResult(context, test);
|
|
92
|
-
const beforeStages = context.fixtures
|
|
93
|
-
.filter((value) => value.type === "before")
|
|
94
|
-
.map((fixture) => convertStageResult(context, fixture))
|
|
95
|
-
.sort(sortByTime);
|
|
96
|
-
const afterStages = context.fixtures
|
|
97
|
-
.filter((value) => value.type === "after")
|
|
98
|
-
.map((fixture) => convertStageResult(context, fixture))
|
|
99
|
-
.sort(sortByTime);
|
|
100
|
-
const owner = findLabelValue(test, "owner");
|
|
101
|
-
const severity = extractSeverity(test);
|
|
102
|
-
const tags = findAllLabels(test, "tag");
|
|
103
|
-
const status = convertStatus(test.status);
|
|
104
|
-
const statusMessage = test.error?.message;
|
|
105
|
-
const statusTrace = test.error?.trace;
|
|
106
|
-
const flaky = false;
|
|
107
|
-
const categories = matchCategories(context.categories, { statusMessage, statusTrace, status, flaky });
|
|
108
|
-
const retries = context.retries.map((retry) => ({
|
|
109
|
-
uid: retry.id,
|
|
110
|
-
status: convertStatus(retry.status),
|
|
111
|
-
statusDetails: retry?.error?.message,
|
|
112
|
-
time: {
|
|
113
|
-
start: retry.start,
|
|
114
|
-
stop: retry.stop,
|
|
115
|
-
duration: retry.duration,
|
|
116
|
-
},
|
|
117
|
-
}));
|
|
118
|
-
const retriesStatusChange = status in importantStatuses &&
|
|
119
|
-
retries.find((tr) => tr.status in importantStatuses && tr.status !== status) !== undefined;
|
|
120
|
-
const lastHistoryStatus = context.history.find(filterIncludedInSuccessRate)?.status;
|
|
121
|
-
const newFailed = lastHistoryStatus === "passed" && test.status === "failed";
|
|
122
|
-
const newBroken = lastHistoryStatus === "passed" && test.status === "broken";
|
|
123
|
-
const newPassed = lastHistoryStatus !== undefined && lastHistoryStatus !== "passed" && test.status === "passed";
|
|
124
|
-
const historyItems = context.history.map((htr) => ({
|
|
125
|
-
uid: htr.id,
|
|
126
|
-
status: convertStatus(htr.status),
|
|
127
|
-
reportUrl: "unsupported",
|
|
128
|
-
statusDetails: htr.error?.message,
|
|
129
|
-
time: {
|
|
130
|
-
start: htr.start,
|
|
131
|
-
stop: htr.stop,
|
|
132
|
-
duration: htr.duration,
|
|
133
|
-
},
|
|
134
|
-
}));
|
|
135
|
-
const statistic = { total: 0 };
|
|
136
|
-
historyItems.forEach((historyItem) => updateStatistic(statistic, historyItem));
|
|
137
|
-
const history = {
|
|
138
|
-
statistic,
|
|
139
|
-
items: historyItems,
|
|
140
|
-
};
|
|
43
|
+
export const convertFixtureResult = (fr) => {
|
|
141
44
|
return {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
start: test.start,
|
|
149
|
-
stop: test.stop,
|
|
150
|
-
duration: test.duration,
|
|
151
|
-
},
|
|
152
|
-
status,
|
|
153
|
-
description: test.description,
|
|
154
|
-
descriptionHtml: test.descriptionHtml,
|
|
155
|
-
statusMessage,
|
|
156
|
-
statusTrace,
|
|
157
|
-
labels: test.labels,
|
|
158
|
-
links: test.links,
|
|
159
|
-
parameters: test.parameters,
|
|
160
|
-
afterStages,
|
|
161
|
-
beforeStages,
|
|
162
|
-
testStage: testStage,
|
|
163
|
-
flaky,
|
|
164
|
-
hidden: test.hidden,
|
|
165
|
-
newFailed,
|
|
166
|
-
newBroken,
|
|
167
|
-
newPassed,
|
|
168
|
-
retry: test.hidden,
|
|
169
|
-
retriesStatusChange,
|
|
170
|
-
retriesCount: retries.length,
|
|
171
|
-
hostId: test.hostId,
|
|
172
|
-
threadId: test.threadId,
|
|
173
|
-
extra: {
|
|
174
|
-
owner,
|
|
175
|
-
severity,
|
|
176
|
-
tags,
|
|
177
|
-
categories,
|
|
178
|
-
retries,
|
|
179
|
-
history,
|
|
180
|
-
},
|
|
45
|
+
id: fr.id,
|
|
46
|
+
type: fr.type,
|
|
47
|
+
name: fr.name,
|
|
48
|
+
status: fr.status,
|
|
49
|
+
steps: fr.steps.map(convertTestStepResult),
|
|
50
|
+
duration: fr.duration,
|
|
181
51
|
};
|
|
182
52
|
};
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
1
|
+
import { type AttachmentLink, type EnvironmentItem, type Statistic } from "@allurereport/core-api";
|
|
2
|
+
import { type AllureStore, type ReportFiles, type ResultFile } from "@allurereport/plugin-api";
|
|
3
|
+
import type { ClassicTestResult } from "@allurereport/web-classic";
|
|
4
|
+
import type { ClassicOptions, TemplateManifest } from "./model.js";
|
|
5
|
+
import type { ClassicDataWriter, ReportFile } from "./writer.js";
|
|
6
6
|
export declare const readTemplateManifest: (singleFileMode?: boolean) => Promise<TemplateManifest>;
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const generateStaticFiles: (payload: {
|
|
7
|
+
export declare const generateTestResults: (writer: ClassicDataWriter, store: AllureStore) => Promise<ClassicTestResult[]>;
|
|
8
|
+
export declare const generateTree: (writer: ClassicDataWriter, treeName: string, labels: string[], tests: ClassicTestResult[]) => Promise<void>;
|
|
9
|
+
export declare const generateEnvironmentJson: (writer: ClassicDataWriter, env: EnvironmentItem[]) => Promise<void>;
|
|
10
|
+
export declare const generateStatistic: (writer: ClassicDataWriter, statistic: Statistic) => Promise<void>;
|
|
11
|
+
export declare const generatePieChart: (writer: ClassicDataWriter, statistic: Statistic) => Promise<void>;
|
|
12
|
+
export declare const generateAttachmentsFiles: (writer: ClassicDataWriter, attachmentLinks: AttachmentLink[], contentFunction: (id: string) => Promise<ResultFile | undefined>) => Promise<Map<string, string> | undefined>;
|
|
13
|
+
export declare const generateHistoryDataPoints: (writer: ClassicDataWriter, store: AllureStore) => Promise<Map<string, string>>;
|
|
14
|
+
export declare const generateStaticFiles: (payload: ClassicOptions & {
|
|
15
15
|
allureVersion: string;
|
|
16
|
-
reportName: string;
|
|
17
|
-
reportLanguage: string;
|
|
18
|
-
singleFile: boolean;
|
|
19
16
|
reportFiles: ReportFiles;
|
|
20
17
|
reportDataFiles: ReportFile[];
|
|
21
18
|
reportUuid: string;
|
|
19
|
+
reportName: string;
|
|
22
20
|
}) => Promise<void>;
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const generatePackagesData: (writer: Allure2DataWriter, tests: Allure2TestResult[]) => Promise<void>;
|
|
25
|
-
export declare const generateCategoriesData: (writer: Allure2DataWriter, tests: Allure2TestResult[]) => Promise<void>;
|
|
26
|
-
export declare const generateTimelineData: (writer: Allure2DataWriter, tests: Allure2TestResult[]) => Promise<void>;
|
|
27
|
-
export declare const generateTestResults: (writer: Allure2DataWriter, tests: Allure2TestResult[]) => Promise<void>;
|
|
28
|
-
export declare const generateSummaryJson: (writer: Allure2DataWriter, reportName: string, tests: Allure2TestResult[]) => Promise<void>;
|
|
29
|
-
export declare const generateEnvironmentJson: (writer: Allure2DataWriter, env: {
|
|
30
|
-
name: string;
|
|
31
|
-
values: string[];
|
|
32
|
-
}[]) => Promise<void>;
|
|
33
|
-
export declare const generateExecutorJson: (writer: Allure2DataWriter, executor?: Partial<Allure2ExecutorInfo>) => Promise<void>;
|
|
34
|
-
export declare const generateDefaultWidgetData: (writer: Allure2DataWriter, tests: Allure2TestResult[], ...fileNames: string[]) => Promise<void>;
|
|
35
|
-
export declare const generateEmptyTrendData: (writer: Allure2DataWriter, ...fileNames: string[]) => Promise<void>;
|
|
36
|
-
export declare const generateTrendData: (writer: Allure2DataWriter, reportName: string, tests: Allure2TestResult[], historyDataPoints: HistoryDataPoint[]) => Promise<void>;
|
|
37
|
-
export declare const generateAttachmentsData: (writer: Allure2DataWriter, attachmentLinks: AttachmentLink[], contentFunction: (id: string) => Promise<ResultFile | undefined>) => Promise<Map<string, string>>;
|
|
21
|
+
export declare const generateTreeByCategories: (writer: ClassicDataWriter, treeName: string, tests: ClassicTestResult[]) => Promise<void>;
|