@allurereport/plugin-classic 3.0.0-beta.7 → 3.0.0-beta.9
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/charts.d.ts +14 -0
- package/dist/charts.js +26 -0
- package/dist/converters.d.ts +5 -11
- package/dist/converters.js +42 -174
- package/dist/generators.d.ts +15 -31
- package/dist/generators.js +183 -214
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/model.d.ts +17 -138
- package/dist/model.js +1 -2
- package/dist/plugin.d.ts +5 -4
- package/dist/plugin.js +53 -47
- package/dist/writer.d.ts +9 -9
- package/dist/writer.js +5 -8
- package/package.json +9 -6
- package/dist/tree.d.ts +0 -44
- package/dist/tree.js +0 -113
- package/dist/utils.d.ts +0 -8
- package/dist/utils.js +0 -43
package/dist/generators.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { compareBy, incrementStatistic, nullsLast, ordinal, } from "@allurereport/core-api";
|
|
2
|
+
import { createTreeByCategories, createTreeByLabels, filterTree, sortTree, transformTree, } from "@allurereport/plugin-api";
|
|
3
|
+
import { createBaseUrlScript, createFontLinkTag, createReportDataScript, createScriptTag, createStylesLinkTag, } from "@allurereport/web-commons";
|
|
2
4
|
import Handlebars from "handlebars";
|
|
3
5
|
import { readFile } from "node:fs/promises";
|
|
4
6
|
import { createRequire } from "node:module";
|
|
5
7
|
import { basename, join } from "node:path";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
+
import { matchCategories } from "./categories.js";
|
|
9
|
+
import { getChartData } from "./charts.js";
|
|
10
|
+
import { convertFixtureResult, convertTestResult } from "./converters.js";
|
|
8
11
|
const require = createRequire(import.meta.url);
|
|
9
12
|
const template = `<!DOCTYPE html>
|
|
10
|
-
<html dir="ltr" lang="
|
|
13
|
+
<html dir="ltr" lang="en">
|
|
11
14
|
<head>
|
|
12
15
|
<meta charset="utf-8">
|
|
13
|
-
<title>{{reportName}}</title>
|
|
16
|
+
<title> {{ reportName }} </title>
|
|
17
|
+
<link rel="icon" href="favicon.ico">
|
|
14
18
|
{{{ headTags }}}
|
|
15
19
|
</head>
|
|
16
20
|
<body>
|
|
17
|
-
<
|
|
18
|
-
<div id="alert"></div>
|
|
19
|
-
<div id="content">
|
|
20
|
-
<span class="spinner">
|
|
21
|
-
<span class="spinner__circle"></span>
|
|
22
|
-
</span>
|
|
23
|
-
</div>
|
|
24
|
-
<div id="popup"></div>
|
|
25
|
-
{{{ bodyTags }}}
|
|
21
|
+
<div id="app"></div>
|
|
26
22
|
${createBaseUrlScript()}
|
|
23
|
+
<script>
|
|
24
|
+
window.allure = window.allure || {};
|
|
25
|
+
</script>
|
|
26
|
+
{{{ bodyTags }}}
|
|
27
27
|
{{#if analyticsEnable}}
|
|
28
28
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-LNDJ3J7WT0"></script>
|
|
29
29
|
<script>
|
|
@@ -31,15 +31,15 @@ const template = `<!DOCTYPE html>
|
|
|
31
31
|
function gtag(){dataLayer.push(arguments);}
|
|
32
32
|
gtag('js', new Date());
|
|
33
33
|
gtag('config', 'G-LNDJ3J7WT0', {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
"report": "classic",
|
|
35
|
+
"allureVersion": "{{ allureVersion }}",
|
|
36
|
+
"reportUuid": "{{ reportUuid }}",
|
|
37
|
+
"single_file": "{{singleFile}}"
|
|
38
38
|
});
|
|
39
39
|
</script>
|
|
40
40
|
{{/if}}
|
|
41
41
|
<script>
|
|
42
|
-
window.allureReportOptions = {{{ reportOptions }}}
|
|
42
|
+
window.allureReportOptions = {{{ reportOptions }}}
|
|
43
43
|
</script>
|
|
44
44
|
{{{ reportFilesScript }}}
|
|
45
45
|
</body>
|
|
@@ -50,68 +50,162 @@ export const readTemplateManifest = async (singleFileMode) => {
|
|
|
50
50
|
const templateManifest = await readFile(templateManifestSource, { encoding: "utf-8" });
|
|
51
51
|
return JSON.parse(templateManifest);
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
const createBreadcrumbs = (convertedTr) => {
|
|
54
|
+
const labelsByType = convertedTr.labels.reduce((acc, label) => {
|
|
55
|
+
if (!acc[label.name]) {
|
|
56
|
+
acc[label.name] = [];
|
|
57
|
+
}
|
|
58
|
+
acc[label.name].push(label.value || "");
|
|
59
|
+
return acc;
|
|
60
|
+
}, {});
|
|
61
|
+
const parentSuites = labelsByType.parentSuite || [""];
|
|
62
|
+
const suites = labelsByType.suite || [""];
|
|
63
|
+
const subSuites = labelsByType.subSuite || [""];
|
|
64
|
+
return parentSuites.reduce((acc, parentSuite) => {
|
|
65
|
+
suites.forEach((suite) => {
|
|
66
|
+
subSuites.forEach((subSuite) => {
|
|
67
|
+
const path = [parentSuite, suite, subSuite].filter(Boolean);
|
|
68
|
+
if (path.length > 0) {
|
|
69
|
+
acc.push(path);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
return acc;
|
|
74
|
+
}, []);
|
|
75
|
+
};
|
|
76
|
+
export const generateTestResults = async (writer, store) => {
|
|
77
|
+
const allTr = await store.allTestResults({ includeHidden: true });
|
|
78
|
+
let convertedTrs = [];
|
|
79
|
+
for (const tr of allTr) {
|
|
80
|
+
const trFixtures = await store.fixturesByTrId(tr.id);
|
|
81
|
+
const convertedTrFixtures = trFixtures.map(convertFixtureResult);
|
|
82
|
+
const convertedTr = convertTestResult(tr);
|
|
83
|
+
const { error, status, flaky } = convertedTr;
|
|
84
|
+
const categories = (await store.metadataByKey("allure2_categories")) ?? [];
|
|
85
|
+
const matchedCategories = matchCategories(categories, {
|
|
86
|
+
message: error?.message,
|
|
87
|
+
trace: error?.trace,
|
|
88
|
+
status,
|
|
89
|
+
flaky,
|
|
90
|
+
});
|
|
91
|
+
convertedTr.categories = matchedCategories;
|
|
92
|
+
convertedTr.history = await store.historyByTrId(tr.id);
|
|
93
|
+
convertedTr.retries = await store.retriesByTrId(tr.id);
|
|
94
|
+
convertedTr.retry = convertedTr.retries.length > 0;
|
|
95
|
+
convertedTr.setup = convertedTrFixtures.filter((f) => f.type === "before");
|
|
96
|
+
convertedTr.teardown = convertedTrFixtures.filter((f) => f.type === "after");
|
|
97
|
+
convertedTr.attachments = (await store.attachmentsByTrId(tr.id)).map((attachment) => ({
|
|
98
|
+
link: attachment,
|
|
99
|
+
type: "attachment",
|
|
100
|
+
}));
|
|
101
|
+
convertedTr.breadcrumbs = createBreadcrumbs(convertedTr);
|
|
102
|
+
convertedTrs.push(convertedTr);
|
|
103
|
+
}
|
|
104
|
+
convertedTrs = convertedTrs.sort(nullsLast(compareBy("start", ordinal()))).map((tr, idx) => ({
|
|
105
|
+
...tr,
|
|
106
|
+
order: idx + 1,
|
|
107
|
+
}));
|
|
108
|
+
for (const convertedTr of convertedTrs) {
|
|
109
|
+
await writer.writeTestCase(convertedTr);
|
|
110
|
+
}
|
|
111
|
+
await writer.writeWidget("nav.json", convertedTrs.filter(({ hidden }) => !hidden).map(({ id }) => id));
|
|
112
|
+
return convertedTrs;
|
|
113
|
+
};
|
|
114
|
+
export const generateTree = async (writer, treeName, labels, tests) => {
|
|
115
|
+
const visibleTests = tests.filter((test) => !test.hidden);
|
|
116
|
+
const tree = createTreeByLabels(visibleTests, labels, ({ id, name, status, duration, flaky, start, retries }) => {
|
|
117
|
+
return {
|
|
118
|
+
nodeId: id,
|
|
119
|
+
retry: !!retries?.length,
|
|
120
|
+
name,
|
|
121
|
+
status,
|
|
122
|
+
duration,
|
|
123
|
+
flaky,
|
|
124
|
+
start,
|
|
125
|
+
};
|
|
126
|
+
}, undefined, (group, leaf) => {
|
|
127
|
+
incrementStatistic(group.statistic, leaf.status);
|
|
128
|
+
});
|
|
129
|
+
filterTree(tree, (leaf) => !leaf.hidden);
|
|
130
|
+
sortTree(tree, nullsLast(compareBy("start", ordinal())));
|
|
131
|
+
transformTree(tree, (leaf, idx) => ({ ...leaf, groupOrder: idx + 1 }));
|
|
132
|
+
await writer.writeWidget(`${treeName}.json`, tree);
|
|
133
|
+
};
|
|
134
|
+
export const generateEnvironmentJson = async (writer, env) => {
|
|
135
|
+
await writer.writeWidget("allure_environment.json", env);
|
|
136
|
+
};
|
|
137
|
+
export const generateStatistic = async (writer, statistic) => {
|
|
138
|
+
await writer.writeWidget("allure_statistic.json", statistic);
|
|
139
|
+
};
|
|
140
|
+
export const generatePieChart = async (writer, statistic) => {
|
|
141
|
+
const chartData = getChartData(statistic);
|
|
142
|
+
await writer.writeWidget("allure_pie_chart.json", chartData);
|
|
143
|
+
};
|
|
144
|
+
export const generateAttachmentsFiles = async (writer, attachmentLinks, contentFunction) => {
|
|
145
|
+
const result = new Map();
|
|
146
|
+
for (const { id, ext, ...link } of attachmentLinks) {
|
|
147
|
+
if (link.missed) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const content = await contentFunction(id);
|
|
151
|
+
if (!content) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const src = `${id}${ext}`;
|
|
155
|
+
await writer.writeAttachment(src, content);
|
|
156
|
+
result.set(id, src);
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
};
|
|
160
|
+
export const generateHistoryDataPoints = async (writer, store) => {
|
|
161
|
+
const result = new Map();
|
|
162
|
+
const allHistoryPoints = await store.allHistoryDataPoints();
|
|
163
|
+
for (const historyPoint of allHistoryPoints.slice(0, 6)) {
|
|
164
|
+
const src = `history/${historyPoint.uuid}.json`;
|
|
165
|
+
await writer.writeData(src, historyPoint);
|
|
59
166
|
}
|
|
60
|
-
|
|
61
|
-
return inserter(fileName);
|
|
167
|
+
return result;
|
|
62
168
|
};
|
|
63
169
|
export const generateStaticFiles = async (payload) => {
|
|
64
|
-
const { reportName, reportLanguage, singleFile, reportFiles, reportDataFiles, reportUuid, allureVersion } = payload;
|
|
170
|
+
const { reportName = "Allure Report", reportLanguage = "en", singleFile, logo = "", theme = "light", groupBy, reportFiles, reportDataFiles, reportUuid, allureVersion, } = payload;
|
|
65
171
|
const compile = Handlebars.compile(template);
|
|
66
|
-
const manifest = await readTemplateManifest(singleFile);
|
|
172
|
+
const manifest = await readTemplateManifest(payload.singleFile);
|
|
67
173
|
const headTags = [];
|
|
68
174
|
const bodyTags = [];
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
fileName
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
reportFiles,
|
|
88
|
-
inserter: createStylesLinkTag,
|
|
89
|
-
mimeType: "text/css",
|
|
90
|
-
});
|
|
91
|
-
headTags.push(tag);
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (key === "main.js") {
|
|
95
|
-
const tag = await readManifestEntry({
|
|
96
|
-
fileName,
|
|
97
|
-
singleFile,
|
|
98
|
-
reportFiles,
|
|
99
|
-
inserter: createScriptTag,
|
|
100
|
-
mimeType: "text/javascript",
|
|
101
|
-
});
|
|
102
|
-
bodyTags.push(tag);
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
if (singleFile) {
|
|
106
|
-
continue;
|
|
175
|
+
if (!payload.singleFile) {
|
|
176
|
+
for (const key in manifest) {
|
|
177
|
+
const fileName = manifest[key];
|
|
178
|
+
const filePath = require.resolve(join("@allurereport/web-classic/dist", singleFile ? "single" : "multi", fileName));
|
|
179
|
+
if (key.includes(".woff")) {
|
|
180
|
+
headTags.push(createFontLinkTag(fileName));
|
|
181
|
+
}
|
|
182
|
+
if (key === "main.css") {
|
|
183
|
+
headTags.push(createStylesLinkTag(fileName));
|
|
184
|
+
}
|
|
185
|
+
if (key === "main.js") {
|
|
186
|
+
bodyTags.push(createScriptTag(fileName));
|
|
187
|
+
}
|
|
188
|
+
if (singleFile) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const fileContent = await readFile(filePath);
|
|
192
|
+
await reportFiles.addFile(basename(filePath), fileContent);
|
|
107
193
|
}
|
|
108
|
-
|
|
109
|
-
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
const mainJs = manifest["main.js"];
|
|
197
|
+
const mainJsSource = require.resolve(`@allurereport/web-classic/dist/single/${mainJs}`);
|
|
198
|
+
const mainJsContentBuffer = await readFile(mainJsSource);
|
|
199
|
+
bodyTags.push(createScriptTag(`data:text/javascript;base64,${mainJsContentBuffer.toString("base64")}`));
|
|
110
200
|
}
|
|
111
201
|
const reportOptions = {
|
|
112
|
-
reportName
|
|
113
|
-
|
|
202
|
+
reportName,
|
|
203
|
+
logo,
|
|
204
|
+
theme,
|
|
205
|
+
reportLanguage,
|
|
114
206
|
createdAt: Date.now(),
|
|
207
|
+
reportUuid,
|
|
208
|
+
groupBy: groupBy?.length ? groupBy : ["parentSuite", "suite", "subSuite"],
|
|
115
209
|
};
|
|
116
210
|
const html = compile({
|
|
117
211
|
headTags: headTags.join("\n"),
|
|
@@ -120,157 +214,32 @@ export const generateStaticFiles = async (payload) => {
|
|
|
120
214
|
reportOptions: JSON.stringify(reportOptions),
|
|
121
215
|
analyticsEnable: true,
|
|
122
216
|
allureVersion,
|
|
123
|
-
reportLanguage,
|
|
124
217
|
reportUuid,
|
|
125
218
|
reportName,
|
|
126
|
-
singleFile,
|
|
219
|
+
singleFile: payload.singleFile,
|
|
127
220
|
});
|
|
128
221
|
await reportFiles.addFile("index.html", Buffer.from(html, "utf8"));
|
|
129
222
|
};
|
|
130
|
-
export const
|
|
131
|
-
const
|
|
132
|
-
const
|
|
133
|
-
await writer.writeData(fileName, data);
|
|
134
|
-
const widgetData = createWidget(data);
|
|
135
|
-
await writer.writeWidget(fileName, widgetData);
|
|
136
|
-
};
|
|
137
|
-
export const generatePackagesData = async (writer, tests) => {
|
|
138
|
-
const classifier = (test) => {
|
|
139
|
-
return (test.labels
|
|
140
|
-
.find((label) => label.name === "package")
|
|
141
|
-
?.value?.split(".")
|
|
142
|
-
?.map((group) => ({
|
|
143
|
-
groups: [group],
|
|
144
|
-
})) ?? []);
|
|
145
|
-
};
|
|
146
|
-
const data = createTree(tests, classifier);
|
|
147
|
-
const packagesData = collapseTree(data);
|
|
148
|
-
await writer.writeData("packages.json", packagesData);
|
|
149
|
-
};
|
|
150
|
-
export const generateCategoriesData = async (writer, tests) => {
|
|
151
|
-
const classifier = (test) => {
|
|
152
|
-
const byMessage = { groups: [test.statusMessage ?? "No message"] };
|
|
153
|
-
const categories = test.extra.categories;
|
|
154
|
-
if (!categories || categories.length === 0) {
|
|
155
|
-
return undefined;
|
|
156
|
-
}
|
|
157
|
-
const groups = categories.map((c) => c.name);
|
|
158
|
-
return [{ groups }, byMessage];
|
|
159
|
-
};
|
|
160
|
-
const data = createTree(tests, classifier);
|
|
161
|
-
const fileName = "categories.json";
|
|
162
|
-
await writer.writeData(fileName, data);
|
|
163
|
-
const widgetData = createWidget(data);
|
|
164
|
-
await writer.writeWidget(fileName, widgetData);
|
|
165
|
-
};
|
|
166
|
-
export const generateTimelineData = async (writer, tests) => {
|
|
167
|
-
const classifier = (test) => {
|
|
168
|
-
return [{ groups: [test.hostId ?? "Default"] }, { groups: [test.threadId ?? "Default"] }];
|
|
169
|
-
};
|
|
170
|
-
const data = createTree(tests, classifier);
|
|
171
|
-
await writer.writeData("timeline.json", data);
|
|
172
|
-
};
|
|
173
|
-
export const generateTestResults = async (writer, tests) => {
|
|
174
|
-
for (const test of tests) {
|
|
175
|
-
await writer.writeTestCase(test);
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
export const generateSummaryJson = async (writer, reportName, tests) => {
|
|
179
|
-
const statistic = { total: 0 };
|
|
180
|
-
const time = {};
|
|
181
|
-
tests
|
|
182
|
-
.filter((test) => !test.hidden)
|
|
183
|
-
.forEach((test) => {
|
|
184
|
-
updateStatistic(statistic, test);
|
|
185
|
-
updateTime(time, test);
|
|
186
|
-
});
|
|
187
|
-
const data = {
|
|
188
|
-
reportName,
|
|
189
|
-
statistic,
|
|
190
|
-
time,
|
|
191
|
-
};
|
|
192
|
-
await writer.writeWidget("summary.json", data);
|
|
193
|
-
};
|
|
194
|
-
export const generateEnvironmentJson = async (writer, env) => {
|
|
195
|
-
await writer.writeWidget("environment.json", env);
|
|
196
|
-
};
|
|
197
|
-
export const generateExecutorJson = async (writer, executor) => {
|
|
198
|
-
await writer.writeWidget("executors.json", executor ? [executor] : []);
|
|
199
|
-
};
|
|
200
|
-
export const generateDefaultWidgetData = async (writer, tests, ...fileNames) => {
|
|
201
|
-
const statusChartData = tests
|
|
202
|
-
.filter((test) => !test.hidden)
|
|
203
|
-
.map(({ uid, name, status, time, extra: { severity = "normal" } }) => {
|
|
223
|
+
export const generateTreeByCategories = async (writer, treeName, tests) => {
|
|
224
|
+
const visibleTests = tests.filter((test) => !test.hidden);
|
|
225
|
+
const tree = createTreeByCategories(visibleTests, ({ id, name, status, duration, flaky, start, retries }) => {
|
|
204
226
|
return {
|
|
205
|
-
|
|
227
|
+
nodeId: id,
|
|
228
|
+
retry: !!retries?.length,
|
|
206
229
|
name,
|
|
207
230
|
status,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
});
|
|
212
|
-
for (const fileName of fileNames) {
|
|
213
|
-
await writer.writeWidget(fileName, statusChartData);
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
export const generateEmptyTrendData = async (writer, ...fileNames) => {
|
|
217
|
-
for (const fileName of fileNames) {
|
|
218
|
-
await writer.writeWidget(fileName, [
|
|
219
|
-
{
|
|
220
|
-
uid: "invalid",
|
|
221
|
-
name: "invalid",
|
|
222
|
-
statistic: { total: 0 },
|
|
223
|
-
},
|
|
224
|
-
]);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
export const generateTrendData = async (writer, reportName, tests, historyDataPoints) => {
|
|
228
|
-
const statistic = { total: 0 };
|
|
229
|
-
tests
|
|
230
|
-
.filter((test) => !test.hidden)
|
|
231
|
-
.forEach((test) => {
|
|
232
|
-
updateStatistic(statistic, test);
|
|
233
|
-
});
|
|
234
|
-
const history = historyDataPoints.map((point) => {
|
|
235
|
-
const stat = { total: 0 };
|
|
236
|
-
Object.values(point.testResults).forEach((testResult) => {
|
|
237
|
-
updateStatistic(stat, testResult);
|
|
238
|
-
});
|
|
239
|
-
return {
|
|
240
|
-
data: stat,
|
|
241
|
-
timestamp: point.timestamp,
|
|
242
|
-
reportName: point.name,
|
|
231
|
+
duration,
|
|
232
|
+
flaky,
|
|
233
|
+
start,
|
|
243
234
|
};
|
|
235
|
+
}, undefined, (group, leaf) => {
|
|
236
|
+
incrementStatistic(group.statistic, leaf.status);
|
|
244
237
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
data: statistic,
|
|
253
|
-
timestamp: new Date().getTime(),
|
|
254
|
-
buildOrder: history.length + 1,
|
|
255
|
-
reportName: reportName,
|
|
256
|
-
},
|
|
257
|
-
...history,
|
|
258
|
-
];
|
|
259
|
-
await writer.writeWidget("history-trend.json", data);
|
|
260
|
-
};
|
|
261
|
-
export const generateAttachmentsData = async (writer, attachmentLinks, contentFunction) => {
|
|
262
|
-
const result = new Map();
|
|
263
|
-
for (const { id, ext, ...link } of attachmentLinks) {
|
|
264
|
-
if (link.missed) {
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
const content = await contentFunction(id);
|
|
268
|
-
if (!content) {
|
|
269
|
-
continue;
|
|
270
|
-
}
|
|
271
|
-
const src = `${id}${ext}`;
|
|
272
|
-
await writer.writeAttachment(src, content);
|
|
273
|
-
result.set(id, src);
|
|
274
|
-
}
|
|
275
|
-
return result;
|
|
238
|
+
filterTree(tree, (leaf) => !leaf.hidden);
|
|
239
|
+
sortTree(tree, nullsLast(compareBy("start", ordinal())));
|
|
240
|
+
transformTree(tree, (leaf, idx) => ({
|
|
241
|
+
...leaf,
|
|
242
|
+
groupOrder: idx + 1,
|
|
243
|
+
}));
|
|
244
|
+
await writer.writeWidget(`${treeName}.json`, tree);
|
|
276
245
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default
|
|
1
|
+
import { AllureAwesomePlugin } from "./plugin.js";
|
|
2
|
+
export default AllureAwesomePlugin;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default
|
|
1
|
+
import { AllureAwesomePlugin } from "./plugin.js";
|
|
2
|
+
export default AllureAwesomePlugin;
|
package/dist/model.d.ts
CHANGED
|
@@ -1,146 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
name?: string;
|
|
14
|
-
url?: string;
|
|
15
|
-
type?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface Allure2Parameter {
|
|
18
|
-
name?: string;
|
|
19
|
-
value?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface Allure2Attachment {
|
|
22
|
-
uid: string;
|
|
23
|
-
name?: string;
|
|
24
|
-
source?: string;
|
|
25
|
-
type?: string;
|
|
26
|
-
size?: number;
|
|
27
|
-
}
|
|
28
|
-
export interface Allure2Step {
|
|
29
|
-
name: string;
|
|
30
|
-
time: Allure2Time;
|
|
31
|
-
status: Allure2Status;
|
|
32
|
-
statusMessage?: string;
|
|
33
|
-
statusTrace?: string;
|
|
34
|
-
steps: Allure2Step[];
|
|
35
|
-
attachments: Allure2Attachment[];
|
|
36
|
-
parameters: Allure2Parameter[];
|
|
37
|
-
stepsCount: number;
|
|
38
|
-
attachmentsCount: number;
|
|
39
|
-
shouldDisplayMessage: boolean;
|
|
40
|
-
hasContent: boolean;
|
|
41
|
-
attachmentStep: boolean;
|
|
42
|
-
}
|
|
43
|
-
export type Allure2StageResult = Allure2Step | Omit<Allure2Step, "name">;
|
|
44
|
-
export interface Allure2TestResult {
|
|
45
|
-
uid: string;
|
|
46
|
-
name: string;
|
|
47
|
-
fullName?: string;
|
|
48
|
-
historyId?: string;
|
|
49
|
-
testId?: string;
|
|
50
|
-
time: Allure2Time;
|
|
51
|
-
description?: string;
|
|
52
|
-
descriptionHtml?: string;
|
|
53
|
-
status: Allure2Status;
|
|
54
|
-
statusMessage?: string;
|
|
55
|
-
statusTrace?: string;
|
|
56
|
-
flaky: boolean;
|
|
57
|
-
newFailed: boolean;
|
|
58
|
-
newBroken: boolean;
|
|
59
|
-
newPassed: boolean;
|
|
60
|
-
retriesCount: number;
|
|
61
|
-
retriesStatusChange: boolean;
|
|
62
|
-
beforeStages: Allure2StageResult[];
|
|
63
|
-
testStage: Allure2StageResult;
|
|
64
|
-
afterStages: Allure2StageResult[];
|
|
65
|
-
labels: Allure2Label[];
|
|
66
|
-
parameters: Allure2Parameter[];
|
|
67
|
-
links: Allure2Link[];
|
|
68
|
-
hostId?: string;
|
|
69
|
-
threadId?: string;
|
|
70
|
-
hidden: boolean;
|
|
71
|
-
retry: boolean;
|
|
72
|
-
extra: {
|
|
73
|
-
[key: string]: any;
|
|
1
|
+
import type { TestStatus } from "@allurereport/core-api";
|
|
2
|
+
export type AllureAwesomeOptions = {
|
|
3
|
+
reportName?: string;
|
|
4
|
+
singleFile?: boolean;
|
|
5
|
+
logo?: string;
|
|
6
|
+
theme?: "light" | "dark";
|
|
7
|
+
reportLanguage?: "en" | "ru";
|
|
8
|
+
groupBy?: string[];
|
|
9
|
+
ci?: {
|
|
10
|
+
type: "github" | "jenkins";
|
|
11
|
+
url: string;
|
|
12
|
+
name: string;
|
|
74
13
|
};
|
|
75
|
-
}
|
|
76
|
-
export
|
|
77
|
-
export
|
|
78
|
-
|
|
79
|
-
stop?: number;
|
|
80
|
-
duration?: number;
|
|
81
|
-
minDuration?: number;
|
|
82
|
-
maxDuration?: number;
|
|
83
|
-
sumDuration?: number;
|
|
84
|
-
}
|
|
85
|
-
export interface SummaryData {
|
|
86
|
-
reportName: string;
|
|
87
|
-
statistic: Statistic;
|
|
88
|
-
time: GroupTime;
|
|
89
|
-
}
|
|
90
|
-
export type Allure2SeverityLevel = "blocker" | "critical" | "normal" | "minor" | "trivial";
|
|
91
|
-
export declare const severityValues: Allure2SeverityLevel[];
|
|
92
|
-
export interface StatusChartData {
|
|
93
|
-
uid: string;
|
|
94
|
-
name: string;
|
|
95
|
-
time: Allure2Time;
|
|
96
|
-
status: Allure2Status;
|
|
97
|
-
severity: Allure2SeverityLevel;
|
|
98
|
-
}
|
|
99
|
-
export interface Allure2Category {
|
|
14
|
+
};
|
|
15
|
+
export type TemplateManifest = Record<string, string>;
|
|
16
|
+
export type AllureAwesomePluginOptions = AllureAwesomeOptions;
|
|
17
|
+
export interface AllureAwesomeCategory {
|
|
100
18
|
name: string;
|
|
101
19
|
description?: string;
|
|
102
20
|
descriptionHtml?: string;
|
|
103
21
|
messageRegex?: string;
|
|
104
22
|
traceRegex?: string;
|
|
105
|
-
matchedStatuses?:
|
|
23
|
+
matchedStatuses?: TestStatus[];
|
|
106
24
|
flaky?: boolean;
|
|
107
25
|
}
|
|
108
|
-
export interface Allure2RetryItem {
|
|
109
|
-
uid: string;
|
|
110
|
-
status: Allure2Status;
|
|
111
|
-
statusDetails?: string;
|
|
112
|
-
time: Allure2Time;
|
|
113
|
-
}
|
|
114
|
-
export interface Allure2HistoryItem {
|
|
115
|
-
uid: string;
|
|
116
|
-
reportUrl: string;
|
|
117
|
-
status: Allure2Status;
|
|
118
|
-
statusDetails?: string;
|
|
119
|
-
time: Allure2Time;
|
|
120
|
-
}
|
|
121
|
-
export interface Allure2HistoryData {
|
|
122
|
-
statistic: Statistic;
|
|
123
|
-
items: Allure2HistoryItem[];
|
|
124
|
-
}
|
|
125
|
-
export interface Allure2HistoryTrendItem {
|
|
126
|
-
data: Statistic;
|
|
127
|
-
buildOrder?: number;
|
|
128
|
-
reportUrl?: string;
|
|
129
|
-
reportName?: string;
|
|
130
|
-
}
|
|
131
|
-
export type Allure2Options = {
|
|
132
|
-
reportName?: string;
|
|
133
|
-
singleFile?: boolean;
|
|
134
|
-
reportLanguage?: string;
|
|
135
|
-
};
|
|
136
|
-
export type Allure2PluginOptions = Allure2Options;
|
|
137
|
-
export interface Allure2ExecutorInfo {
|
|
138
|
-
name: string;
|
|
139
|
-
type: string;
|
|
140
|
-
url: string;
|
|
141
|
-
buildOrder: number;
|
|
142
|
-
buildName: string;
|
|
143
|
-
buildUrl: string;
|
|
144
|
-
reportName: string;
|
|
145
|
-
reportUrl: string;
|
|
146
|
-
}
|
package/dist/model.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export const severityValues = ["blocker", "critical", "normal", "minor", "trivial"];
|
|
1
|
+
export {};
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AllureStore, Plugin, PluginContext } from "@allurereport/plugin-api";
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
2
|
+
import type { AllureAwesomePluginOptions } from "./model.js";
|
|
3
|
+
export declare class AllureAwesomePlugin implements Plugin {
|
|
4
4
|
#private;
|
|
5
|
-
readonly options:
|
|
6
|
-
constructor(options?:
|
|
5
|
+
readonly options: AllureAwesomePluginOptions;
|
|
6
|
+
constructor(options?: AllureAwesomePluginOptions);
|
|
7
|
+
start: (context: PluginContext) => Promise<void>;
|
|
7
8
|
update: (context: PluginContext, store: AllureStore) => Promise<void>;
|
|
8
9
|
done: (context: PluginContext, store: AllureStore) => Promise<void>;
|
|
9
10
|
}
|