@wdio/allure-reporter 9.0.0-alpha.78 → 9.0.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/build/common/api.d.ts +0 -1
- package/build/common/api.d.ts.map +1 -1
- package/build/constants.d.ts +2 -2
- package/build/constants.d.ts.map +1 -1
- package/build/index.cjs +209 -0
- package/build/index.js +1091 -4
- package/build/reporter.d.ts +2 -3
- package/build/reporter.d.ts.map +1 -1
- package/build/state.d.ts +12 -5
- package/build/state.d.ts.map +1 -1
- package/build/types.d.ts +2 -0
- package/build/types.d.ts.map +1 -1
- package/build/utils.d.ts +24 -7
- package/build/utils.d.ts.map +1 -1
- package/package.json +11 -14
- package/build/common/api.js +0 -236
- package/build/compoundError.js +0 -19
- package/build/constants.js +0 -26
- package/build/reporter.js +0 -649
- package/build/state.js +0 -31
- package/build/types.js +0 -6
- package/build/utils.js +0 -153
- package/cjs/common/api.js +0 -261
- package/cjs/constants.js +0 -29
- package/cjs/package.json +0 -5
- package/tsconfig.cjs.json +0 -13
- /package/{LICENSE-MIT → LICENSE} +0 -0
package/build/common/api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/common/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/common/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,MAAM,EAA+B,MAAM,mBAAmB,CAAA;AAavE;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,QAEhE;AAED;;;;GAI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;;;;GASG;AACH,wBAAgB,OAAO,CACnB,KAAK,EAAE,MAAM,EACb,EACI,OAAO,EACP,IAAmB,EACnB,IAAmB,EACtB,GAAE,GAAQ,EACX,MAAM,GAAE,MAAsB,QAQjC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAEvD;AAED;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,iBAG9D;;;;;;;;;;;;;;;;;;;;;;;;;AAED,wBAuBC"}
|
package/build/constants.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const events: {
|
|
|
21
21
|
readonly addArgument: "allure:addArgument";
|
|
22
22
|
readonly addAllureStep: "allure:addAllureStep";
|
|
23
23
|
};
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
24
|
+
export declare const eachHooks: readonly ["\"before each\" hook", "\"after each\" hook"];
|
|
25
|
+
export declare const allHooks: readonly ["\"before all\" hook", "\"after all\" hook"];
|
|
26
26
|
export declare const linkPlaceholder = "{}";
|
|
27
27
|
//# sourceMappingURL=constants.d.ts.map
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;CAsBT,CAAA;AAEV,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;CAsBT,CAAA;AAEV,eAAO,MAAM,SAAS,0DAAuD,CAAA;AAC7E,eAAO,MAAM,QAAQ,wDAAqD,CAAA;AAC1E,eAAO,MAAM,eAAe,OAAO,CAAA"}
|
package/build/index.cjs
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
const __importMetaUrl = require('url').pathToFileURL(__filename).href;
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/common/api.ts
|
|
22
|
+
var api_exports = {};
|
|
23
|
+
__export(api_exports, {
|
|
24
|
+
addAllureId: () => addAllureId,
|
|
25
|
+
addArgument: () => addArgument,
|
|
26
|
+
addAttachment: () => addAttachment,
|
|
27
|
+
addDescription: () => addDescription,
|
|
28
|
+
addEnvironment: () => addEnvironment,
|
|
29
|
+
addEpic: () => addEpic,
|
|
30
|
+
addFeature: () => addFeature,
|
|
31
|
+
addIssue: () => addIssue,
|
|
32
|
+
addLabel: () => addLabel,
|
|
33
|
+
addLink: () => addLink,
|
|
34
|
+
addOwner: () => addOwner,
|
|
35
|
+
addParentSuite: () => addParentSuite,
|
|
36
|
+
addSeverity: () => addSeverity,
|
|
37
|
+
addStep: () => addStep,
|
|
38
|
+
addStory: () => addStory,
|
|
39
|
+
addSubSuite: () => addSubSuite,
|
|
40
|
+
addSuite: () => addSuite,
|
|
41
|
+
addTag: () => addTag,
|
|
42
|
+
addTestId: () => addTestId,
|
|
43
|
+
default: () => api_default,
|
|
44
|
+
endStep: () => endStep,
|
|
45
|
+
startStep: () => startStep,
|
|
46
|
+
step: () => step
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(api_exports);
|
|
49
|
+
var import_allure_js_commons = require("allure-js-commons");
|
|
50
|
+
|
|
51
|
+
// src/constants.ts
|
|
52
|
+
var events = {
|
|
53
|
+
addLabel: "allure:addLabel",
|
|
54
|
+
addLink: "allure:addLink",
|
|
55
|
+
addFeature: "allure:addFeature",
|
|
56
|
+
addStory: "allure:addStory",
|
|
57
|
+
addEpic: "allure:addEpic",
|
|
58
|
+
addSuite: "allure:addSuite",
|
|
59
|
+
addSubSuite: "allure:addSubSuite",
|
|
60
|
+
addParentSuite: "allure:addParentSuite",
|
|
61
|
+
addOwner: "allure:addOwner",
|
|
62
|
+
addSeverity: "allure:addSeverity",
|
|
63
|
+
addTag: "allure:addTag",
|
|
64
|
+
addIssue: "allure:addIssue",
|
|
65
|
+
addAllureId: "allure:addAllureId",
|
|
66
|
+
addTestId: "allure:addTestId",
|
|
67
|
+
addDescription: "allure:addDescription",
|
|
68
|
+
addAttachment: "allure:addAttachment",
|
|
69
|
+
startStep: "allure:startStep",
|
|
70
|
+
endStep: "allure:endStep",
|
|
71
|
+
addStep: "allure:addStep",
|
|
72
|
+
addArgument: "allure:addArgument",
|
|
73
|
+
addAllureStep: "allure:addAllureStep"
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// src/common/api.ts
|
|
77
|
+
var tellReporter = (event, msg = {}) => {
|
|
78
|
+
process.emit(event, msg);
|
|
79
|
+
};
|
|
80
|
+
function addLabel(name, value) {
|
|
81
|
+
tellReporter(events.addLabel, { name, value });
|
|
82
|
+
}
|
|
83
|
+
function addLink(url, name, type) {
|
|
84
|
+
tellReporter(events.addLink, { url, name, type });
|
|
85
|
+
}
|
|
86
|
+
function addAllureId(id) {
|
|
87
|
+
tellReporter(events.addAllureId, { id });
|
|
88
|
+
}
|
|
89
|
+
function addFeature(featureName) {
|
|
90
|
+
tellReporter(events.addFeature, { featureName });
|
|
91
|
+
}
|
|
92
|
+
function addSeverity(severity) {
|
|
93
|
+
tellReporter(events.addSeverity, { severity });
|
|
94
|
+
}
|
|
95
|
+
function addIssue(issue) {
|
|
96
|
+
tellReporter(events.addIssue, { issue });
|
|
97
|
+
}
|
|
98
|
+
function addTestId(testId) {
|
|
99
|
+
tellReporter(events.addTestId, { testId });
|
|
100
|
+
}
|
|
101
|
+
function addStory(storyName) {
|
|
102
|
+
tellReporter(events.addStory, { storyName });
|
|
103
|
+
}
|
|
104
|
+
function addSuite(suiteName) {
|
|
105
|
+
tellReporter(events.addSuite, { suiteName });
|
|
106
|
+
}
|
|
107
|
+
function addParentSuite(suiteName) {
|
|
108
|
+
tellReporter(events.addParentSuite, { suiteName });
|
|
109
|
+
}
|
|
110
|
+
function addSubSuite(suiteName) {
|
|
111
|
+
tellReporter(events.addSubSuite, { suiteName });
|
|
112
|
+
}
|
|
113
|
+
function addEpic(epicName) {
|
|
114
|
+
tellReporter(events.addEpic, { epicName });
|
|
115
|
+
}
|
|
116
|
+
function addOwner(owner) {
|
|
117
|
+
tellReporter(events.addOwner, { owner });
|
|
118
|
+
}
|
|
119
|
+
function addTag(tag) {
|
|
120
|
+
tellReporter(events.addTag, { tag });
|
|
121
|
+
}
|
|
122
|
+
function addEnvironment(name, value) {
|
|
123
|
+
console.warn("\u26A0\uFE0F addEnvironment is deprecated and has no longer any functionality. Use reportedEnvironmentVars in wdio config instead. Read more in https://webdriver.io/docs/allure-reporter.");
|
|
124
|
+
}
|
|
125
|
+
function addDescription(description, descriptionType) {
|
|
126
|
+
tellReporter(events.addDescription, { description, descriptionType });
|
|
127
|
+
}
|
|
128
|
+
function addAttachment(name, content, type) {
|
|
129
|
+
if (!type) {
|
|
130
|
+
type = content instanceof Buffer ? "image/png" : typeof content === "string" ? "text/plain" : "application/json";
|
|
131
|
+
}
|
|
132
|
+
tellReporter(events.addAttachment, { name, content, type });
|
|
133
|
+
}
|
|
134
|
+
function startStep(title) {
|
|
135
|
+
tellReporter(events.startStep, title);
|
|
136
|
+
}
|
|
137
|
+
function endStep(status = import_allure_js_commons.Status.PASSED) {
|
|
138
|
+
if (!Object.values(import_allure_js_commons.Status).includes(status)) {
|
|
139
|
+
throw new Error(`Step status must be ${Object.values(import_allure_js_commons.Status).join(" or ")}. You tried to set "${status}"`);
|
|
140
|
+
}
|
|
141
|
+
tellReporter(events.endStep, status);
|
|
142
|
+
}
|
|
143
|
+
function addStep(title, {
|
|
144
|
+
content,
|
|
145
|
+
name = "attachment",
|
|
146
|
+
type = "text/plain"
|
|
147
|
+
} = {}, status = import_allure_js_commons.Status.PASSED) {
|
|
148
|
+
if (!Object.values(import_allure_js_commons.Status).includes(status)) {
|
|
149
|
+
throw new Error(`Step status must be ${Object.values(import_allure_js_commons.Status).join(" or ")}. You tried to set "${status}"`);
|
|
150
|
+
}
|
|
151
|
+
const step2 = content ? { title, attachment: { content, name, type }, status } : { title, status };
|
|
152
|
+
tellReporter(events.addStep, { step: step2 });
|
|
153
|
+
}
|
|
154
|
+
function addArgument(name, value) {
|
|
155
|
+
tellReporter(events.addArgument, { name, value });
|
|
156
|
+
}
|
|
157
|
+
async function step(name, body) {
|
|
158
|
+
const runningStep = new import_allure_js_commons.AllureCommandStepExecutable(name);
|
|
159
|
+
await runningStep.run(body, async (message) => tellReporter(events.addAllureStep, message));
|
|
160
|
+
}
|
|
161
|
+
var api_default = {
|
|
162
|
+
addLabel,
|
|
163
|
+
addLink,
|
|
164
|
+
addAllureId,
|
|
165
|
+
addFeature,
|
|
166
|
+
addSeverity,
|
|
167
|
+
addIssue,
|
|
168
|
+
addTestId,
|
|
169
|
+
addStory,
|
|
170
|
+
addSuite,
|
|
171
|
+
addParentSuite,
|
|
172
|
+
addSubSuite,
|
|
173
|
+
addEpic,
|
|
174
|
+
addOwner,
|
|
175
|
+
addTag,
|
|
176
|
+
addEnvironment,
|
|
177
|
+
addDescription,
|
|
178
|
+
addAttachment,
|
|
179
|
+
startStep,
|
|
180
|
+
endStep,
|
|
181
|
+
addStep,
|
|
182
|
+
addArgument,
|
|
183
|
+
step
|
|
184
|
+
};
|
|
185
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
186
|
+
0 && (module.exports = {
|
|
187
|
+
addAllureId,
|
|
188
|
+
addArgument,
|
|
189
|
+
addAttachment,
|
|
190
|
+
addDescription,
|
|
191
|
+
addEnvironment,
|
|
192
|
+
addEpic,
|
|
193
|
+
addFeature,
|
|
194
|
+
addIssue,
|
|
195
|
+
addLabel,
|
|
196
|
+
addLink,
|
|
197
|
+
addOwner,
|
|
198
|
+
addParentSuite,
|
|
199
|
+
addSeverity,
|
|
200
|
+
addStep,
|
|
201
|
+
addStory,
|
|
202
|
+
addSubSuite,
|
|
203
|
+
addSuite,
|
|
204
|
+
addTag,
|
|
205
|
+
addTestId,
|
|
206
|
+
endStep,
|
|
207
|
+
startStep,
|
|
208
|
+
step
|
|
209
|
+
});
|