@allurereport/plugin-awesome 3.16.1 → 3.18.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/converters.js +3 -0
- package/dist/generators.d.ts +19 -2
- package/dist/generators.js +87 -9
- package/dist/plugin.js +56 -14
- package/dist/static/report.tar +0 -0
- package/package.json +6 -6
package/dist/converters.js
CHANGED
|
@@ -24,6 +24,9 @@ export const convertTestResult = (tr, options = {}) => {
|
|
|
24
24
|
historyId: tr.historyId,
|
|
25
25
|
flaky: tr.flaky,
|
|
26
26
|
muted: tr.muted,
|
|
27
|
+
known: tr.known,
|
|
28
|
+
resolution: tr.resolution,
|
|
29
|
+
resolutionComment: tr.resolutionComment,
|
|
27
30
|
isRetry: tr.isRetry,
|
|
28
31
|
labels,
|
|
29
32
|
groupedLabels: mapLabelsByName(labels),
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { type AttachmentLink, type EnvironmentIdentity, type EnvironmentItem, type Statistic, type TestEnvGroup, type TestResult } from "@allurereport/core-api";
|
|
1
|
+
import { type AttachmentLink, type EnvironmentIdentity, type EnvironmentItem, type HistoryTestResultUrlResolver, type MetricSample, type Statistic, type TestEnvGroup, type TestResult } from "@allurereport/core-api";
|
|
2
2
|
import type { AllureStore, ReportExecutorInfo, ReportRunSummary, ReportTestResult, GlobalAttachmentLink, ExitCode, PluginContext, PluginGlobalError, QualityGateValidationResult, ReportFiles, ResultFile } from "@allurereport/plugin-api";
|
|
3
3
|
import type { AwesomeOptions, TemplateManifest } from "./model.js";
|
|
4
4
|
import type { AwesomeDataWriter, ReportFile } from "./writer.js";
|
|
5
5
|
export declare const readTemplateManifest: (_singleFileMode?: boolean) => Promise<TemplateManifest>;
|
|
6
|
-
export declare const generateTestResults: (_writer: AwesomeDataWriter, store: AllureStore, trs: TestResult[], options
|
|
6
|
+
export declare const generateTestResults: (_writer: AwesomeDataWriter, store: AllureStore, trs: TestResult[], options: {
|
|
7
|
+
pluginId: string;
|
|
7
8
|
hideLabels?: readonly (string | RegExp)[];
|
|
9
|
+
resolveHistoryUrl?: HistoryTestResultUrlResolver;
|
|
8
10
|
}) => Promise<ReportTestResult[]>;
|
|
9
11
|
export declare const generateTestCases: (writer: AwesomeDataWriter, trs: ReportTestResult[]) => Promise<void>;
|
|
10
12
|
export declare const generateTestEnvGroups: (writer: AwesomeDataWriter, groups: TestEnvGroup[]) => Promise<void>;
|
|
@@ -14,12 +16,15 @@ export declare const getRunSummary: (testResults: Pick<TestResult, "start" | "st
|
|
|
14
16
|
export declare const generateTree: (writer: AwesomeDataWriter, treeFilename: string, labels: string[], tests: ReportTestResult[], options?: {
|
|
15
17
|
appendTitlePath?: boolean;
|
|
16
18
|
}) => Promise<void>;
|
|
19
|
+
export declare const generateResolutionCategories: (writer: AwesomeDataWriter, tests: ReportTestResult[], filename?: string) => Promise<void>;
|
|
17
20
|
export declare const generateEnvironmentJson: (writer: AwesomeDataWriter, env: EnvironmentItem[]) => Promise<void>;
|
|
18
21
|
export declare const generateEnvirontmentsList: (writer: AwesomeDataWriter, store: AllureStore) => Promise<void>;
|
|
19
22
|
export declare const generateVariables: (writer: AwesomeDataWriter, store: AllureStore) => Promise<void>;
|
|
20
23
|
export declare const generateStatistic: (writer: AwesomeDataWriter, data: {
|
|
21
24
|
stats: Statistic;
|
|
22
25
|
statsByEnv: Map<string, Statistic>;
|
|
26
|
+
pieStats?: Statistic;
|
|
27
|
+
pieStatsByEnv?: Map<string, Statistic>;
|
|
23
28
|
envs: EnvironmentIdentity[];
|
|
24
29
|
}) => Promise<void>;
|
|
25
30
|
export declare const generateAttachmentsFiles: (writer: AwesomeDataWriter, attachmentLinks: AttachmentLink[], contentFunction: (id: string) => Promise<ResultFile | undefined>) => Promise<Map<string, string>>;
|
|
@@ -46,6 +51,18 @@ export declare const generateStaticFiles: (payload: AwesomeOptions & {
|
|
|
46
51
|
reportName: string;
|
|
47
52
|
executor?: ReportExecutorInfo;
|
|
48
53
|
runSummary?: ReportRunSummary;
|
|
54
|
+
runSummaryByEnv?: Record<string, ReportRunSummary>;
|
|
49
55
|
}) => Promise<void>;
|
|
50
56
|
export declare const generateAllCharts: (writer: AwesomeDataWriter, store: AllureStore, options: AwesomeOptions, context: PluginContext) => Promise<void>;
|
|
57
|
+
export type AwesomeMetricsWidget = {
|
|
58
|
+
current: MetricSample[];
|
|
59
|
+
history: {
|
|
60
|
+
uuid: string;
|
|
61
|
+
name: string;
|
|
62
|
+
timestamp: number;
|
|
63
|
+
url?: string;
|
|
64
|
+
metrics: Record<string, number>;
|
|
65
|
+
}[];
|
|
66
|
+
};
|
|
67
|
+
export declare const generateMetricsWidget: (writer: AwesomeDataWriter, store: AllureStore, reportUuid: string) => Promise<boolean>;
|
|
51
68
|
export declare const generateTreeFilters: (writer: AwesomeDataWriter, testResults: ReportTestResult[]) => Promise<void>;
|
package/dist/generators.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { defaultChartsConfig } from "@allurereport/charts-api";
|
|
3
|
-
import { appLoaderFaviconDataUri, appLoaderStyles, compareBy, createAppLoaderMarkup, createBaseUrlScript, createFaviconLinkTag, createFontLinkTag, createReportDataScript, stringifyForInlineScript, createScriptTag, createStylesLinkTag, incrementStatistic, joinPosixPath, nullsLast, ordinal, } from "@allurereport/core-api";
|
|
3
|
+
import { appLoaderFaviconDataUri, appLoaderStyles, compareBy, createAppLoaderMarkup, createBaseUrlScript, createFaviconLinkTag, createFontLinkTag, createReportDataScript, stringifyForInlineScript, createScriptTag, createStylesLinkTag, incrementStatistic, joinPosixPath, nullsLast, ordinal, severityLabelName, } from "@allurereport/core-api";
|
|
4
4
|
import { collapseTreeGroups, createTreeByLabels, createTreeByLabelsAndTitlePath, createTreeByTitlePath, preciseTreeLabels, processTree, } from "@allurereport/plugin-api";
|
|
5
5
|
import { copyReportStaticAssets, getReportStaticAsset, readReportStaticAssets, } from "@allurereport/plugin-api/static-assets";
|
|
6
6
|
import { generateCharts, getPieChartValues } from "@allurereport/web-commons";
|
|
@@ -78,7 +78,7 @@ const writeConcurrently = async (items, write, concurrency = 64) => {
|
|
|
78
78
|
await Promise.all(items.slice(i, i + concurrency).map(write));
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
export const generateTestResults = async (_writer, store, trs, options
|
|
81
|
+
export const generateTestResults = async (_writer, store, trs, options) => {
|
|
82
82
|
let convertedTrs = [];
|
|
83
83
|
const related = await store.relatedByTestResultIds(trs.map(({ id }) => id));
|
|
84
84
|
for (const tr of trs) {
|
|
@@ -89,7 +89,11 @@ export const generateTestResults = async (_writer, store, trs, options = {}) =>
|
|
|
89
89
|
const convertedTr = convertTestResult(tr, {
|
|
90
90
|
hideLabels: options.hideLabels,
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
const resolutionIssue = await store.resolutionIssueByTestResultId(tr.id);
|
|
93
|
+
convertedTr.history = (related.historyByTrId.get(tr.id) ?? []).map((item) => ({
|
|
94
|
+
...item,
|
|
95
|
+
url: options.resolveHistoryUrl?.(item.url, options.pluginId, item.id) ?? "",
|
|
96
|
+
}));
|
|
93
97
|
convertedTr.retries = related.retriesByTrId.get(tr.id) ?? [];
|
|
94
98
|
convertedTr.retriesCount = convertedTr.retries.length;
|
|
95
99
|
convertedTr.retry = convertedTr.retriesCount > 0;
|
|
@@ -101,6 +105,7 @@ export const generateTestResults = async (_writer, store, trs, options = {}) =>
|
|
|
101
105
|
type: "attachment",
|
|
102
106
|
}));
|
|
103
107
|
convertedTr.breadcrumbs = createBreadcrumbs(convertedTr);
|
|
108
|
+
convertedTr.resolutionIssue = resolutionIssue;
|
|
104
109
|
convertedTrs.push(convertedTr);
|
|
105
110
|
}
|
|
106
111
|
convertedTrs = convertedTrs.sort(nullsLast(compareBy("start", ordinal()))).map((tr, idx) => ({
|
|
@@ -265,7 +270,7 @@ const buildTreeByTitlePath = (tests) => {
|
|
|
265
270
|
};
|
|
266
271
|
};
|
|
267
272
|
const buildTreeByLabelsAndTitlePathCombined = (tests, labels) => collapseTreeGroups(createTreeByLabelsAndTitlePath(tests, labels, leafFactory, undefined, (group, leaf) => incrementStatistic(group.statistic, leaf.status)));
|
|
268
|
-
const leafFactory = ({ id, name, status, duration, flaky, start, retry, retriesCount, transition, tooltips, historyId, groupedLabels, categories, }) => {
|
|
273
|
+
const leafFactory = ({ id, name, status, duration, flaky, start, retry, retriesCount, resolution, transition, tooltips, historyId, groupedLabels, categories, }) => {
|
|
269
274
|
const leaf = {
|
|
270
275
|
nodeId: id,
|
|
271
276
|
id: historyId ?? id,
|
|
@@ -276,9 +281,14 @@ const leafFactory = ({ id, name, status, duration, flaky, start, retry, retriesC
|
|
|
276
281
|
start,
|
|
277
282
|
retry,
|
|
278
283
|
retriesCount,
|
|
284
|
+
resolution,
|
|
279
285
|
transition,
|
|
280
286
|
tooltips,
|
|
281
287
|
};
|
|
288
|
+
const severity = groupedLabels[severityLabelName]?.[0];
|
|
289
|
+
if (severity) {
|
|
290
|
+
leaf.severity = severity;
|
|
291
|
+
}
|
|
282
292
|
if (groupedLabels.tag && groupedLabels.tag.length > 0) {
|
|
283
293
|
leaf.tags = groupedLabels.tag;
|
|
284
294
|
}
|
|
@@ -287,6 +297,53 @@ const leafFactory = ({ id, name, status, duration, flaky, start, retry, retriesC
|
|
|
287
297
|
}
|
|
288
298
|
return leaf;
|
|
289
299
|
};
|
|
300
|
+
const resolutionOrder = ["issue", "muted", "accepted"];
|
|
301
|
+
const getResolutionGroupName = (test) => {
|
|
302
|
+
if (test.resolution === "issue") {
|
|
303
|
+
return test.resolutionIssue?.id ?? test.resolution;
|
|
304
|
+
}
|
|
305
|
+
return test.resolutionComment ?? test.resolution ?? "";
|
|
306
|
+
};
|
|
307
|
+
const resolutionTestResultFactory = (test, index) => ({
|
|
308
|
+
nodeId: test.id,
|
|
309
|
+
id: test.historyId ?? test.id,
|
|
310
|
+
name: test.name,
|
|
311
|
+
status: test.status,
|
|
312
|
+
duration: test.duration,
|
|
313
|
+
flaky: test.flaky,
|
|
314
|
+
transition: test.transition,
|
|
315
|
+
retry: test.retry,
|
|
316
|
+
retriesCount: test.retriesCount,
|
|
317
|
+
resolution: test.resolution,
|
|
318
|
+
groupOrder: index + 1,
|
|
319
|
+
tooltips: test.tooltips,
|
|
320
|
+
});
|
|
321
|
+
export const generateResolutionCategories = async (writer, tests, filename = "resolution-categories.json") => {
|
|
322
|
+
const groupsById = new Map();
|
|
323
|
+
tests
|
|
324
|
+
.filter((test) => !test.isRetry && test.resolution)
|
|
325
|
+
.forEach((test) => {
|
|
326
|
+
const resolution = test.resolution;
|
|
327
|
+
const groupId = resolution === "issue"
|
|
328
|
+
? `${resolution}:${test.resolutionIssue?.id ?? test.id}`
|
|
329
|
+
: `${resolution}:${test.resolutionComment ?? test.id}`;
|
|
330
|
+
const group = groupsById.get(groupId) ?? {
|
|
331
|
+
id: groupId,
|
|
332
|
+
resolution,
|
|
333
|
+
name: getResolutionGroupName(test),
|
|
334
|
+
comment: test.resolutionComment ?? test.resolutionIssue?.comment,
|
|
335
|
+
issue: test.resolutionIssue,
|
|
336
|
+
testResults: [],
|
|
337
|
+
};
|
|
338
|
+
group.testResults.push(resolutionTestResultFactory(test, group.testResults.length));
|
|
339
|
+
groupsById.set(groupId, group);
|
|
340
|
+
});
|
|
341
|
+
const groups = [...groupsById.values()].sort((a, b) => {
|
|
342
|
+
const resolutionDiff = resolutionOrder.indexOf(a.resolution) - resolutionOrder.indexOf(b.resolution);
|
|
343
|
+
return resolutionDiff || a.name.localeCompare(b.name);
|
|
344
|
+
});
|
|
345
|
+
await writer.writeWidget(filename, { groups });
|
|
346
|
+
};
|
|
290
347
|
export const generateEnvironmentJson = async (writer, env) => {
|
|
291
348
|
await writer.writeWidget("allure_environment.json", env);
|
|
292
349
|
};
|
|
@@ -304,16 +361,16 @@ export const generateVariables = async (writer, store) => {
|
|
|
304
361
|
}
|
|
305
362
|
};
|
|
306
363
|
export const generateStatistic = async (writer, data) => {
|
|
307
|
-
const { stats, statsByEnv, envs } = data;
|
|
364
|
+
const { stats, statsByEnv, pieStats = stats, pieStatsByEnv, envs } = data;
|
|
308
365
|
await writer.writeWidget("statistic.json", stats);
|
|
309
|
-
await writer.writeWidget("pie_chart.json", getPieChartValues(
|
|
366
|
+
await writer.writeWidget("pie_chart.json", getPieChartValues(pieStats));
|
|
310
367
|
for (const env of envs) {
|
|
311
368
|
const envStats = statsByEnv.get(env.id);
|
|
312
369
|
if (!envStats) {
|
|
313
370
|
continue;
|
|
314
371
|
}
|
|
315
372
|
await writer.writeWidget(joinPosixPath(env.id, "statistic.json"), envStats);
|
|
316
|
-
await writer.writeWidget(joinPosixPath(env.id, "pie_chart.json"), envStats);
|
|
373
|
+
await writer.writeWidget(joinPosixPath(env.id, "pie_chart.json"), getPieChartValues(pieStatsByEnv?.get(env.id) ?? envStats));
|
|
317
374
|
}
|
|
318
375
|
};
|
|
319
376
|
export const generateAttachmentsFiles = async (writer, attachmentLinks, contentFunction) => {
|
|
@@ -397,12 +454,12 @@ export const generateQualityGateResults = async (writer, qualityGateResults = {}
|
|
|
397
454
|
await writer.writeWidget("quality-gate.json", resultsWithTrees);
|
|
398
455
|
};
|
|
399
456
|
export const generateStaticFiles = async (payload) => {
|
|
400
|
-
const { id, reportName = "Allure Report", reportLanguage = "en", logo = "", theme = "auto", groupBy, reportFiles, reportDataFiles, reportUuid, allureVersion, layout = "base", defaultSection = "", ci, executor, runSummary, stepTreeExpansion, defaultSortBy, } = payload;
|
|
457
|
+
const { id, reportName = "Allure Report", reportLanguage = "en", logo = "", theme = "auto", groupBy, reportFiles, reportDataFiles, reportUuid, allureVersion, layout = "base", defaultSection = "", ci, executor, runSummary, runSummaryByEnv, stepTreeExpansion, defaultSortBy, } = payload;
|
|
401
458
|
const staticAssets = await readReportStaticAssets(reportStaticArchive);
|
|
402
459
|
const { manifest } = staticAssets;
|
|
403
460
|
const headTags = [];
|
|
404
461
|
const bodyTags = [];
|
|
405
|
-
const sections = ["charts", "timeline"];
|
|
462
|
+
const sections = payload.sections?.length ? payload.sections : ["charts", "timeline"];
|
|
406
463
|
if (!payload.singleFile) {
|
|
407
464
|
for (const key in manifest) {
|
|
408
465
|
const fileName = manifest[key];
|
|
@@ -442,6 +499,7 @@ export const generateStaticFiles = async (payload) => {
|
|
|
442
499
|
ci,
|
|
443
500
|
executor,
|
|
444
501
|
runSummary,
|
|
502
|
+
runSummaryByEnv,
|
|
445
503
|
layout,
|
|
446
504
|
allureVersion,
|
|
447
505
|
sections,
|
|
@@ -478,6 +536,26 @@ export const generateAllCharts = async (writer, store, options, context) => {
|
|
|
478
536
|
await writer.writeWidget("charts.json", generatedChartsData);
|
|
479
537
|
}
|
|
480
538
|
};
|
|
539
|
+
export const generateMetricsWidget = async (writer, store, reportUuid) => {
|
|
540
|
+
const current = await store.allMetrics();
|
|
541
|
+
if (current.length === 0) {
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
const history = (await store.allHistoryDataPoints())
|
|
545
|
+
.filter(({ uuid, metrics = {} }) => uuid !== reportUuid && Object.keys(metrics).length > 0)
|
|
546
|
+
.map(({ uuid, name, timestamp, url, metrics = {} }) => ({
|
|
547
|
+
uuid,
|
|
548
|
+
name,
|
|
549
|
+
timestamp,
|
|
550
|
+
...(url ? { url } : {}),
|
|
551
|
+
metrics,
|
|
552
|
+
}));
|
|
553
|
+
await writer.writeWidget("metrics.json", {
|
|
554
|
+
current,
|
|
555
|
+
history,
|
|
556
|
+
});
|
|
557
|
+
return true;
|
|
558
|
+
};
|
|
481
559
|
export const generateTreeFilters = async (writer, testResults) => {
|
|
482
560
|
const trTags = new Set();
|
|
483
561
|
const trCategories = new Set();
|
package/dist/plugin.js
CHANGED
|
@@ -9,17 +9,31 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
9
9
|
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");
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
|
-
var _AwesomePlugin_writer, _AwesomePlugin_generate;
|
|
13
|
-
import { incrementStatistic, joinPosixPath } from "@allurereport/core-api";
|
|
12
|
+
var _AwesomePlugin_writer, _AwesomePlugin_generateAfterStart, _AwesomePlugin_generate;
|
|
13
|
+
import { incrementStatistic, joinPosixPath, } from "@allurereport/core-api";
|
|
14
14
|
import { createPluginSummary, } from "@allurereport/plugin-api";
|
|
15
15
|
import { preciseTreeLabels } from "@allurereport/plugin-api";
|
|
16
16
|
import { applyCategoriesToTestResults, generateCategories } from "./categories.js";
|
|
17
17
|
import { generateTimeline } from "./generateTimeline.js";
|
|
18
|
-
import { generateAllCharts, generateAttachmentsFiles, generateEnvironmentJson, generateEnvirontmentsList, generateGlobals, generateHistoryDataPoints, generateNav, generateQualityGateResults, generateSearchIndex, generateStaticFiles, generateStatistic, generateTestCases, generateTestEnvGroups, generateTestResults, generateTree, generateTreeFilters, generateVariables, getRunSummary, } from "./generators.js";
|
|
18
|
+
import { generateAllCharts, generateAttachmentsFiles, generateEnvironmentJson, generateEnvirontmentsList, generateGlobals, generateHistoryDataPoints, generateMetricsWidget, generateNav, generateQualityGateResults, generateResolutionCategories, generateSearchIndex, generateStaticFiles, generateStatistic, generateTestCases, generateTestEnvGroups, generateTestResults, generateTree, generateTreeFilters, generateVariables, getRunSummary, } from "./generators.js";
|
|
19
19
|
import { InMemoryReportDataWriter, ReportFileDataWriter } from "./writer.js";
|
|
20
20
|
const statisticByTestResults = async (store, testResults) => {
|
|
21
21
|
const statistic = { total: 0 };
|
|
22
22
|
const related = await store.relatedByTestResultIds(testResults.map(({ id }) => id));
|
|
23
|
+
const incrementResolution = (testResult) => {
|
|
24
|
+
if (testResult.resolution === "issue") {
|
|
25
|
+
statistic.resolutions ?? (statistic.resolutions = {});
|
|
26
|
+
statistic.resolutions.issues = (statistic.resolutions.issues ?? 0) + 1;
|
|
27
|
+
}
|
|
28
|
+
if (testResult.resolution === "muted") {
|
|
29
|
+
statistic.resolutions ?? (statistic.resolutions = {});
|
|
30
|
+
statistic.resolutions.muted = (statistic.resolutions.muted ?? 0) + 1;
|
|
31
|
+
}
|
|
32
|
+
if (testResult.resolution === "accepted") {
|
|
33
|
+
statistic.resolutions ?? (statistic.resolutions = {});
|
|
34
|
+
statistic.resolutions.accepted = (statistic.resolutions.accepted ?? 0) + 1;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
23
37
|
for (const testResult of testResults) {
|
|
24
38
|
if (testResult.isRetry) {
|
|
25
39
|
continue;
|
|
@@ -34,13 +48,21 @@ const statisticByTestResults = async (store, testResults) => {
|
|
|
34
48
|
if (testResult.transition === "new") {
|
|
35
49
|
statistic.new = (statistic.new ?? 0) + 1;
|
|
36
50
|
}
|
|
51
|
+
incrementResolution(testResult);
|
|
37
52
|
}
|
|
38
53
|
return statistic;
|
|
39
54
|
};
|
|
55
|
+
const isActiveStatisticTestResult = (testResult) => testResult.resolution !== "muted" && testResult.resolution !== "accepted";
|
|
40
56
|
export class AwesomePlugin {
|
|
41
57
|
constructor(options = {}) {
|
|
42
58
|
this.options = options;
|
|
43
59
|
_AwesomePlugin_writer.set(this, void 0);
|
|
60
|
+
_AwesomePlugin_generateAfterStart.set(this, async (context, store) => {
|
|
61
|
+
if (!__classPrivateFieldGet(this, _AwesomePlugin_writer, "f")) {
|
|
62
|
+
throw new Error("call start first");
|
|
63
|
+
}
|
|
64
|
+
await __classPrivateFieldGet(this, _AwesomePlugin_generate, "f").call(this, context, store);
|
|
65
|
+
});
|
|
44
66
|
_AwesomePlugin_generate.set(this, async (context, store) => {
|
|
45
67
|
const { singleFile, groupBy = [], filter, appendTitlePath } = this.options ?? {};
|
|
46
68
|
const hideLabels = context.hideLabels;
|
|
@@ -53,6 +75,8 @@ export class AwesomePlugin {
|
|
|
53
75
|
const statistics = await store.testsStatistic(filter);
|
|
54
76
|
const environments = await store.allEnvironmentIdentities();
|
|
55
77
|
const envStatistics = new Map();
|
|
78
|
+
const pieStatistics = await statisticByTestResults(store, allTrs.filter(isActiveStatisticTestResult));
|
|
79
|
+
const pieEnvStatistics = new Map();
|
|
56
80
|
const allTestEnvGroups = await store.allTestEnvGroups();
|
|
57
81
|
const globalAttachments = await store.allGlobalAttachments();
|
|
58
82
|
const globalAttachmentsByEnv = await store.allGlobalAttachmentsByEnv();
|
|
@@ -83,15 +107,31 @@ export class AwesomePlugin {
|
|
|
83
107
|
}
|
|
84
108
|
}
|
|
85
109
|
await Promise.all(environments.map(async ({ id }) => {
|
|
86
|
-
|
|
110
|
+
const envTrs = trsByEnvId.get(id) ?? [];
|
|
111
|
+
envStatistics.set(id, await statisticByTestResults(store, envTrs));
|
|
112
|
+
pieEnvStatistics.set(id, await statisticByTestResults(store, envTrs.filter(isActiveStatisticTestResult)));
|
|
87
113
|
}));
|
|
114
|
+
const runSummaryByEnv = {};
|
|
115
|
+
for (const { id } of environments) {
|
|
116
|
+
const envRunSummary = getRunSummary(trsByEnvId.get(id) ?? []);
|
|
117
|
+
if (envRunSummary) {
|
|
118
|
+
runSummaryByEnv[id] = envRunSummary;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
88
121
|
await generateStatistic(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), {
|
|
89
122
|
stats: statistics,
|
|
90
123
|
statsByEnv: envStatistics,
|
|
124
|
+
pieStats: pieStatistics,
|
|
125
|
+
pieStatsByEnv: pieEnvStatistics,
|
|
91
126
|
envs: environments,
|
|
92
127
|
});
|
|
93
128
|
await generateAllCharts(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, this.options, context);
|
|
94
|
-
const
|
|
129
|
+
const hasMetrics = await generateMetricsWidget(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, context.reportUuid);
|
|
130
|
+
const convertedTrs = await generateTestResults(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, allTrs, {
|
|
131
|
+
pluginId: context.id,
|
|
132
|
+
hideLabels,
|
|
133
|
+
resolveHistoryUrl: context.history?.resolveTestResultUrl,
|
|
134
|
+
});
|
|
95
135
|
applyCategoriesToTestResults(convertedTrs, categories);
|
|
96
136
|
await generateCategories(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), {
|
|
97
137
|
tests: convertedTrs,
|
|
@@ -101,6 +141,7 @@ export class AwesomePlugin {
|
|
|
101
141
|
defaultEnvironment: "default",
|
|
102
142
|
selectedEnvironmentCount: environments.length,
|
|
103
143
|
});
|
|
144
|
+
await generateResolutionCategories(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), convertedTrs);
|
|
104
145
|
const hasGroupBy = groupBy.length > 0;
|
|
105
146
|
await generateTimeline(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), allTrs, this.options, envIdByTrId);
|
|
106
147
|
const treeLabels = hasGroupBy
|
|
@@ -131,6 +172,7 @@ export class AwesomePlugin {
|
|
|
131
172
|
selectedEnvironmentCount: 1,
|
|
132
173
|
filename: joinPosixPath(reportEnvironment.id, "categories.json"),
|
|
133
174
|
});
|
|
175
|
+
await generateResolutionCategories(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), envConvertedTrs, joinPosixPath(reportEnvironment.id, "resolution-categories.json"));
|
|
134
176
|
}
|
|
135
177
|
await generateTreeFilters(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), convertedTrs);
|
|
136
178
|
await generateEnvirontmentsList(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store);
|
|
@@ -153,8 +195,13 @@ export class AwesomePlugin {
|
|
|
153
195
|
contentFunction: (id) => store.attachmentContentById(id),
|
|
154
196
|
});
|
|
155
197
|
const reportDataFiles = singleFile ? __classPrivateFieldGet(this, _AwesomePlugin_writer, "f").reportFiles() : [];
|
|
198
|
+
const configuredSections = this.options.sections ?? ["charts", "timeline"];
|
|
199
|
+
const sections = hasMetrics
|
|
200
|
+
? [...new Set([...configuredSections, "metrics"])]
|
|
201
|
+
: configuredSections.filter((section) => section !== "metrics");
|
|
156
202
|
await generateStaticFiles({
|
|
157
203
|
...this.options,
|
|
204
|
+
sections,
|
|
158
205
|
id: context.id,
|
|
159
206
|
allureVersion: context.allureVersion,
|
|
160
207
|
reportFiles: context.reportFiles,
|
|
@@ -163,6 +210,7 @@ export class AwesomePlugin {
|
|
|
163
210
|
ci: context.ci,
|
|
164
211
|
executor,
|
|
165
212
|
runSummary,
|
|
213
|
+
runSummaryByEnv,
|
|
166
214
|
reportDataFiles,
|
|
167
215
|
});
|
|
168
216
|
});
|
|
@@ -176,16 +224,10 @@ export class AwesomePlugin {
|
|
|
176
224
|
await Promise.resolve();
|
|
177
225
|
};
|
|
178
226
|
this.update = async (context, store) => {
|
|
179
|
-
|
|
180
|
-
throw new Error("call start first");
|
|
181
|
-
}
|
|
182
|
-
await __classPrivateFieldGet(this, _AwesomePlugin_generate, "f").call(this, context, store);
|
|
227
|
+
await __classPrivateFieldGet(this, _AwesomePlugin_generateAfterStart, "f").call(this, context, store);
|
|
183
228
|
};
|
|
184
229
|
this.done = async (context, store) => {
|
|
185
|
-
|
|
186
|
-
throw new Error("call start first");
|
|
187
|
-
}
|
|
188
|
-
await __classPrivateFieldGet(this, _AwesomePlugin_generate, "f").call(this, context, store);
|
|
230
|
+
await __classPrivateFieldGet(this, _AwesomePlugin_generateAfterStart, "f").call(this, context, store);
|
|
189
231
|
};
|
|
190
232
|
}
|
|
191
233
|
async info(context, store) {
|
|
@@ -204,4 +246,4 @@ export class AwesomePlugin {
|
|
|
204
246
|
});
|
|
205
247
|
}
|
|
206
248
|
}
|
|
207
|
-
_AwesomePlugin_writer = new WeakMap(), _AwesomePlugin_generate = new WeakMap();
|
|
249
|
+
_AwesomePlugin_writer = new WeakMap(), _AwesomePlugin_generateAfterStart = new WeakMap(), _AwesomePlugin_generate = new WeakMap();
|
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.18.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.18.0",
|
|
34
|
+
"@allurereport/core-api": "3.18.0",
|
|
35
|
+
"@allurereport/plugin-api": "3.18.0",
|
|
36
|
+
"@allurereport/web-commons": "3.18.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.18.0",
|
|
43
43
|
"@types/d3-shape": "^3.1.8",
|
|
44
44
|
"@types/markdown-it": "^14.1.2",
|
|
45
45
|
"@types/node": "^20",
|