@allurereport/plugin-dashboard 3.0.1 → 3.2.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/generators.d.ts +2 -1
- package/dist/generators.js +5 -5
- package/dist/model.d.ts +1 -1
- package/dist/plugin.js +3 -3
- package/package.json +6 -6
package/dist/generators.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { TestResult } from "@allurereport/core-api";
|
|
1
2
|
import { type AllureStore, type PluginContext, type ReportFiles } from "@allurereport/plugin-api";
|
|
2
3
|
import type { DashboardOptions, DashboardPluginOptions, TemplateManifest } from "./model.js";
|
|
3
4
|
import type { DashboardDataWriter, ReportFile } from "./writer.js";
|
|
4
5
|
export declare const readTemplateManifest: (singleFileMode?: boolean) => Promise<TemplateManifest>;
|
|
5
|
-
export declare const generateAllCharts: (writer: DashboardDataWriter, store: AllureStore, options: DashboardPluginOptions, context: PluginContext) => Promise<void>;
|
|
6
|
+
export declare const generateAllCharts: (writer: DashboardDataWriter, store: AllureStore, options: DashboardPluginOptions, context: PluginContext, filter?: (testResult: TestResult) => boolean) => Promise<void>;
|
|
6
7
|
export declare const generateEnvirontmentsList: (writer: DashboardDataWriter, store: AllureStore) => Promise<void>;
|
|
7
8
|
export declare const generateStaticFiles: (payload: DashboardOptions & {
|
|
8
9
|
allureVersion: string;
|
package/dist/generators.js
CHANGED
|
@@ -14,6 +14,9 @@ const template = `<!DOCTYPE html>
|
|
|
14
14
|
<title> {{ reportName }} </title>
|
|
15
15
|
<link rel="icon" href="favicon.ico">
|
|
16
16
|
{{{ headTags }}}
|
|
17
|
+
<script>
|
|
18
|
+
window.allureReportOptions = {{{ reportOptions }}}
|
|
19
|
+
</script>
|
|
17
20
|
</head>
|
|
18
21
|
<body>
|
|
19
22
|
<div id="app"></div>
|
|
@@ -36,9 +39,6 @@ const template = `<!DOCTYPE html>
|
|
|
36
39
|
});
|
|
37
40
|
</script>
|
|
38
41
|
{{/if}}
|
|
39
|
-
<script>
|
|
40
|
-
window.allureReportOptions = {{{ reportOptions }}}
|
|
41
|
-
</script>
|
|
42
42
|
{{{ reportFilesScript }}}
|
|
43
43
|
</body>
|
|
44
44
|
</html>
|
|
@@ -48,9 +48,9 @@ export const readTemplateManifest = async (singleFileMode) => {
|
|
|
48
48
|
const templateManifest = await readFile(templateManifestSource, { encoding: "utf-8" });
|
|
49
49
|
return JSON.parse(templateManifest);
|
|
50
50
|
};
|
|
51
|
-
export const generateAllCharts = async (writer, store, options, context) => {
|
|
51
|
+
export const generateAllCharts = async (writer, store, options, context, filter) => {
|
|
52
52
|
const { layout = defaultChartsConfig } = options;
|
|
53
|
-
const generatedChartsData = await generateCharts(layout, store, context.reportName, randomUUID);
|
|
53
|
+
const generatedChartsData = await generateCharts(layout, store, context.reportName, randomUUID, filter);
|
|
54
54
|
if (Object.keys(generatedChartsData.general).length > 0) {
|
|
55
55
|
await writer.writeWidget("charts.json", generatedChartsData);
|
|
56
56
|
}
|
package/dist/model.d.ts
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -19,7 +19,7 @@ export class DashboardPlugin {
|
|
|
19
19
|
this.options = options;
|
|
20
20
|
_DashboardPlugin_writer.set(this, void 0);
|
|
21
21
|
_DashboardPlugin_generate.set(this, async (context, store) => {
|
|
22
|
-
await generateAllCharts(__classPrivateFieldGet(this, _DashboardPlugin_writer, "f"), store, this.options, context);
|
|
22
|
+
await generateAllCharts(__classPrivateFieldGet(this, _DashboardPlugin_writer, "f"), store, this.options, context, this.options.filter);
|
|
23
23
|
await generateEnvirontmentsList(__classPrivateFieldGet(this, _DashboardPlugin_writer, "f"), store);
|
|
24
24
|
const reportDataFiles = this.options.singleFile ? __classPrivateFieldGet(this, _DashboardPlugin_writer, "f").reportFiles() : [];
|
|
25
25
|
await generateStaticFiles({
|
|
@@ -53,8 +53,8 @@ export class DashboardPlugin {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
async info(context, store) {
|
|
56
|
-
const allTrs =
|
|
57
|
-
const newTrs = await store.allNewTestResults();
|
|
56
|
+
const allTrs = await store.allTestResults({ filter: this.options.filter });
|
|
57
|
+
const newTrs = await store.allNewTestResults(this.options.filter);
|
|
58
58
|
const retryTrs = allTrs.filter((tr) => !!tr?.retries?.length);
|
|
59
59
|
const flakyTrs = allTrs.filter((tr) => !!tr?.flaky);
|
|
60
60
|
const duration = allTrs.reduce((acc, { duration: trDuration = 0 }) => acc + trDuration, 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-dashboard",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Allure Dashboard Plugin – plugin for generating dashboard with a mix of charts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"test": "rimraf ./out && vitest run"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@allurereport/charts-api": "3.0
|
|
36
|
-
"@allurereport/core-api": "3.0
|
|
37
|
-
"@allurereport/plugin-api": "3.0
|
|
38
|
-
"@allurereport/web-commons": "3.0
|
|
39
|
-
"@allurereport/web-dashboard": "3.0
|
|
35
|
+
"@allurereport/charts-api": "3.2.0",
|
|
36
|
+
"@allurereport/core-api": "3.2.0",
|
|
37
|
+
"@allurereport/plugin-api": "3.2.0",
|
|
38
|
+
"@allurereport/web-commons": "3.2.0",
|
|
39
|
+
"@allurereport/web-dashboard": "3.2.0",
|
|
40
40
|
"d3-shape": "^3.2.0",
|
|
41
41
|
"handlebars": "^4.7.8"
|
|
42
42
|
},
|