@wdio/allure-reporter 8.20.0 → 8.23.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 +9 -3
- package/build/common/api.d.ts.map +1 -1
- package/build/common/api.js +22 -2
- package/build/reporter.js +7 -7
- package/build/utils.d.ts +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +10 -3
- package/cjs/common/api.js +22 -2
- package/package.json +4 -4
package/build/common/api.d.ts
CHANGED
|
@@ -147,13 +147,20 @@ export declare function addArgument(name: string, value: string): void;
|
|
|
147
147
|
*/
|
|
148
148
|
export declare function step(name: string, body: StepBodyFunction): Promise<void>;
|
|
149
149
|
declare const _default: {
|
|
150
|
-
addFeature: typeof addFeature;
|
|
151
|
-
addAllureId: typeof addAllureId;
|
|
152
150
|
addLabel: typeof addLabel;
|
|
151
|
+
addLink: typeof addLink;
|
|
152
|
+
addAllureId: typeof addAllureId;
|
|
153
|
+
addFeature: typeof addFeature;
|
|
153
154
|
addSeverity: typeof addSeverity;
|
|
154
155
|
addIssue: typeof addIssue;
|
|
155
156
|
addTestId: typeof addTestId;
|
|
156
157
|
addStory: typeof addStory;
|
|
158
|
+
addSuite: typeof addSuite;
|
|
159
|
+
addParentSuite: typeof addParentSuite;
|
|
160
|
+
addSubSuite: typeof addSubSuite;
|
|
161
|
+
addEpic: typeof addEpic;
|
|
162
|
+
addOwner: typeof addOwner;
|
|
163
|
+
addTag: typeof addTag;
|
|
157
164
|
addEnvironment: typeof addEnvironment;
|
|
158
165
|
addDescription: typeof addDescription;
|
|
159
166
|
addAttachment: typeof addAttachment;
|
|
@@ -162,7 +169,6 @@ declare const _default: {
|
|
|
162
169
|
addStep: typeof addStep;
|
|
163
170
|
addArgument: typeof addArgument;
|
|
164
171
|
step: typeof step;
|
|
165
|
-
addTag: typeof addTag;
|
|
166
172
|
};
|
|
167
173
|
export default _default;
|
|
168
174
|
//# sourceMappingURL=api.d.ts.map
|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,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/common/api.js
CHANGED
|
@@ -211,6 +211,26 @@ export async function step(name, body) {
|
|
|
211
211
|
await runningStep.run(body, async (message) => tellReporter(events.addAllureStep, message));
|
|
212
212
|
}
|
|
213
213
|
export default {
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
addLabel,
|
|
215
|
+
addLink,
|
|
216
|
+
addAllureId,
|
|
217
|
+
addFeature,
|
|
218
|
+
addSeverity,
|
|
219
|
+
addIssue,
|
|
220
|
+
addTestId,
|
|
221
|
+
addStory,
|
|
222
|
+
addSuite,
|
|
223
|
+
addParentSuite,
|
|
224
|
+
addSubSuite,
|
|
225
|
+
addEpic,
|
|
226
|
+
addOwner,
|
|
227
|
+
addTag,
|
|
228
|
+
addEnvironment,
|
|
229
|
+
addDescription,
|
|
230
|
+
addAttachment,
|
|
231
|
+
startStep,
|
|
232
|
+
endStep,
|
|
233
|
+
addStep,
|
|
234
|
+
addArgument,
|
|
235
|
+
step
|
|
216
236
|
};
|
package/build/reporter.js
CHANGED
|
@@ -3,7 +3,7 @@ import WDIOReporter from '@wdio/reporter';
|
|
|
3
3
|
import { AllureRuntime, AllureGroup, AllureTest, Status as AllureStatus, Stage, LabelName, LinkType, ContentType, AllureCommandStepExecutable, } from 'allure-js-commons';
|
|
4
4
|
import { addFeature, addLink, addOwner, addEpic, addSuite, addSubSuite, addParentSuite, addTag, addLabel, addSeverity, addIssue, addTestId, addStory, addAllureId, addDescription, addAttachment, startStep, endStep, addStep, addArgument, step, } from './common/api.js';
|
|
5
5
|
import { AllureReporterState } from './state.js';
|
|
6
|
-
import { getTestStatus, isEmpty, isMochaEachHooks, getErrorFromFailedTest, isMochaAllHooks, getLinkByTemplate, isScreenshotCommand, getSuiteLabels,
|
|
6
|
+
import { getTestStatus, isEmpty, isMochaEachHooks, getErrorFromFailedTest, isMochaAllHooks, getLinkByTemplate, isScreenshotCommand, getSuiteLabels, setAllureIds, isMochaBeforeEachHook, } from './utils.js';
|
|
7
7
|
import { events } from './constants.js';
|
|
8
8
|
import { TYPE as DescriptionType } from './types.js';
|
|
9
9
|
export default class AllureReporter extends WDIOReporter {
|
|
@@ -82,7 +82,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
82
82
|
while (this._state.currentAllureTestOrStep) {
|
|
83
83
|
const currentTest = this._state.pop();
|
|
84
84
|
if (currentTest instanceof AllureTest) {
|
|
85
|
-
|
|
85
|
+
setAllureIds(currentTest, this._state.currentSuite);
|
|
86
86
|
currentTest.endTest();
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
@@ -106,7 +106,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
106
106
|
currentTest.stage = Stage.PENDING;
|
|
107
107
|
currentTest.status = AllureStatus.SKIPPED;
|
|
108
108
|
if (currentTest instanceof AllureTest) {
|
|
109
|
-
|
|
109
|
+
setAllureIds(currentTest, this._state.currentSuite);
|
|
110
110
|
currentTest.endTest();
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
@@ -125,7 +125,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
125
125
|
currentSpec.detailsTrace = error.stack;
|
|
126
126
|
}
|
|
127
127
|
if (currentSpec instanceof AllureTest) {
|
|
128
|
-
|
|
128
|
+
setAllureIds(currentSpec, this._state.currentSuite);
|
|
129
129
|
currentSpec.endTest();
|
|
130
130
|
}
|
|
131
131
|
else {
|
|
@@ -259,7 +259,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
259
259
|
const currentTest = this._state.pop();
|
|
260
260
|
currentTest.status = AllureStatus.SKIPPED;
|
|
261
261
|
currentTest.stage = Stage.PENDING;
|
|
262
|
-
|
|
262
|
+
setAllureIds(currentTest, this._state.currentSuite);
|
|
263
263
|
currentTest.endTest();
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
@@ -273,7 +273,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
273
273
|
currentTest.detailsMessage = error.message;
|
|
274
274
|
currentTest.detailsTrace = error.stack;
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
setAllureIds(currentTest, this._state.currentSuite);
|
|
277
277
|
currentTest.endTest();
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
@@ -284,7 +284,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
284
284
|
const currentTest = this._state.pop();
|
|
285
285
|
currentTest.status = AllureStatus.PASSED;
|
|
286
286
|
currentTest.stage = Stage.FINISHED;
|
|
287
|
-
|
|
287
|
+
setAllureIds(currentTest, this._state.currentSuite);
|
|
288
288
|
currentTest.endTest();
|
|
289
289
|
return;
|
|
290
290
|
}
|
package/build/utils.d.ts
CHANGED
|
@@ -55,5 +55,5 @@ export declare const getLinkByTemplate: (template: string | undefined, id: strin
|
|
|
55
55
|
export declare const findLast: <T>(arr: T[], predicate: (el: T) => boolean) => T | undefined;
|
|
56
56
|
export declare const isScreenshotCommand: (command: CommandArgs) => boolean;
|
|
57
57
|
export declare const getSuiteLabels: ({ tags }: SuiteStats) => Label[];
|
|
58
|
-
export declare const
|
|
58
|
+
export declare const setAllureIds: (test: AllureTest | undefined, suite: AllureGroup | undefined) => void;
|
|
59
59
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAO,MA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Ac,UAAU,KAAG,KAAK,EAc1D,CAAA;AAED,eAAO,MAAM,YAAY,SAAU,UAAU,GAAG,SAAS,SAAS,WAAW,GAAG,SAAS,SAkBxF,CAAA"}
|
package/build/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import stripAnsi from 'strip-ansi';
|
|
2
|
-
import { Status as AllureStatus, md5 } from 'allure-js-commons';
|
|
2
|
+
import { Status as AllureStatus, md5, LabelName } from 'allure-js-commons';
|
|
3
3
|
import CompoundError from './compoundError.js';
|
|
4
4
|
import { mochaEachHooks, mochaAllHooks, linkPlaceholder } from './constants.js';
|
|
5
5
|
/**
|
|
@@ -133,7 +133,7 @@ export const getSuiteLabels = ({ tags }) => {
|
|
|
133
133
|
return acc;
|
|
134
134
|
}, []);
|
|
135
135
|
};
|
|
136
|
-
export const
|
|
136
|
+
export const setAllureIds = (test, suite) => {
|
|
137
137
|
if (!test) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
@@ -142,5 +142,12 @@ export const setHistoryId = (test, suite) => {
|
|
|
142
142
|
.sort((a, b) => a.name?.localeCompare(b.name))
|
|
143
143
|
.map(it => it.name + it.value)
|
|
144
144
|
.join('');
|
|
145
|
-
|
|
145
|
+
const hash = md5(`${suite?.name}${test.wrappedItem.name}${paramsPart}`);
|
|
146
|
+
test.historyId = hash;
|
|
147
|
+
if ('labels' in test.wrappedItem) {
|
|
148
|
+
if (test.wrappedItem.labels?.find((label) => label.name === LabelName.AS_ID)) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
test.testCaseId = hash;
|
|
146
153
|
};
|
package/cjs/common/api.js
CHANGED
|
@@ -236,6 +236,26 @@ async function step(name, body) {
|
|
|
236
236
|
}
|
|
237
237
|
exports.step = step;
|
|
238
238
|
exports.default = {
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
addLabel,
|
|
240
|
+
addLink,
|
|
241
|
+
addAllureId,
|
|
242
|
+
addFeature,
|
|
243
|
+
addSeverity,
|
|
244
|
+
addIssue,
|
|
245
|
+
addTestId,
|
|
246
|
+
addStory,
|
|
247
|
+
addSuite,
|
|
248
|
+
addParentSuite,
|
|
249
|
+
addSubSuite,
|
|
250
|
+
addEpic,
|
|
251
|
+
addOwner,
|
|
252
|
+
addTag,
|
|
253
|
+
addEnvironment,
|
|
254
|
+
addDescription,
|
|
255
|
+
addAttachment,
|
|
256
|
+
startStep,
|
|
257
|
+
endStep,
|
|
258
|
+
addStep,
|
|
259
|
+
addArgument,
|
|
260
|
+
step
|
|
241
261
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/allure-reporter",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.23.0",
|
|
4
4
|
"description": "A WebdriverIO reporter plugin to create Allure Test Reports",
|
|
5
5
|
"author": "Boris Osipov <osipov.boris@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-allure-reporter",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@types/node": "^20.1.0",
|
|
43
|
-
"@wdio/reporter": "8.
|
|
44
|
-
"@wdio/types": "8.
|
|
43
|
+
"@wdio/reporter": "8.23.0",
|
|
44
|
+
"@wdio/types": "8.23.0",
|
|
45
45
|
"allure-js-commons": "^2.5.0",
|
|
46
46
|
"csv-stringify": "^6.0.4",
|
|
47
47
|
"strip-ansi": "^7.1.0"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "b17ce5f554deb8588cc156ad9676bd4bd13defe7"
|
|
53
53
|
}
|