@allurereport/plugin-awesome 3.0.0-beta.18 → 3.0.0-beta.19
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/charts.d.ts +3 -12
- package/dist/charts.js +31 -12
- package/dist/generators.js +1 -2
- package/dist/plugin.js +3 -7
- package/package.json +4 -5
package/dist/charts.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type GeneratedChartsData, type PluginContext } from "@allurereport/plugin-api";
|
|
1
|
+
import { type AllureStore, type GeneratedChartsData, type PluginContext } from "@allurereport/plugin-api";
|
|
3
2
|
import type { AwesomeOptions } from "./model.js";
|
|
4
3
|
import type { AwesomeDataWriter } from "./writer.js";
|
|
5
|
-
export declare const generateCharts: (options: AwesomeOptions,
|
|
6
|
-
|
|
7
|
-
statistic: Statistic;
|
|
8
|
-
history: HistoryDataPoint[];
|
|
9
|
-
}) => Promise<GeneratedChartsData | undefined>;
|
|
10
|
-
export declare const generateAllCharts: (writer: AwesomeDataWriter, options: AwesomeOptions, context: PluginContext, stores: {
|
|
11
|
-
trs: TestResult[];
|
|
12
|
-
statistic: Statistic;
|
|
13
|
-
history: HistoryDataPoint[];
|
|
14
|
-
}) => Promise<void>;
|
|
4
|
+
export declare const generateCharts: (options: AwesomeOptions, store: AllureStore, context: PluginContext) => Promise<GeneratedChartsData | undefined>;
|
|
5
|
+
export declare const generateAllCharts: (writer: AwesomeDataWriter, store: AllureStore, options: AwesomeOptions, context: PluginContext) => Promise<void>;
|
package/dist/charts.js
CHANGED
|
@@ -1,31 +1,50 @@
|
|
|
1
1
|
import { ChartType } from "@allurereport/core-api";
|
|
2
|
-
import { generateComingSoonChart, generatePieChart, generateTrendChart, } from "@allurereport/plugin-api";
|
|
2
|
+
import { generateBarChart, generateComingSoonChart, generateHeatMapChart, generatePieChart, generateTreeMapChart, generateTrendChart, } from "@allurereport/plugin-api";
|
|
3
3
|
import { randomUUID } from "crypto";
|
|
4
|
-
export const generateCharts = async (options,
|
|
4
|
+
export const generateCharts = async (options, store, context) => {
|
|
5
5
|
const { charts } = options;
|
|
6
6
|
if (!charts) {
|
|
7
7
|
return undefined;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
const storeData = await Promise.all([
|
|
10
|
+
store.allHistoryDataPoints(),
|
|
11
|
+
store.allTestResults(),
|
|
12
|
+
store.testsStatistic(),
|
|
13
|
+
]).then(([historyDataPoints, testResults, statistic]) => ({
|
|
14
|
+
historyDataPoints,
|
|
15
|
+
testResults,
|
|
16
|
+
statistic,
|
|
17
|
+
}));
|
|
18
|
+
const chartsData = {};
|
|
19
|
+
for (const chartOptions of charts) {
|
|
10
20
|
const chartId = randomUUID();
|
|
11
21
|
let chart;
|
|
12
22
|
if (chartOptions.type === ChartType.Trend) {
|
|
13
|
-
chart = generateTrendChart(chartOptions,
|
|
23
|
+
chart = generateTrendChart(chartOptions, storeData, context);
|
|
14
24
|
}
|
|
15
25
|
else if (chartOptions.type === ChartType.Pie) {
|
|
16
|
-
chart = generatePieChart(chartOptions,
|
|
26
|
+
chart = generatePieChart(chartOptions, storeData);
|
|
17
27
|
}
|
|
18
|
-
else if (
|
|
19
|
-
chart =
|
|
28
|
+
else if (chartOptions.type === ChartType.Bar) {
|
|
29
|
+
chart = generateBarChart(chartOptions, storeData);
|
|
30
|
+
}
|
|
31
|
+
else if (chartOptions.type === ChartType.TreeMap) {
|
|
32
|
+
chart = generateTreeMapChart(chartOptions, storeData);
|
|
33
|
+
}
|
|
34
|
+
else if (chartOptions.type === ChartType.HeatMap) {
|
|
35
|
+
chart = generateHeatMapChart(chartOptions, storeData);
|
|
20
36
|
}
|
|
21
37
|
if (chart) {
|
|
22
|
-
|
|
38
|
+
chartsData[chartId] = chart;
|
|
23
39
|
}
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
else {
|
|
41
|
+
chartsData[chartId] = generateComingSoonChart(chartOptions);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return chartsData;
|
|
26
45
|
};
|
|
27
|
-
export const generateAllCharts = async (writer, options, context
|
|
28
|
-
const charts = await generateCharts(options,
|
|
46
|
+
export const generateAllCharts = async (writer, store, options, context) => {
|
|
47
|
+
const charts = await generateCharts(options, store, context);
|
|
29
48
|
if (charts && Object.keys(charts).length > 0) {
|
|
30
49
|
await writer.writeWidget("charts.json", charts);
|
|
31
50
|
}
|
package/dist/generators.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { compareBy, getPieChartValues, incrementStatistic, nullsLast, ordinal, } from "@allurereport/core-api";
|
|
1
|
+
import { compareBy, createBaseUrlScript, createFontLinkTag, createReportDataScript, createScriptTag, createStylesLinkTag, getPieChartValues, incrementStatistic, nullsLast, ordinal, } from "@allurereport/core-api";
|
|
2
2
|
import { createTreeByLabels, createTreeByTitlePath, filterTree, preciseTreeLabels, sortTree, transformTree, } from "@allurereport/plugin-api";
|
|
3
|
-
import { createBaseUrlScript, createFontLinkTag, createReportDataScript, createScriptTag, createStylesLinkTag, } from "@allurereport/web-commons";
|
|
4
3
|
import Handlebars from "handlebars";
|
|
5
4
|
import { readFile } from "node:fs/promises";
|
|
6
5
|
import { createRequire } from "node:module";
|
package/dist/plugin.js
CHANGED
|
@@ -32,7 +32,6 @@ export class AwesomePlugin {
|
|
|
32
32
|
const environments = await store.allEnvironments();
|
|
33
33
|
const envStatistics = new Map();
|
|
34
34
|
const allTestEnvGroups = await store.allTestEnvGroups();
|
|
35
|
-
const allHistoryDataPoints = await store.allHistoryDataPoints();
|
|
36
35
|
const globalAttachments = await store.allGlobalAttachments();
|
|
37
36
|
const globalExitCode = await store.globalExitCode();
|
|
38
37
|
const globalErrors = await store.allGlobalErrors();
|
|
@@ -44,11 +43,7 @@ export class AwesomePlugin {
|
|
|
44
43
|
statsByEnv: envStatistics,
|
|
45
44
|
envs: environments,
|
|
46
45
|
});
|
|
47
|
-
await generateAllCharts(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), this.options, context
|
|
48
|
-
trs: allTrs,
|
|
49
|
-
statistic: statistics,
|
|
50
|
-
history: allHistoryDataPoints,
|
|
51
|
-
});
|
|
46
|
+
await generateAllCharts(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, this.options, context);
|
|
52
47
|
const convertedTrs = await generateTestResults(__classPrivateFieldGet(this, _AwesomePlugin_writer, "f"), store, allTrs, this.options.filter);
|
|
53
48
|
const hasGroupBy = groupBy.length > 0;
|
|
54
49
|
const treeLabels = hasGroupBy
|
|
@@ -84,9 +79,10 @@ export class AwesomePlugin {
|
|
|
84
79
|
id: context.id,
|
|
85
80
|
allureVersion: context.allureVersion,
|
|
86
81
|
reportFiles: context.reportFiles,
|
|
87
|
-
reportDataFiles,
|
|
88
82
|
reportUuid: context.reportUuid,
|
|
89
83
|
reportName: context.reportName,
|
|
84
|
+
ci: context.ci,
|
|
85
|
+
reportDataFiles,
|
|
90
86
|
});
|
|
91
87
|
});
|
|
92
88
|
this.start = async (context) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-awesome",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.19",
|
|
4
4
|
"description": "Allure Awesome Plugin – brand new HTML report with modern design and new features",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
"test": "rimraf ./out && vitest run"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
34
|
-
"@allurereport/plugin-api": "3.0.0-beta.
|
|
35
|
-
"@allurereport/web-awesome": "3.0.0-beta.
|
|
36
|
-
"@allurereport/web-commons": "3.0.0-beta.18",
|
|
33
|
+
"@allurereport/core-api": "3.0.0-beta.19",
|
|
34
|
+
"@allurereport/plugin-api": "3.0.0-beta.19",
|
|
35
|
+
"@allurereport/web-awesome": "3.0.0-beta.19",
|
|
37
36
|
"d3-shape": "^3.2.0",
|
|
38
37
|
"handlebars": "^4.7.8"
|
|
39
38
|
},
|