@allurereport/plugin-awesome 3.17.0 → 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 +1 -0
- package/dist/generators.d.ts +5 -2
- package/dist/generators.js +12 -4
- package/dist/plugin.js +13 -1
- package/dist/static/report.tar +0 -0
- package/package.json +6 -6
package/dist/converters.js
CHANGED
package/dist/generators.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { type AttachmentLink, type EnvironmentIdentity, type EnvironmentItem, type MetricSample, 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>;
|
|
@@ -49,6 +51,7 @@ export declare const generateStaticFiles: (payload: AwesomeOptions & {
|
|
|
49
51
|
reportName: string;
|
|
50
52
|
executor?: ReportExecutorInfo;
|
|
51
53
|
runSummary?: ReportRunSummary;
|
|
54
|
+
runSummaryByEnv?: Record<string, ReportRunSummary>;
|
|
52
55
|
}) => Promise<void>;
|
|
53
56
|
export declare const generateAllCharts: (writer: AwesomeDataWriter, store: AllureStore, options: AwesomeOptions, context: PluginContext) => Promise<void>;
|
|
54
57
|
export type AwesomeMetricsWidget = {
|
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) {
|
|
@@ -90,7 +90,10 @@ export const generateTestResults = async (_writer, store, trs, options = {}) =>
|
|
|
90
90
|
hideLabels: options.hideLabels,
|
|
91
91
|
});
|
|
92
92
|
const resolutionIssue = await store.resolutionIssueByTestResultId(tr.id);
|
|
93
|
-
convertedTr.history = related.historyByTrId.get(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
|
+
}));
|
|
94
97
|
convertedTr.retries = related.retriesByTrId.get(tr.id) ?? [];
|
|
95
98
|
convertedTr.retriesCount = convertedTr.retries.length;
|
|
96
99
|
convertedTr.retry = convertedTr.retriesCount > 0;
|
|
@@ -282,6 +285,10 @@ const leafFactory = ({ id, name, status, duration, flaky, start, retry, retriesC
|
|
|
282
285
|
transition,
|
|
283
286
|
tooltips,
|
|
284
287
|
};
|
|
288
|
+
const severity = groupedLabels[severityLabelName]?.[0];
|
|
289
|
+
if (severity) {
|
|
290
|
+
leaf.severity = severity;
|
|
291
|
+
}
|
|
285
292
|
if (groupedLabels.tag && groupedLabels.tag.length > 0) {
|
|
286
293
|
leaf.tags = groupedLabels.tag;
|
|
287
294
|
}
|
|
@@ -447,7 +454,7 @@ export const generateQualityGateResults = async (writer, qualityGateResults = {}
|
|
|
447
454
|
await writer.writeWidget("quality-gate.json", resultsWithTrees);
|
|
448
455
|
};
|
|
449
456
|
export const generateStaticFiles = async (payload) => {
|
|
450
|
-
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;
|
|
451
458
|
const staticAssets = await readReportStaticAssets(reportStaticArchive);
|
|
452
459
|
const { manifest } = staticAssets;
|
|
453
460
|
const headTags = [];
|
|
@@ -492,6 +499,7 @@ export const generateStaticFiles = async (payload) => {
|
|
|
492
499
|
ci,
|
|
493
500
|
executor,
|
|
494
501
|
runSummary,
|
|
502
|
+
runSummaryByEnv,
|
|
495
503
|
layout,
|
|
496
504
|
allureVersion,
|
|
497
505
|
sections,
|
package/dist/plugin.js
CHANGED
|
@@ -111,6 +111,13 @@ export class AwesomePlugin {
|
|
|
111
111
|
envStatistics.set(id, await statisticByTestResults(store, envTrs));
|
|
112
112
|
pieEnvStatistics.set(id, await statisticByTestResults(store, envTrs.filter(isActiveStatisticTestResult)));
|
|
113
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
|
+
}
|
|
114
121
|
await generateStatistic(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), {
|
|
115
122
|
stats: statistics,
|
|
116
123
|
statsByEnv: envStatistics,
|
|
@@ -120,7 +127,11 @@ export class AwesomePlugin {
|
|
|
120
127
|
});
|
|
121
128
|
await generateAllCharts(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, this.options, context);
|
|
122
129
|
const hasMetrics = await generateMetricsWidget(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, context.reportUuid);
|
|
123
|
-
const convertedTrs = await generateTestResults(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, allTrs, {
|
|
130
|
+
const convertedTrs = await generateTestResults(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, allTrs, {
|
|
131
|
+
pluginId: context.id,
|
|
132
|
+
hideLabels,
|
|
133
|
+
resolveHistoryUrl: context.history?.resolveTestResultUrl,
|
|
134
|
+
});
|
|
124
135
|
applyCategoriesToTestResults(convertedTrs, categories);
|
|
125
136
|
await generateCategories(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), {
|
|
126
137
|
tests: convertedTrs,
|
|
@@ -199,6 +210,7 @@ export class AwesomePlugin {
|
|
|
199
210
|
ci: context.ci,
|
|
200
211
|
executor,
|
|
201
212
|
runSummary,
|
|
213
|
+
runSummaryByEnv,
|
|
202
214
|
reportDataFiles,
|
|
203
215
|
});
|
|
204
216
|
});
|
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",
|