@allurereport/plugin-classic 3.0.0-beta.10 → 3.0.0-beta.12
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/model.d.ts +2 -1
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.js +12 -0
- package/package.json +6 -6
package/dist/converters.js
CHANGED
package/dist/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TestStatus } from "@allurereport/core-api";
|
|
1
|
+
import type { TestResult, TestStatus } from "@allurereport/core-api";
|
|
2
2
|
export type AwesomeOptions = {
|
|
3
3
|
reportName?: string;
|
|
4
4
|
singleFile?: boolean;
|
|
@@ -11,6 +11,7 @@ export type AwesomeOptions = {
|
|
|
11
11
|
url: string;
|
|
12
12
|
name: string;
|
|
13
13
|
};
|
|
14
|
+
filter?: (tr: TestResult) => boolean;
|
|
14
15
|
};
|
|
15
16
|
export type TemplateManifest = Record<string, string>;
|
|
16
17
|
export type AwesomePluginOptions = AwesomeOptions;
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AllureStore, Plugin, PluginContext } from "@allurereport/plugin-api";
|
|
1
|
+
import type { AllureStore, Plugin, PluginContext, PluginSummary } from "@allurereport/plugin-api";
|
|
2
2
|
import type { AwesomePluginOptions } from "./model.js";
|
|
3
3
|
export declare class AwesomePlugin implements Plugin {
|
|
4
4
|
#private;
|
|
@@ -7,4 +7,5 @@ export declare class AwesomePlugin implements Plugin {
|
|
|
7
7
|
start: (context: PluginContext) => Promise<void>;
|
|
8
8
|
update: (context: PluginContext, store: AllureStore) => Promise<void>;
|
|
9
9
|
done: (context: PluginContext, store: AllureStore) => Promise<void>;
|
|
10
|
+
info(context: PluginContext, store: AllureStore): Promise<PluginSummary>;
|
|
10
11
|
}
|
package/dist/plugin.js
CHANGED
|
@@ -10,6 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
12
|
var _AwesomePlugin_writer, _AwesomePlugin_generate;
|
|
13
|
+
import { getWorstStatus } from "@allurereport/core-api";
|
|
13
14
|
import { preciseTreeLabels } from "@allurereport/plugin-api";
|
|
14
15
|
import { generateAttachmentsFiles, generateEnvironmentJson, generateHistoryDataPoints, generatePieChart, generateStaticFiles, generateStatistic, generateTestResults, generateTree, generateTreeByCategories, } from "./generators.js";
|
|
15
16
|
import { InMemoryReportDataWriter, ReportFileDataWriter } from "./writer.js";
|
|
@@ -71,5 +72,16 @@ export class AwesomePlugin {
|
|
|
71
72
|
await __classPrivateFieldGet(this, _AwesomePlugin_generate, "f").call(this, context, store);
|
|
72
73
|
};
|
|
73
74
|
}
|
|
75
|
+
async info(context, store) {
|
|
76
|
+
const allTrs = (await store.allTestResults()).filter(this.options.filter ? this.options.filter : () => true);
|
|
77
|
+
const duration = allTrs.reduce((acc, { duration: trDuration = 0 }) => acc + trDuration, 0);
|
|
78
|
+
const worstStatus = getWorstStatus(allTrs.map(({ status }) => status));
|
|
79
|
+
return {
|
|
80
|
+
name: this.options.reportName || context.reportName,
|
|
81
|
+
stats: await store.testsStatistic(this.options.filter),
|
|
82
|
+
status: worstStatus ?? "passed",
|
|
83
|
+
duration,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
74
86
|
}
|
|
75
87
|
_AwesomePlugin_writer = new WeakMap(), _AwesomePlugin_generate = new WeakMap();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-classic",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.12",
|
|
4
4
|
"description": "The classic version of Allure HTML report",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -30,11 +30,11 @@
|
|
|
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-classic": "3.0.0-beta.
|
|
37
|
-
"@allurereport/web-commons": "3.0.0-beta.
|
|
33
|
+
"@allurereport/core-api": "3.0.0-beta.12",
|
|
34
|
+
"@allurereport/plugin-api": "3.0.0-beta.12",
|
|
35
|
+
"@allurereport/web-awesome": "3.0.0-beta.12",
|
|
36
|
+
"@allurereport/web-classic": "3.0.0-beta.12",
|
|
37
|
+
"@allurereport/web-commons": "3.0.0-beta.12",
|
|
38
38
|
"d3-shape": "^3.2.0",
|
|
39
39
|
"handlebars": "^4.7.8"
|
|
40
40
|
},
|