@allurereport/plugin-awesome 3.18.0 → 3.19.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/dist/categories.js +7 -5
- package/dist/converters.js +5 -2
- package/dist/generateTimeline.d.ts +1 -1
- package/dist/generateTimeline.js +3 -3
- package/dist/generators.js +8 -5
- package/dist/plugin.js +2 -2
- package/dist/static/report.tar +0 -0
- package/package.json +6 -6
package/dist/categories.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { EMPTY_VALUE, buildEnvironmentSortOrder, compareChildNodes, extractErrorMatchingData, findLastByLabelName, incrementStatistic, matchCategory, } from "@allurereport/core-api";
|
|
1
|
+
import { EMPTY_VALUE, buildEnvironmentSortOrder, calculateRetryHash, compareChildNodes, extractErrorMatchingData, findLastByLabelName, incrementStatistic, matchCategory, } from "@allurereport/core-api";
|
|
2
2
|
import { md5 } from "@allurereport/plugin-api";
|
|
3
3
|
const emptyStat = () => ({
|
|
4
4
|
total: 0,
|
|
5
5
|
});
|
|
6
6
|
const msgKey = (m) => (m && m.trim().length ? m : EMPTY_VALUE);
|
|
7
7
|
const envKey = (m) => (m && m.trim().length ? m : EMPTY_VALUE);
|
|
8
|
+
const environmentNeutralRetryHash = (testResult) => calculateRetryHash({ testCaseHash: testResult.testCaseHash, parametersHash: testResult.parametersHash }) ??
|
|
9
|
+
testResult.id;
|
|
8
10
|
const formatEmptyValue = (key) => {
|
|
9
11
|
if (key === "message") {
|
|
10
12
|
return "No message";
|
|
@@ -98,11 +100,11 @@ const buildGroupLevels = (category, testResult, matchingData, environmentCount,
|
|
|
98
100
|
}
|
|
99
101
|
const groupEnvironments = computeGroupEnvironments(category, environmentCount, isSingleEnvironmentSelected);
|
|
100
102
|
if (groupEnvironments) {
|
|
101
|
-
const testKeyValue = testResult
|
|
103
|
+
const testKeyValue = environmentNeutralRetryHash(testResult);
|
|
102
104
|
const testDisplayName = testResult.name ?? testKeyValue;
|
|
103
105
|
levels.push({
|
|
104
106
|
type: "history",
|
|
105
|
-
key: "
|
|
107
|
+
key: "retryHash",
|
|
106
108
|
value: testKeyValue,
|
|
107
109
|
name: testDisplayName,
|
|
108
110
|
});
|
|
@@ -165,14 +167,14 @@ export const generateCategories = async (writer, { tests, categories, filename =
|
|
|
165
167
|
let parentId = catId;
|
|
166
168
|
for (const level of levels) {
|
|
167
169
|
const levelId = `${level.type}:${md5(`${parentId}\n${level.key}\n${level.value}`)}`;
|
|
168
|
-
const
|
|
170
|
+
const retryHash = level.type === "history" ? level.value : undefined;
|
|
169
171
|
duplicateChecker({
|
|
170
172
|
id: levelId,
|
|
171
173
|
type: level.type,
|
|
172
174
|
name: level.name,
|
|
173
175
|
key: level.key,
|
|
174
176
|
value: level.value,
|
|
175
|
-
|
|
177
|
+
retryHash,
|
|
176
178
|
statistic: emptyStat(),
|
|
177
179
|
childrenIds: [],
|
|
178
180
|
});
|
package/dist/converters.js
CHANGED
|
@@ -21,7 +21,10 @@ export const convertTestResult = (tr, options = {}) => {
|
|
|
21
21
|
duration: tr.duration,
|
|
22
22
|
status: tr.status,
|
|
23
23
|
fullName: tr.fullName,
|
|
24
|
-
|
|
24
|
+
retryHash: tr.retryHash,
|
|
25
|
+
testCaseHash: tr.testCaseHash,
|
|
26
|
+
parametersHash: tr.parametersHash,
|
|
27
|
+
environmentHash: tr.environmentHash,
|
|
25
28
|
flaky: tr.flaky,
|
|
26
29
|
muted: tr.muted,
|
|
27
30
|
known: tr.known,
|
|
@@ -34,8 +37,8 @@ export const convertTestResult = (tr, options = {}) => {
|
|
|
34
37
|
links: tr.links,
|
|
35
38
|
steps: (tr.steps ?? []).map(convertTestStepResult),
|
|
36
39
|
error: tr.error,
|
|
40
|
+
errors: tr.errors,
|
|
37
41
|
testCase: tr.testCase,
|
|
38
|
-
retryHash: tr.retryHash,
|
|
39
42
|
descriptionHtml: tr.descriptionHtml ?? markdownToHtml(tr.description),
|
|
40
43
|
environment: tr.environment,
|
|
41
44
|
setup: [],
|
|
@@ -3,5 +3,5 @@ import type { AwesomeOptions } from "./model.js";
|
|
|
3
3
|
type Writer = {
|
|
4
4
|
writeWidget(fileName: string, data: any): Promise<void>;
|
|
5
5
|
};
|
|
6
|
-
export declare const generateTimeline: (writer: Writer, trs: TestResult[], options: AwesomeOptions, environmentIdByTrId: Map<string, string>) => Promise<void>;
|
|
6
|
+
export declare const generateTimeline: (writer: Writer, trs: TestResult[], options: AwesomeOptions, environmentIdByTrId: Map<string, string>, environmentNameById?: Map<string, string>) => Promise<void>;
|
|
7
7
|
export {};
|
package/dist/generateTimeline.js
CHANGED
|
@@ -2,7 +2,7 @@ const DEFAULT_MIN_DURATION = 1;
|
|
|
2
2
|
const DEFAULT_TIMELINE_OPTIONS = {
|
|
3
3
|
minDuration: DEFAULT_MIN_DURATION,
|
|
4
4
|
};
|
|
5
|
-
export const generateTimeline = async (writer, trs, options, environmentIdByTrId) => {
|
|
5
|
+
export const generateTimeline = async (writer, trs, options, environmentIdByTrId, environmentNameById = new Map()) => {
|
|
6
6
|
const { timeline = DEFAULT_TIMELINE_OPTIONS } = options;
|
|
7
7
|
const { minDuration = DEFAULT_MIN_DURATION } = timeline;
|
|
8
8
|
const result = [];
|
|
@@ -23,14 +23,14 @@ export const generateTimeline = async (writer, trs, options, environmentIdByTrId
|
|
|
23
23
|
}
|
|
24
24
|
result.push({
|
|
25
25
|
id: test.id,
|
|
26
|
-
|
|
26
|
+
retryHash: test.retryHash,
|
|
27
27
|
name: test.name,
|
|
28
28
|
status: test.status,
|
|
29
29
|
isRetry: test.isRetry,
|
|
30
30
|
host,
|
|
31
31
|
thread,
|
|
32
32
|
environment: environmentIdByTrId.get(test.id) ?? test.environment,
|
|
33
|
-
environmentName: test.environment,
|
|
33
|
+
environmentName: environmentNameById.get(test.environment ?? "") ?? test.environment,
|
|
34
34
|
start: test.start,
|
|
35
35
|
duration,
|
|
36
36
|
});
|
package/dist/generators.js
CHANGED
|
@@ -159,18 +159,21 @@ const searchDocumentFactory = (test) => {
|
|
|
159
159
|
});
|
|
160
160
|
const links = (test.links ?? []).flatMap(({ name, url, type }) => [name, url, type]);
|
|
161
161
|
const categories = test.categories?.map((category) => category.name);
|
|
162
|
+
const statusMessages = (test.errors?.length ? test.errors : test.error ? [test.error] : [])
|
|
163
|
+
.map((error) => error.message)
|
|
164
|
+
.filter(Boolean);
|
|
162
165
|
return {
|
|
163
166
|
id: test.id,
|
|
164
167
|
nodeId: test.id,
|
|
165
168
|
name: test.name,
|
|
166
169
|
fullName: test.fullName,
|
|
167
|
-
|
|
170
|
+
retryHash: test.retryHash,
|
|
168
171
|
labels: joinSearchValues(labels),
|
|
169
172
|
owner: joinSearchValues(test.groupedLabels.owner ?? []),
|
|
170
173
|
tags: joinSearchValues(tags),
|
|
171
174
|
parameters: joinSearchValues(parameters),
|
|
172
175
|
categories: joinSearchValues(categories ?? []),
|
|
173
|
-
statusMessage:
|
|
176
|
+
statusMessage: joinSearchValues(statusMessages),
|
|
174
177
|
links: joinSearchValues(links),
|
|
175
178
|
};
|
|
176
179
|
};
|
|
@@ -270,10 +273,10 @@ const buildTreeByTitlePath = (tests) => {
|
|
|
270
273
|
};
|
|
271
274
|
};
|
|
272
275
|
const buildTreeByLabelsAndTitlePathCombined = (tests, labels) => collapseTreeGroups(createTreeByLabelsAndTitlePath(tests, labels, leafFactory, undefined, (group, leaf) => incrementStatistic(group.statistic, leaf.status)));
|
|
273
|
-
const leafFactory = ({ id, name, status, duration, flaky, start, retry, retriesCount, resolution, transition, tooltips,
|
|
276
|
+
const leafFactory = ({ id, name, status, duration, flaky, start, retry, retriesCount, resolution, transition, tooltips, retryHash, groupedLabels, categories, }) => {
|
|
274
277
|
const leaf = {
|
|
275
278
|
nodeId: id,
|
|
276
|
-
id:
|
|
279
|
+
id: retryHash ?? id,
|
|
277
280
|
name,
|
|
278
281
|
status,
|
|
279
282
|
duration,
|
|
@@ -306,7 +309,7 @@ const getResolutionGroupName = (test) => {
|
|
|
306
309
|
};
|
|
307
310
|
const resolutionTestResultFactory = (test, index) => ({
|
|
308
311
|
nodeId: test.id,
|
|
309
|
-
id: test.
|
|
312
|
+
id: test.retryHash ?? test.id,
|
|
310
313
|
name: test.name,
|
|
311
314
|
status: test.status,
|
|
312
315
|
duration: test.duration,
|
package/dist/plugin.js
CHANGED
|
@@ -137,13 +137,13 @@ export class AwesomePlugin {
|
|
|
137
137
|
tests: convertedTrs,
|
|
138
138
|
categories,
|
|
139
139
|
environmentCount: environments.length,
|
|
140
|
-
environments: environments.map(({
|
|
140
|
+
environments: environments.map(({ id }) => id),
|
|
141
141
|
defaultEnvironment: "default",
|
|
142
142
|
selectedEnvironmentCount: environments.length,
|
|
143
143
|
});
|
|
144
144
|
await generateResolutionCategories(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), convertedTrs);
|
|
145
145
|
const hasGroupBy = groupBy.length > 0;
|
|
146
|
-
await generateTimeline(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), allTrs, this.options, envIdByTrId);
|
|
146
|
+
await generateTimeline(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), allTrs, this.options, envIdByTrId, new Map(environments.map(({ id, name }) => [id, name])));
|
|
147
147
|
const treeLabels = hasGroupBy
|
|
148
148
|
? preciseTreeLabels(groupBy, convertedTrs, ({ labels }) => labels.map(({ name }) => name))
|
|
149
149
|
: [];
|
package/dist/static/report.tar
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-awesome",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"description": "Allure Awesome Plugin – brand new HTML report with modern design and new features",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"lint:fix": "oxlint --import-plugin --fix src test features stories"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@allurereport/charts-api": "3.
|
|
34
|
-
"@allurereport/core-api": "3.
|
|
35
|
-
"@allurereport/plugin-api": "3.
|
|
36
|
-
"@allurereport/web-commons": "3.
|
|
33
|
+
"@allurereport/charts-api": "3.19.0",
|
|
34
|
+
"@allurereport/core-api": "3.19.0",
|
|
35
|
+
"@allurereport/plugin-api": "3.19.0",
|
|
36
|
+
"@allurereport/web-commons": "3.19.0",
|
|
37
37
|
"d3-shape": "^3.2.0",
|
|
38
38
|
"handlebars": "^4.7.9",
|
|
39
39
|
"markdown-it": "^14.2.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@allurereport/web-awesome": "3.
|
|
42
|
+
"@allurereport/web-awesome": "3.19.0",
|
|
43
43
|
"@types/d3-shape": "^3.1.8",
|
|
44
44
|
"@types/markdown-it": "^14.1.2",
|
|
45
45
|
"@types/node": "^20",
|