@allurereport/plugin-api 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/plugin.d.ts +7 -3
- package/dist/qualityGate.d.ts +2 -0
- package/dist/store.d.ts +6 -4
- package/dist/store.js +1 -1
- package/dist/utils/tree.js +5 -2
- package/package.json +2 -2
package/dist/plugin.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface PluginContext {
|
|
|
24
24
|
reportName: string;
|
|
25
25
|
reportFiles: ReportFiles;
|
|
26
26
|
reportUrl?: string;
|
|
27
|
+
output: string;
|
|
27
28
|
ci?: CiDescriptor;
|
|
28
29
|
}
|
|
29
30
|
export type SummaryTestResult = Pick<TestResult, "name" | "id" | "status" | "duration">;
|
|
@@ -56,7 +57,10 @@ export interface BatchOptions {
|
|
|
56
57
|
maxTimeout?: number;
|
|
57
58
|
}
|
|
58
59
|
export interface RealtimeSubscriber {
|
|
59
|
-
onGlobalAttachment(listener: (
|
|
60
|
+
onGlobalAttachment(listener: (payload: {
|
|
61
|
+
attachment: ResultFile;
|
|
62
|
+
fileName?: string;
|
|
63
|
+
}) => Promise<void>): () => void;
|
|
60
64
|
onGlobalExitCode(listener: (payload: ExitCode) => Promise<void>): () => void;
|
|
61
65
|
onGlobalError(listener: (error: TestError) => Promise<void>): () => void;
|
|
62
66
|
onQualityGateResults(listener: (payload: QualityGateValidationResult[]) => Promise<void>): () => void;
|
|
@@ -65,7 +69,7 @@ export interface RealtimeSubscriber {
|
|
|
65
69
|
onAttachmentFiles(listener: (afIds: string[]) => Promise<void>, options?: BatchOptions): () => void;
|
|
66
70
|
}
|
|
67
71
|
export interface RealtimeEventsDispatcher {
|
|
68
|
-
sendGlobalAttachment(attachment: ResultFile): void;
|
|
72
|
+
sendGlobalAttachment(attachment: ResultFile, fileName?: string): void;
|
|
69
73
|
sendGlobalExitCode(payload: ExitCode): void;
|
|
70
74
|
sendGlobalError(error: TestError): void;
|
|
71
75
|
sendQualityGateResults(payload: QualityGateValidationResult[]): void;
|
|
@@ -77,5 +81,5 @@ export interface Plugin {
|
|
|
77
81
|
start?(context: PluginContext, store: AllureStore, realtime: RealtimeSubscriber): Promise<void>;
|
|
78
82
|
update?(context: PluginContext, store: AllureStore): Promise<void>;
|
|
79
83
|
done?(context: PluginContext, store: AllureStore): Promise<void>;
|
|
80
|
-
info?(context: PluginContext, store: AllureStore): Promise<PluginSummary>;
|
|
84
|
+
info?(context: PluginContext, store: AllureStore): Promise<PluginSummary | undefined>;
|
|
81
85
|
}
|
package/dist/qualityGate.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type QualityGateValidationResult = {
|
|
|
5
5
|
actual: any;
|
|
6
6
|
rule: string;
|
|
7
7
|
message: string;
|
|
8
|
+
environment?: string;
|
|
8
9
|
};
|
|
9
10
|
export type QualityGateRules = Record<string, any> & {
|
|
10
11
|
id?: string;
|
|
@@ -30,6 +31,7 @@ export type QualityGateRule<T = any, K = T> = {
|
|
|
30
31
|
trs: TestResult[];
|
|
31
32
|
knownIssues: KnownTestFailure[];
|
|
32
33
|
state: QualityGateRuleState<K>;
|
|
34
|
+
environment?: string;
|
|
33
35
|
}) => Promise<QualityGateRuleResult>;
|
|
34
36
|
};
|
|
35
37
|
export type QualityGateConfig = {
|
package/dist/store.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface AllureStore {
|
|
|
7
7
|
allTestCases: () => Promise<TestCase[]>;
|
|
8
8
|
allTestResults: (options?: {
|
|
9
9
|
includeHidden?: boolean;
|
|
10
|
+
filter?: TestResultFilter;
|
|
10
11
|
}) => Promise<TestResult[]>;
|
|
11
12
|
allAttachments: () => Promise<AttachmentLink[]>;
|
|
12
13
|
allMetadata: () => Promise<Record<string, any>>;
|
|
@@ -14,8 +15,9 @@ export interface AllureStore {
|
|
|
14
15
|
allHistoryDataPoints: () => Promise<HistoryDataPoint[]>;
|
|
15
16
|
allHistoryDataPointsByEnvironment: (environment: string) => Promise<HistoryDataPoint[]>;
|
|
16
17
|
allKnownIssues: () => Promise<KnownTestFailure[]>;
|
|
17
|
-
allNewTestResults: () => Promise<TestResult[]>;
|
|
18
|
+
allNewTestResults: (filter?: TestResultFilter) => Promise<TestResult[]>;
|
|
18
19
|
qualityGateResults: () => Promise<QualityGateValidationResult[]>;
|
|
20
|
+
qualityGateResultsByEnv: () => Promise<Record<string, QualityGateValidationResult[]>>;
|
|
19
21
|
globalExitCode: () => Promise<ExitCode | undefined>;
|
|
20
22
|
allGlobalErrors: () => Promise<TestError[]>;
|
|
21
23
|
allGlobalAttachments: () => Promise<AttachmentLink[]>;
|
|
@@ -46,13 +48,13 @@ export interface AllureStore {
|
|
|
46
48
|
export interface AllureStoreDump {
|
|
47
49
|
testResults: Record<string, TestResult>;
|
|
48
50
|
attachments: Record<string, AttachmentLink>;
|
|
49
|
-
|
|
51
|
+
globalAttachmentIds: string[];
|
|
50
52
|
globalErrors: TestError[];
|
|
51
53
|
testCases: Record<string, TestCase>;
|
|
52
54
|
fixtures: Record<string, TestFixtureResult>;
|
|
53
55
|
environments: string[];
|
|
54
56
|
reportVariables: ReportVariables;
|
|
55
|
-
|
|
57
|
+
qualityGateResults: QualityGateValidationResult[];
|
|
56
58
|
indexAttachmentByTestResult: Record<string, string[]>;
|
|
57
59
|
indexTestResultByHistoryId: Record<string, string[]>;
|
|
58
60
|
indexTestResultByTestCase: Record<string, string[]>;
|
|
@@ -77,5 +79,5 @@ export declare enum AllureStoreDumpFiles {
|
|
|
77
79
|
IndexAttachmentsByFixture = "index-attachments-by-fixture.json",
|
|
78
80
|
IndexFixturesByTestResult = "index-fixtures-by-test-result.json",
|
|
79
81
|
IndexKnownByHistoryId = "index-known-by-history-id.json",
|
|
80
|
-
|
|
82
|
+
QualityGateResults = "quality-gate-results.json"
|
|
81
83
|
}
|
package/dist/store.js
CHANGED
|
@@ -15,5 +15,5 @@ export var AllureStoreDumpFiles;
|
|
|
15
15
|
AllureStoreDumpFiles["IndexAttachmentsByFixture"] = "index-attachments-by-fixture.json";
|
|
16
16
|
AllureStoreDumpFiles["IndexFixturesByTestResult"] = "index-fixtures-by-test-result.json";
|
|
17
17
|
AllureStoreDumpFiles["IndexKnownByHistoryId"] = "index-known-by-history-id.json";
|
|
18
|
-
AllureStoreDumpFiles["
|
|
18
|
+
AllureStoreDumpFiles["QualityGateResults"] = "quality-gate-results.json";
|
|
19
19
|
})(AllureStoreDumpFiles || (AllureStoreDumpFiles = {}));
|
package/dist/utils/tree.js
CHANGED
|
@@ -39,7 +39,8 @@ const createTree = (data, classifier, leafFactory, groupFactory, addLeafToGroup
|
|
|
39
39
|
if (groupsByClassifier[parentId] === undefined) {
|
|
40
40
|
groupsByClassifier[parentId] = {};
|
|
41
41
|
}
|
|
42
|
-
if (groupsByClassifier[parentId][group] === undefined
|
|
42
|
+
if (groupsByClassifier[parentId][group] === undefined ||
|
|
43
|
+
typeof groupsByClassifier[parentId][group] === "function") {
|
|
43
44
|
const newGroup = groupFactory(parentId, group);
|
|
44
45
|
groupsByClassifier[parentId][group] = newGroup;
|
|
45
46
|
groupsById[newGroup.nodeId] = newGroup;
|
|
@@ -51,7 +52,9 @@ const createTree = (data, classifier, leafFactory, groupFactory, addLeafToGroup
|
|
|
51
52
|
});
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
parentGroups.forEach((parentGroup) =>
|
|
55
|
+
parentGroups.forEach((parentGroup) => {
|
|
56
|
+
addLeaf(parentGroup, leaf.nodeId);
|
|
57
|
+
});
|
|
55
58
|
}
|
|
56
59
|
return {
|
|
57
60
|
root,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-api",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Allure Plugin API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "rimraf ./out && vitest run"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@allurereport/core-api": "3.0
|
|
29
|
+
"@allurereport/core-api": "3.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@stylistic/eslint-plugin": "^2.6.1",
|