allure-codeceptjs 3.12.0 → 3.12.1
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/cjs/reporter.js +104 -15
- package/dist/cjs/reporter.js.map +1 -1
- package/dist/esm/reporter.js +104 -15
- package/dist/esm/reporter.js.map +1 -1
- package/dist/types/reporter.d.ts +14 -3
- package/package.json +4 -4
package/dist/cjs/reporter.js
CHANGED
|
@@ -34,7 +34,8 @@ var getCodeceptStatusFromError = (error, hookName) => {
|
|
|
34
34
|
}
|
|
35
35
|
return isKnownCodeceptVerificationError(error) ? _allureJsCommons.Status.FAILED : _allureJsCommons.Status.BROKEN;
|
|
36
36
|
};
|
|
37
|
-
var
|
|
37
|
+
var isBeforeEachHook = hookName => hookName === "Before";
|
|
38
|
+
var isBeforeHook = hookName => isBeforeEachHook(hookName) || hookName === "BeforeSuite";
|
|
38
39
|
var isErrorInstance = value => {
|
|
39
40
|
var _constructor;
|
|
40
41
|
return value instanceof Error || typeof value === "object" && value !== null && ((_constructor = value.constructor) === null || _constructor === void 0 ? void 0 : _constructor.name) === "Error";
|
|
@@ -47,6 +48,13 @@ var getRecorderPromise = () => {
|
|
|
47
48
|
var _recorder$promise;
|
|
48
49
|
return (_recorder$promise = _codeceptjs.recorder.promise) === null || _recorder$promise === void 0 ? void 0 : _recorder$promise.call(_codeceptjs.recorder);
|
|
49
50
|
};
|
|
51
|
+
var getScreenshotArtifactPath = test => {
|
|
52
|
+
var artifacts = test === null || test === void 0 ? void 0 : test.artifacts;
|
|
53
|
+
if (typeof artifacts !== "object" || artifacts === null || !("screenshot" in artifacts)) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
return typeof artifacts.screenshot === "string" ? artifacts.screenshot : undefined;
|
|
57
|
+
};
|
|
50
58
|
class AllureCodeceptJsReporter extends _allureMocha.default {
|
|
51
59
|
constructor(runner, opts, isInWorker) {
|
|
52
60
|
super(runner, opts, isInWorker);
|
|
@@ -54,6 +62,7 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
|
|
|
54
62
|
_defineProperty(this, "metaStepStack", []);
|
|
55
63
|
_defineProperty(this, "currentLeafStep", void 0);
|
|
56
64
|
_defineProperty(this, "currentTestHookName", void 0);
|
|
65
|
+
_defineProperty(this, "pendingFailedBeforeEachHookTest", void 0);
|
|
57
66
|
_defineProperty(this, "getFrameworkName", () => "codeceptjs");
|
|
58
67
|
_defineProperty(this, "getWorkerId", () => undefined);
|
|
59
68
|
this.registerEvents();
|
|
@@ -62,8 +71,14 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
|
|
|
62
71
|
registerEvents() {
|
|
63
72
|
// Test
|
|
64
73
|
_codeceptjs.event.dispatcher.on(_codeceptjs.event.test.before, this.testStarted.bind(this));
|
|
74
|
+
// A failed CodeceptJS Before hook emits test.failed before the scenario has
|
|
75
|
+
// started in Mocha. Start the Allure test before other failure listeners so
|
|
76
|
+
// their runtime attachments target the test, then defer writing the result
|
|
77
|
+
// until queued failure artifacts, such as screenshots, are available.
|
|
78
|
+
_codeceptjs.event.dispatcher.prependListener(_codeceptjs.event.test.failed, this.beforeHookTestFailed.bind(this));
|
|
65
79
|
_codeceptjs.event.dispatcher.on(_codeceptjs.event.test.failed, this.testFailed.bind(this));
|
|
66
80
|
_codeceptjs.event.dispatcher.on(_codeceptjs.event.test.finished, this.testFinished.bind(this));
|
|
81
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.hook.finished, this.hookFinished.bind(this));
|
|
67
82
|
// Step
|
|
68
83
|
_codeceptjs.event.dispatcher.on(_codeceptjs.event.step.started, this.stepStarted.bind(this));
|
|
69
84
|
_codeceptjs.event.dispatcher.on(_codeceptjs.event.step.passed, this.stepPassed.bind(this));
|
|
@@ -86,7 +101,21 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
|
|
|
86
101
|
tr.labels.push(...extraTagLabels);
|
|
87
102
|
});
|
|
88
103
|
}
|
|
104
|
+
beforeHookTestFailed(test, error, hookName) {
|
|
105
|
+
if (isBeforeEachHook(hookName)) {
|
|
106
|
+
var pendingTest = this.flushPendingFailedBeforeEachHookTest();
|
|
107
|
+
if (pendingTest && pendingTest.test !== test && this.currentTest === pendingTest.uuid) {
|
|
108
|
+
this.currentTest = undefined;
|
|
109
|
+
this.currentTestHookName = undefined;
|
|
110
|
+
}
|
|
111
|
+
this.testFailed(test, error, hookName);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
89
114
|
testFailed(test, error, hookName) {
|
|
115
|
+
var _this$pendingFailedBe;
|
|
116
|
+
if (isBeforeEachHook(hookName) && ((_this$pendingFailedBe = this.pendingFailedBeforeEachHookTest) === null || _this$pendingFailedBe === void 0 ? void 0 : _this$pendingFailedBe.test) === test) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
90
119
|
this.currentTestHookName = hookName;
|
|
91
120
|
var shouldFinishTest = isBeforeHook(hookName);
|
|
92
121
|
if (!this.currentTest && shouldFinishTest) {
|
|
@@ -134,8 +163,19 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
|
|
|
134
163
|
this.runtime.stopFixture(this.currentHook);
|
|
135
164
|
this.currentHook = undefined;
|
|
136
165
|
}
|
|
137
|
-
|
|
138
|
-
|
|
166
|
+
if (isBeforeEachHook(hookName)) {
|
|
167
|
+
if (this.currentTest) {
|
|
168
|
+
this.pendingFailedBeforeEachHookTest = {
|
|
169
|
+
test,
|
|
170
|
+
uuid: this.currentTest,
|
|
171
|
+
hookName
|
|
172
|
+
};
|
|
173
|
+
this.queueFailedBeforeEachHookContext(this.pendingFailedBeforeEachHookTest);
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
this.onTestEnd(test);
|
|
177
|
+
this.currentTestHookName = undefined;
|
|
178
|
+
}
|
|
139
179
|
}
|
|
140
180
|
}
|
|
141
181
|
testFinished(test) {
|
|
@@ -159,20 +199,69 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
|
|
|
159
199
|
}
|
|
160
200
|
this.metaStepStack = [];
|
|
161
201
|
this.currentLeafStep = undefined;
|
|
202
|
+
if (this.currentTest) {
|
|
203
|
+
this.attachScreenshot(this.currentTest, test);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
hookFinished() {
|
|
207
|
+
this.flushPendingFailedBeforeEachHookTest();
|
|
208
|
+
}
|
|
209
|
+
flushPendingFailedBeforeEachHookTest() {
|
|
210
|
+
var pendingTest = this.pendingFailedBeforeEachHookTest;
|
|
211
|
+
if (!pendingTest) {
|
|
212
|
+
return undefined;
|
|
213
|
+
}
|
|
214
|
+
this.pendingFailedBeforeEachHookTest = undefined;
|
|
215
|
+
_codeceptjs.recorder.add("allure failed before hook result", () => {
|
|
216
|
+
this.writeFailedBeforeEachHookTest(pendingTest);
|
|
217
|
+
}, true, false);
|
|
218
|
+
return pendingTest;
|
|
219
|
+
}
|
|
220
|
+
queueFailedBeforeEachHookContext(_ref) {
|
|
221
|
+
var {
|
|
222
|
+
uuid,
|
|
223
|
+
hookName
|
|
224
|
+
} = _ref;
|
|
225
|
+
// Helper _failed hooks can await I/O before calling the runtime API, so
|
|
226
|
+
// restore the failure context in the recorder before those hooks run.
|
|
227
|
+
_codeceptjs.recorder.add("allure failed before hook context", () => {
|
|
228
|
+
this.currentTest = uuid;
|
|
229
|
+
this.currentTestHookName = hookName;
|
|
230
|
+
}, true, false);
|
|
231
|
+
}
|
|
232
|
+
writeFailedBeforeEachHookTest(_ref2) {
|
|
233
|
+
var {
|
|
234
|
+
test,
|
|
235
|
+
uuid,
|
|
236
|
+
hookName
|
|
237
|
+
} = _ref2;
|
|
162
238
|
var currentTest = this.currentTest;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
wrapInStep: true
|
|
173
|
-
});
|
|
174
|
-
}, true);
|
|
239
|
+
var currentTestHookName = this.currentTestHookName;
|
|
240
|
+
this.currentTest = uuid;
|
|
241
|
+
this.currentTestHookName = hookName;
|
|
242
|
+
this.writeScreenshotAttachment(uuid, test);
|
|
243
|
+
this.onTestEnd(test);
|
|
244
|
+
if (!this.currentTest && currentTest && currentTest !== uuid) {
|
|
245
|
+
this.currentTest = currentTest;
|
|
246
|
+
this.currentTestHookName = currentTestHookName;
|
|
247
|
+
return;
|
|
175
248
|
}
|
|
249
|
+
this.currentTestHookName = undefined;
|
|
250
|
+
}
|
|
251
|
+
attachScreenshot(currentTest, test) {
|
|
252
|
+
_codeceptjs.recorder.add("allure screenshot attachment", () => {
|
|
253
|
+
this.writeScreenshotAttachment(currentTest, test);
|
|
254
|
+
}, true);
|
|
255
|
+
}
|
|
256
|
+
writeScreenshotAttachment(currentTest, test) {
|
|
257
|
+
var screenshotPath = getScreenshotArtifactPath(test);
|
|
258
|
+
if (!screenshotPath) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
this.runtime.writeAttachment(currentTest, null, (0, _nodePath.basename)(screenshotPath), screenshotPath, {
|
|
262
|
+
contentType: _allureJsCommons.ContentType.PNG,
|
|
263
|
+
wrapInStep: true
|
|
264
|
+
});
|
|
176
265
|
}
|
|
177
266
|
stepStarted(step) {
|
|
178
267
|
var _this$currentHook, _this$metaStepStack$i2, _this$metaStepStack2;
|
package/dist/cjs/reporter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","names":["_nodePath","require","_allureJsCommons","_sdk","_allureMocha","_interopRequireDefault","_codeceptjs","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MAX_META_STEP_NESTING","TRY_TO_SESSION","knownCodeceptVerificationErrorPatterns","isKnownCodeceptVerificationError","error","message","stripAnsi","some","pattern","test","getCodeceptStatusFromError","hookName","status","getStatusFromError","Status","FAILED","BROKEN","isBeforeHook","isErrorInstance","_constructor","Error","constructor","name","isTryToSession","_recorder$getCurrentS","recorder","getCurrentSessionId","getRecorderPromise","_recorder$promise","promise","AllureCodeceptJsReporter","AllureMochaReporter","runner","opts","isInWorker","undefined","registerEvents","on","mochaTestFailed","bind","event","dispatcher","before","testStarted","failed","testFailed","finished","testFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","currentTestHookName","tags","extraTagLabels","tag","isMetadataTag","map","startsWith","substring","trim","LabelName","TAG","runtime","updateTest","tr","labels","shouldFinishTest","onTest","statusDetails","getMessageAndTraceFromError","result","currentBddStep","stopCurrentStep","stage","Stage","FINISHED","id","metaStepStack","updateStep","stopStep","currentHook","updateFixture","stopFixture","onTestEnd","PASSED","currentLeafStep","add","_test$artifacts","artifacts","screenshot","screenshotPath","writeAttachment","basename","contentType","ContentType","PNG","wrapInStep","_this$currentHook","_this$metaStepStack$i2","_this$metaStepStack2","root","stepPath","current","metaStep","isBDD","_current$toString","unshift","toString","index","Math","min","s","slice","_this$metaStepStack$i","_this$metaStepStack","parentId","startStep","parent","_this$currentHook2","keyword","text","_","inspect","catch","err","Promise","reject","updateFunc","_this$currentHook3","currentStep","stopStepById","exports"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { basename } from \"node:path\";\n\nimport { ContentType, LabelName, Stage, Status, type StepResult } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError, isMetadataTag, stripAnsi } from \"allure-js-commons/sdk\";\nimport AllureMochaReporter from \"allure-mocha\";\nimport { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\n\nimport type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\ninterface CodeceptTestWithArtifacts {\n artifacts?: {\n screenshot?: string;\n };\n}\n\nconst MAX_META_STEP_NESTING = 10;\n// CodeceptJS tryTo() uses a dedicated \"tryTo\" recorder session.\n// Docs: https://codecept.io/effects.html\nconst TRY_TO_SESSION = \"tryTo\";\n\nconst knownCodeceptVerificationErrorPatterns = [\n /^Element \".+\" is (?:not visible on page|still visible on page|not seen in DOM|still seen in DOM)\\.?$/i,\n /^(?:Element|Clickable element|Context element|Frame|Option \".+\" in|Custom locator .+) .*\\b(?:not found|was not found)\\b/i,\n /^element \\(.+\\) .+ after \\d+(?:\\.\\d+)? sec(?:\\n|\\.|$)/i,\n /^Text \".+\" was not found on page after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Expected \\d+ tabs are not met after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Cookie .+ is not found after \\d+(?:\\.\\d+)?s$/i,\n] as const;\n\nconst isKnownCodeceptVerificationError = (error: Partial<Error>): boolean => {\n const message = error.message ? stripAnsi(error.message) : \"\";\n\n if (!message) {\n return false;\n }\n\n return knownCodeceptVerificationErrorPatterns.some((pattern) => pattern.test(message));\n};\n\nconst getCodeceptStatusFromError = (error: Partial<Error>, hookName?: string): Status => {\n const status = getStatusFromError(error);\n\n if (status === Status.FAILED || hookName) {\n return status;\n }\n\n return isKnownCodeceptVerificationError(error) ? Status.FAILED : Status.BROKEN;\n};\n\nconst isBeforeHook = (hookName?: string) => hookName === \"Before\" || hookName === \"BeforeSuite\";\n\nconst isErrorInstance = (value: unknown): value is Error =>\n value instanceof Error ||\n (typeof value === \"object\" &&\n value !== null &&\n (value as { constructor?: { name?: unknown } }).constructor?.name === \"Error\");\n\nconst isTryToSession = () => recorder.getCurrentSessionId?.() === TRY_TO_SESSION;\nconst getRecorderPromise = (): Promise<unknown> | undefined =>\n (recorder.promise as (() => Promise<unknown> | undefined) | undefined)?.();\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n protected currentLeafStep?: string;\n protected currentTestHookName?: string;\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\n runner.on(\"fail\", this.mochaTestFailed.bind(this));\n }\n\n registerEvents() {\n // Test\n event.dispatcher.on(event.test.before, this.testStarted.bind(this));\n event.dispatcher.on(event.test.failed, this.testFailed.bind(this));\n event.dispatcher.on(event.test.finished, this.testFinished.bind(this));\n // Step\n event.dispatcher.on(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.on(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.on(event.step.comment, this.stepComment.bind(this));\n\n event.dispatcher.on(event.bddStep.before, this.bddStepStarted.bind(this));\n event.dispatcher.on(event.bddStep.after, this.stepPassed.bind(this));\n }\n\n testStarted(test: { tags?: string[] }) {\n if (!this.currentTest) {\n return;\n }\n\n this.currentTestHookName = undefined;\n\n const tags = test.tags || [];\n const extraTagLabels = tags\n .filter((tag) => tag && !isMetadataTag(tag))\n .map((tag) => (tag.startsWith(\"@\") ? tag.substring(1) : tag))\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0)\n .map((tag) => ({ name: LabelName.TAG, value: tag }));\n\n this.runtime.updateTest(this.currentTest, (tr) => {\n tr.labels.push(...extraTagLabels);\n });\n }\n\n testFailed(test: Mocha.Test, error: Error, hookName?: string) {\n this.currentTestHookName = hookName;\n const shouldFinishTest = isBeforeHook(hookName);\n\n if (!this.currentTest && shouldFinishTest) {\n this.onTest(test);\n }\n\n const status = getCodeceptStatusFromError(error, hookName);\n const statusDetails = getMessageAndTraceFromError(error);\n\n if (this.currentTest) {\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n }\n\n if (this.currentBddStep) {\n this.stopCurrentStep((result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = [];\n\n if (shouldFinishTest) {\n if (this.currentHook) {\n this.runtime.updateFixture(this.currentHook, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n this.runtime.stopFixture(this.currentHook);\n this.currentHook = undefined;\n }\n\n this.onTestEnd(test);\n this.currentTestHookName = undefined;\n }\n }\n\n testFinished(test?: CodeceptTestWithArtifacts) {\n this.currentTestHookName = undefined;\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n\n this.metaStepStack = [];\n this.currentLeafStep = undefined;\n\n const currentTest = this.currentTest;\n if (currentTest) {\n recorder.add(\n \"allure screenshot attachment\",\n () => {\n if (!test?.artifacts?.screenshot) {\n return;\n }\n const screenshotPath = test.artifacts.screenshot;\n\n this.runtime.writeAttachment(currentTest, null, basename(screenshotPath), screenshotPath, {\n contentType: ContentType.PNG,\n wrapInStep: true,\n });\n },\n true,\n );\n }\n }\n\n stepStarted(step: CodeceptStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n\n const stepPath: string[] = [];\n let current = step.metaStep;\n while (current && !current.isBDD() && stepPath.length < MAX_META_STEP_NESTING) {\n stepPath.unshift(stripAnsi(current.toString() ?? \"\").trim());\n current = current.metaStep;\n }\n\n let index = 0;\n while (\n index < Math.min(this.metaStepStack.length, stepPath.length) &&\n this.metaStepStack[index].name === stepPath[index]\n ) {\n index++;\n }\n\n for (let i = this.metaStepStack.length - 1; i >= index; i--) {\n const { id } = this.metaStepStack[i];\n this.runtime.updateStep(id, (s) => {\n s.status = Status.PASSED;\n s.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = this.metaStepStack.slice(0, index);\n\n for (let i = index; i < stepPath.length; i++) {\n const name = stepPath[i];\n const parentId = this.metaStepStack[i - 1]?.id ?? root;\n const id = this.runtime.startStep(parentId, undefined, {\n name,\n });\n if (id) {\n this.metaStepStack.push({ name, id });\n }\n }\n\n const parent = this.metaStepStack[this.metaStepStack.length - 1]?.id ?? root;\n this.currentLeafStep = this.runtime.startStep(parent, undefined, {\n name: step.toString().trim(),\n });\n }\n\n bddStepStarted(step: CodeceptBddStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = this.runtime.startStep(root, undefined, {\n name: step.keyword + step.text,\n });\n }\n\n // Step errors are usually reported directly, but some paths still require\n // reading the recorder rejection to populate the final step status/details.\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n if (!this.currentLeafStep) {\n return;\n }\n\n const currentLeafStep = this.currentLeafStep;\n\n this.runtime.updateStep(currentLeafStep, (result) => {\n result.stage = Stage.FINISHED;\n if (error) {\n if (!error.message && typeof error.inspect === \"function\") {\n error.message = error.inspect();\n }\n result.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(error as unknown as Error);\n result.statusDetails = getMessageAndTraceFromError(error as unknown as Error);\n } else {\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentLeafStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = getMessageAndTraceFromError(err as Error);\n });\n }\n return Promise.reject(err);\n });\n }\n\n result.status = Status.BROKEN;\n }\n });\n this.runtime.stopStep(currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n if (this.currentBddStep && !this.currentLeafStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n this.currentBddStep = undefined;\n return;\n }\n\n if (!this.currentLeafStep) {\n return;\n }\n\n this.runtime.updateStep(this.currentLeafStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stopCurrentStep(updateFunc: (result: StepResult) => void) {\n const root = this.currentHook ?? this.currentTest;\n const currentStep = root ? this.runtime.currentStep(root) : undefined;\n\n this.stopStepById(currentStep, updateFunc);\n }\n\n stopStepById(currentStep: string | undefined, updateFunc: (result: StepResult) => void) {\n if (!currentStep) {\n return;\n }\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n // AssertionFailedError doesn't set message attribute\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = { ...step.statusDetails, ...getMessageAndTraceFromError(err as Error) };\n });\n }\n return Promise.reject(err);\n });\n }\n\n this.runtime.updateStep(currentStep, updateFunc);\n this.runtime.stopStep(currentStep);\n }\n\n mochaTestFailed(_: Mocha.Test, error: Error) {\n if (!this.currentTest) {\n return;\n }\n\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = getCodeceptStatusFromError(error, this.currentTestHookName);\n result.statusDetails = {\n ...result.statusDetails,\n ...getMessageAndTraceFromError(error),\n };\n });\n }\n\n protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA6C,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAD,OAAA,CAAAG,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAnB,CAAA,EAAAI,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAArB,CAAA,EAAAM,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M,IAAK;MACpDA,MAAM,CAACnE,MAAM,GAAGF,0BAA0B,CAACN,KAAK,EAAE,IAAI,CAACwD,mBAAmB,CAAC;MAC3EmB,MAAM,CAACF,aAAa,GAAAjG,aAAA,CAAAA,aAAA,KACfmG,MAAM,CAACF,aAAa,GACpB,IAAAC,gCAA2B,EAAC1E,KAAK,CAAC,CACtC;IACH,CAAC,CAAC;EACJ;AAKF;AAACwI,OAAA,CAAA9G,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"reporter.js","names":["_nodePath","require","_allureJsCommons","_sdk","_allureMocha","_interopRequireDefault","_codeceptjs","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MAX_META_STEP_NESTING","TRY_TO_SESSION","knownCodeceptVerificationErrorPatterns","isKnownCodeceptVerificationError","error","message","stripAnsi","some","pattern","test","getCodeceptStatusFromError","hookName","status","getStatusFromError","Status","FAILED","BROKEN","isBeforeEachHook","isBeforeHook","isErrorInstance","_constructor","Error","constructor","name","isTryToSession","_recorder$getCurrentS","recorder","getCurrentSessionId","getRecorderPromise","_recorder$promise","promise","getScreenshotArtifactPath","artifacts","undefined","screenshot","AllureCodeceptJsReporter","AllureMochaReporter","runner","opts","isInWorker","registerEvents","on","mochaTestFailed","bind","event","dispatcher","before","testStarted","prependListener","failed","beforeHookTestFailed","testFailed","finished","testFinished","hook","hookFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","currentTestHookName","tags","extraTagLabels","tag","isMetadataTag","map","startsWith","substring","trim","LabelName","TAG","runtime","updateTest","tr","labels","pendingTest","flushPendingFailedBeforeEachHookTest","uuid","_this$pendingFailedBe","pendingFailedBeforeEachHookTest","shouldFinishTest","onTest","statusDetails","getMessageAndTraceFromError","result","currentBddStep","stopCurrentStep","stage","Stage","FINISHED","id","metaStepStack","updateStep","stopStep","currentHook","updateFixture","stopFixture","queueFailedBeforeEachHookContext","onTestEnd","PASSED","currentLeafStep","attachScreenshot","add","writeFailedBeforeEachHookTest","_ref","_ref2","writeScreenshotAttachment","screenshotPath","writeAttachment","basename","contentType","ContentType","PNG","wrapInStep","_this$currentHook","_this$metaStepStack$i2","_this$metaStepStack2","root","stepPath","current","metaStep","isBDD","_current$toString","unshift","toString","index","Math","min","s","slice","_this$metaStepStack$i","_this$metaStepStack","parentId","startStep","parent","_this$currentHook2","keyword","text","_","inspect","catch","err","Promise","reject","updateFunc","_this$currentHook3","currentStep","stopStepById","exports"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { basename } from \"node:path\";\n\nimport { ContentType, LabelName, Stage, Status, type StepResult } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError, isMetadataTag, stripAnsi } from \"allure-js-commons/sdk\";\nimport AllureMochaReporter from \"allure-mocha\";\nimport { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\n\nimport type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\ninterface CodeceptTestWithArtifacts {\n artifacts?: unknown;\n}\n\ninterface PendingFailedBeforeEachHookTest {\n test: Mocha.Test;\n uuid: string;\n hookName?: string;\n}\n\nconst MAX_META_STEP_NESTING = 10;\n// CodeceptJS tryTo() uses a dedicated \"tryTo\" recorder session.\n// Docs: https://codecept.io/effects.html\nconst TRY_TO_SESSION = \"tryTo\";\n\nconst knownCodeceptVerificationErrorPatterns = [\n /^Element \".+\" is (?:not visible on page|still visible on page|not seen in DOM|still seen in DOM)\\.?$/i,\n /^(?:Element|Clickable element|Context element|Frame|Option \".+\" in|Custom locator .+) .*\\b(?:not found|was not found)\\b/i,\n /^element \\(.+\\) .+ after \\d+(?:\\.\\d+)? sec(?:\\n|\\.|$)/i,\n /^Text \".+\" was not found on page after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Expected \\d+ tabs are not met after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Cookie .+ is not found after \\d+(?:\\.\\d+)?s$/i,\n] as const;\n\nconst isKnownCodeceptVerificationError = (error: Partial<Error>): boolean => {\n const message = error.message ? stripAnsi(error.message) : \"\";\n\n if (!message) {\n return false;\n }\n\n return knownCodeceptVerificationErrorPatterns.some((pattern) => pattern.test(message));\n};\n\nconst getCodeceptStatusFromError = (error: Partial<Error>, hookName?: string): Status => {\n const status = getStatusFromError(error);\n\n if (status === Status.FAILED || hookName) {\n return status;\n }\n\n return isKnownCodeceptVerificationError(error) ? Status.FAILED : Status.BROKEN;\n};\n\nconst isBeforeEachHook = (hookName?: string) => hookName === \"Before\";\nconst isBeforeHook = (hookName?: string) => isBeforeEachHook(hookName) || hookName === \"BeforeSuite\";\n\nconst isErrorInstance = (value: unknown): value is Error =>\n value instanceof Error ||\n (typeof value === \"object\" &&\n value !== null &&\n (value as { constructor?: { name?: unknown } }).constructor?.name === \"Error\");\n\nconst isTryToSession = () => recorder.getCurrentSessionId?.() === TRY_TO_SESSION;\nconst getRecorderPromise = (): Promise<unknown> | undefined =>\n (recorder.promise as (() => Promise<unknown> | undefined) | undefined)?.();\nconst getScreenshotArtifactPath = (test?: CodeceptTestWithArtifacts) => {\n const artifacts = test?.artifacts;\n\n if (typeof artifacts !== \"object\" || artifacts === null || !(\"screenshot\" in artifacts)) {\n return undefined;\n }\n\n return typeof artifacts.screenshot === \"string\" ? artifacts.screenshot : undefined;\n};\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n protected currentLeafStep?: string;\n protected currentTestHookName?: string;\n protected pendingFailedBeforeEachHookTest?: PendingFailedBeforeEachHookTest;\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\n runner.on(\"fail\", this.mochaTestFailed.bind(this));\n }\n\n registerEvents() {\n // Test\n event.dispatcher.on(event.test.before, this.testStarted.bind(this));\n // A failed CodeceptJS Before hook emits test.failed before the scenario has\n // started in Mocha. Start the Allure test before other failure listeners so\n // their runtime attachments target the test, then defer writing the result\n // until queued failure artifacts, such as screenshots, are available.\n event.dispatcher.prependListener(event.test.failed, this.beforeHookTestFailed.bind(this));\n event.dispatcher.on(event.test.failed, this.testFailed.bind(this));\n event.dispatcher.on(event.test.finished, this.testFinished.bind(this));\n event.dispatcher.on(event.hook.finished, this.hookFinished.bind(this));\n // Step\n event.dispatcher.on(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.on(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.on(event.step.comment, this.stepComment.bind(this));\n\n event.dispatcher.on(event.bddStep.before, this.bddStepStarted.bind(this));\n event.dispatcher.on(event.bddStep.after, this.stepPassed.bind(this));\n }\n\n testStarted(test: { tags?: string[] }) {\n if (!this.currentTest) {\n return;\n }\n\n this.currentTestHookName = undefined;\n\n const tags = test.tags || [];\n const extraTagLabels = tags\n .filter((tag) => tag && !isMetadataTag(tag))\n .map((tag) => (tag.startsWith(\"@\") ? tag.substring(1) : tag))\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0)\n .map((tag) => ({ name: LabelName.TAG, value: tag }));\n\n this.runtime.updateTest(this.currentTest, (tr) => {\n tr.labels.push(...extraTagLabels);\n });\n }\n\n beforeHookTestFailed(test: Mocha.Test, error: Error, hookName?: string) {\n if (isBeforeEachHook(hookName)) {\n const pendingTest = this.flushPendingFailedBeforeEachHookTest();\n\n if (pendingTest && pendingTest.test !== test && this.currentTest === pendingTest.uuid) {\n this.currentTest = undefined;\n this.currentTestHookName = undefined;\n }\n\n this.testFailed(test, error, hookName);\n }\n }\n\n testFailed(test: Mocha.Test, error: Error, hookName?: string) {\n if (isBeforeEachHook(hookName) && this.pendingFailedBeforeEachHookTest?.test === test) {\n return;\n }\n\n this.currentTestHookName = hookName;\n const shouldFinishTest = isBeforeHook(hookName);\n\n if (!this.currentTest && shouldFinishTest) {\n this.onTest(test);\n }\n\n const status = getCodeceptStatusFromError(error, hookName);\n const statusDetails = getMessageAndTraceFromError(error);\n\n if (this.currentTest) {\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n }\n\n if (this.currentBddStep) {\n this.stopCurrentStep((result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = [];\n\n if (shouldFinishTest) {\n if (this.currentHook) {\n this.runtime.updateFixture(this.currentHook, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n this.runtime.stopFixture(this.currentHook);\n this.currentHook = undefined;\n }\n\n if (isBeforeEachHook(hookName)) {\n if (this.currentTest) {\n this.pendingFailedBeforeEachHookTest = {\n test,\n uuid: this.currentTest,\n hookName,\n };\n this.queueFailedBeforeEachHookContext(this.pendingFailedBeforeEachHookTest);\n }\n } else {\n this.onTestEnd(test);\n this.currentTestHookName = undefined;\n }\n }\n }\n\n testFinished(test?: CodeceptTestWithArtifacts) {\n this.currentTestHookName = undefined;\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n\n this.metaStepStack = [];\n this.currentLeafStep = undefined;\n\n if (this.currentTest) {\n this.attachScreenshot(this.currentTest, test);\n }\n }\n\n hookFinished() {\n this.flushPendingFailedBeforeEachHookTest();\n }\n\n protected flushPendingFailedBeforeEachHookTest() {\n const pendingTest = this.pendingFailedBeforeEachHookTest;\n\n if (!pendingTest) {\n return undefined;\n }\n\n this.pendingFailedBeforeEachHookTest = undefined;\n\n recorder.add(\n \"allure failed before hook result\",\n () => {\n this.writeFailedBeforeEachHookTest(pendingTest);\n },\n true,\n false,\n );\n\n return pendingTest;\n }\n\n protected queueFailedBeforeEachHookContext({ uuid, hookName }: PendingFailedBeforeEachHookTest) {\n // Helper _failed hooks can await I/O before calling the runtime API, so\n // restore the failure context in the recorder before those hooks run.\n recorder.add(\n \"allure failed before hook context\",\n () => {\n this.currentTest = uuid;\n this.currentTestHookName = hookName;\n },\n true,\n false,\n );\n }\n\n protected writeFailedBeforeEachHookTest({ test, uuid, hookName }: PendingFailedBeforeEachHookTest) {\n const currentTest = this.currentTest;\n const currentTestHookName = this.currentTestHookName;\n\n this.currentTest = uuid;\n this.currentTestHookName = hookName;\n this.writeScreenshotAttachment(uuid, test);\n this.onTestEnd(test);\n\n if (!this.currentTest && currentTest && currentTest !== uuid) {\n this.currentTest = currentTest;\n this.currentTestHookName = currentTestHookName;\n return;\n }\n\n this.currentTestHookName = undefined;\n }\n\n protected attachScreenshot(currentTest: string, test?: CodeceptTestWithArtifacts) {\n recorder.add(\n \"allure screenshot attachment\",\n () => {\n this.writeScreenshotAttachment(currentTest, test);\n },\n true,\n );\n }\n\n protected writeScreenshotAttachment(currentTest: string, test?: CodeceptTestWithArtifacts) {\n const screenshotPath = getScreenshotArtifactPath(test);\n\n if (!screenshotPath) {\n return;\n }\n\n this.runtime.writeAttachment(currentTest, null, basename(screenshotPath), screenshotPath, {\n contentType: ContentType.PNG,\n wrapInStep: true,\n });\n }\n\n stepStarted(step: CodeceptStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n\n const stepPath: string[] = [];\n let current = step.metaStep;\n while (current && !current.isBDD() && stepPath.length < MAX_META_STEP_NESTING) {\n stepPath.unshift(stripAnsi(current.toString() ?? \"\").trim());\n current = current.metaStep;\n }\n\n let index = 0;\n while (\n index < Math.min(this.metaStepStack.length, stepPath.length) &&\n this.metaStepStack[index].name === stepPath[index]\n ) {\n index++;\n }\n\n for (let i = this.metaStepStack.length - 1; i >= index; i--) {\n const { id } = this.metaStepStack[i];\n this.runtime.updateStep(id, (s) => {\n s.status = Status.PASSED;\n s.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = this.metaStepStack.slice(0, index);\n\n for (let i = index; i < stepPath.length; i++) {\n const name = stepPath[i];\n const parentId = this.metaStepStack[i - 1]?.id ?? root;\n const id = this.runtime.startStep(parentId, undefined, {\n name,\n });\n if (id) {\n this.metaStepStack.push({ name, id });\n }\n }\n\n const parent = this.metaStepStack[this.metaStepStack.length - 1]?.id ?? root;\n this.currentLeafStep = this.runtime.startStep(parent, undefined, {\n name: step.toString().trim(),\n });\n }\n\n bddStepStarted(step: CodeceptBddStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = this.runtime.startStep(root, undefined, {\n name: step.keyword + step.text,\n });\n }\n\n // Step errors are usually reported directly, but some paths still require\n // reading the recorder rejection to populate the final step status/details.\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n if (!this.currentLeafStep) {\n return;\n }\n\n const currentLeafStep = this.currentLeafStep;\n\n this.runtime.updateStep(currentLeafStep, (result) => {\n result.stage = Stage.FINISHED;\n if (error) {\n if (!error.message && typeof error.inspect === \"function\") {\n error.message = error.inspect();\n }\n result.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(error as unknown as Error);\n result.statusDetails = getMessageAndTraceFromError(error as unknown as Error);\n } else {\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentLeafStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = getMessageAndTraceFromError(err as Error);\n });\n }\n return Promise.reject(err);\n });\n }\n\n result.status = Status.BROKEN;\n }\n });\n this.runtime.stopStep(currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n if (this.currentBddStep && !this.currentLeafStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n this.currentBddStep = undefined;\n return;\n }\n\n if (!this.currentLeafStep) {\n return;\n }\n\n this.runtime.updateStep(this.currentLeafStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stopCurrentStep(updateFunc: (result: StepResult) => void) {\n const root = this.currentHook ?? this.currentTest;\n const currentStep = root ? this.runtime.currentStep(root) : undefined;\n\n this.stopStepById(currentStep, updateFunc);\n }\n\n stopStepById(currentStep: string | undefined, updateFunc: (result: StepResult) => void) {\n if (!currentStep) {\n return;\n }\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n // AssertionFailedError doesn't set message attribute\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = { ...step.statusDetails, ...getMessageAndTraceFromError(err as Error) };\n });\n }\n return Promise.reject(err);\n });\n }\n\n this.runtime.updateStep(currentStep, updateFunc);\n this.runtime.stopStep(currentStep);\n }\n\n mochaTestFailed(_: Mocha.Test, error: Error) {\n if (!this.currentTest) {\n return;\n }\n\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = getCodeceptStatusFromError(error, this.currentTestHookName);\n result.statusDetails = {\n ...result.statusDetails,\n ...getMessageAndTraceFromError(error),\n };\n });\n }\n\n protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA6C,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EA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,CAAC,CAAC;EACJ;AAKF;AAACwJ,OAAA,CAAAzH,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
package/dist/esm/reporter.js
CHANGED
|
@@ -27,7 +27,8 @@ var getCodeceptStatusFromError = (error, hookName) => {
|
|
|
27
27
|
}
|
|
28
28
|
return isKnownCodeceptVerificationError(error) ? Status.FAILED : Status.BROKEN;
|
|
29
29
|
};
|
|
30
|
-
var
|
|
30
|
+
var isBeforeEachHook = hookName => hookName === "Before";
|
|
31
|
+
var isBeforeHook = hookName => isBeforeEachHook(hookName) || hookName === "BeforeSuite";
|
|
31
32
|
var isErrorInstance = value => {
|
|
32
33
|
var _constructor;
|
|
33
34
|
return value instanceof Error || typeof value === "object" && value !== null && ((_constructor = value.constructor) === null || _constructor === void 0 ? void 0 : _constructor.name) === "Error";
|
|
@@ -40,6 +41,13 @@ var getRecorderPromise = () => {
|
|
|
40
41
|
var _recorder$promise;
|
|
41
42
|
return (_recorder$promise = recorder.promise) === null || _recorder$promise === void 0 ? void 0 : _recorder$promise.call(recorder);
|
|
42
43
|
};
|
|
44
|
+
var getScreenshotArtifactPath = test => {
|
|
45
|
+
var artifacts = test === null || test === void 0 ? void 0 : test.artifacts;
|
|
46
|
+
if (typeof artifacts !== "object" || artifacts === null || !("screenshot" in artifacts)) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
return typeof artifacts.screenshot === "string" ? artifacts.screenshot : undefined;
|
|
50
|
+
};
|
|
43
51
|
export class AllureCodeceptJsReporter extends AllureMochaReporter {
|
|
44
52
|
constructor(runner, opts, isInWorker) {
|
|
45
53
|
super(runner, opts, isInWorker);
|
|
@@ -47,6 +55,7 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
|
|
|
47
55
|
_defineProperty(this, "metaStepStack", []);
|
|
48
56
|
_defineProperty(this, "currentLeafStep", void 0);
|
|
49
57
|
_defineProperty(this, "currentTestHookName", void 0);
|
|
58
|
+
_defineProperty(this, "pendingFailedBeforeEachHookTest", void 0);
|
|
50
59
|
_defineProperty(this, "getFrameworkName", () => "codeceptjs");
|
|
51
60
|
_defineProperty(this, "getWorkerId", () => undefined);
|
|
52
61
|
this.registerEvents();
|
|
@@ -55,8 +64,14 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
|
|
|
55
64
|
registerEvents() {
|
|
56
65
|
// Test
|
|
57
66
|
event.dispatcher.on(event.test.before, this.testStarted.bind(this));
|
|
67
|
+
// A failed CodeceptJS Before hook emits test.failed before the scenario has
|
|
68
|
+
// started in Mocha. Start the Allure test before other failure listeners so
|
|
69
|
+
// their runtime attachments target the test, then defer writing the result
|
|
70
|
+
// until queued failure artifacts, such as screenshots, are available.
|
|
71
|
+
event.dispatcher.prependListener(event.test.failed, this.beforeHookTestFailed.bind(this));
|
|
58
72
|
event.dispatcher.on(event.test.failed, this.testFailed.bind(this));
|
|
59
73
|
event.dispatcher.on(event.test.finished, this.testFinished.bind(this));
|
|
74
|
+
event.dispatcher.on(event.hook.finished, this.hookFinished.bind(this));
|
|
60
75
|
// Step
|
|
61
76
|
event.dispatcher.on(event.step.started, this.stepStarted.bind(this));
|
|
62
77
|
event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));
|
|
@@ -79,7 +94,21 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
|
|
|
79
94
|
tr.labels.push(...extraTagLabels);
|
|
80
95
|
});
|
|
81
96
|
}
|
|
97
|
+
beforeHookTestFailed(test, error, hookName) {
|
|
98
|
+
if (isBeforeEachHook(hookName)) {
|
|
99
|
+
var pendingTest = this.flushPendingFailedBeforeEachHookTest();
|
|
100
|
+
if (pendingTest && pendingTest.test !== test && this.currentTest === pendingTest.uuid) {
|
|
101
|
+
this.currentTest = undefined;
|
|
102
|
+
this.currentTestHookName = undefined;
|
|
103
|
+
}
|
|
104
|
+
this.testFailed(test, error, hookName);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
82
107
|
testFailed(test, error, hookName) {
|
|
108
|
+
var _this$pendingFailedBe;
|
|
109
|
+
if (isBeforeEachHook(hookName) && ((_this$pendingFailedBe = this.pendingFailedBeforeEachHookTest) === null || _this$pendingFailedBe === void 0 ? void 0 : _this$pendingFailedBe.test) === test) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
83
112
|
this.currentTestHookName = hookName;
|
|
84
113
|
var shouldFinishTest = isBeforeHook(hookName);
|
|
85
114
|
if (!this.currentTest && shouldFinishTest) {
|
|
@@ -127,8 +156,19 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
|
|
|
127
156
|
this.runtime.stopFixture(this.currentHook);
|
|
128
157
|
this.currentHook = undefined;
|
|
129
158
|
}
|
|
130
|
-
|
|
131
|
-
|
|
159
|
+
if (isBeforeEachHook(hookName)) {
|
|
160
|
+
if (this.currentTest) {
|
|
161
|
+
this.pendingFailedBeforeEachHookTest = {
|
|
162
|
+
test,
|
|
163
|
+
uuid: this.currentTest,
|
|
164
|
+
hookName
|
|
165
|
+
};
|
|
166
|
+
this.queueFailedBeforeEachHookContext(this.pendingFailedBeforeEachHookTest);
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
this.onTestEnd(test);
|
|
170
|
+
this.currentTestHookName = undefined;
|
|
171
|
+
}
|
|
132
172
|
}
|
|
133
173
|
}
|
|
134
174
|
testFinished(test) {
|
|
@@ -152,20 +192,69 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
|
|
|
152
192
|
}
|
|
153
193
|
this.metaStepStack = [];
|
|
154
194
|
this.currentLeafStep = undefined;
|
|
195
|
+
if (this.currentTest) {
|
|
196
|
+
this.attachScreenshot(this.currentTest, test);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
hookFinished() {
|
|
200
|
+
this.flushPendingFailedBeforeEachHookTest();
|
|
201
|
+
}
|
|
202
|
+
flushPendingFailedBeforeEachHookTest() {
|
|
203
|
+
var pendingTest = this.pendingFailedBeforeEachHookTest;
|
|
204
|
+
if (!pendingTest) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
this.pendingFailedBeforeEachHookTest = undefined;
|
|
208
|
+
recorder.add("allure failed before hook result", () => {
|
|
209
|
+
this.writeFailedBeforeEachHookTest(pendingTest);
|
|
210
|
+
}, true, false);
|
|
211
|
+
return pendingTest;
|
|
212
|
+
}
|
|
213
|
+
queueFailedBeforeEachHookContext(_ref) {
|
|
214
|
+
var {
|
|
215
|
+
uuid,
|
|
216
|
+
hookName
|
|
217
|
+
} = _ref;
|
|
218
|
+
// Helper _failed hooks can await I/O before calling the runtime API, so
|
|
219
|
+
// restore the failure context in the recorder before those hooks run.
|
|
220
|
+
recorder.add("allure failed before hook context", () => {
|
|
221
|
+
this.currentTest = uuid;
|
|
222
|
+
this.currentTestHookName = hookName;
|
|
223
|
+
}, true, false);
|
|
224
|
+
}
|
|
225
|
+
writeFailedBeforeEachHookTest(_ref2) {
|
|
226
|
+
var {
|
|
227
|
+
test,
|
|
228
|
+
uuid,
|
|
229
|
+
hookName
|
|
230
|
+
} = _ref2;
|
|
155
231
|
var currentTest = this.currentTest;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
wrapInStep: true
|
|
166
|
-
});
|
|
167
|
-
}, true);
|
|
232
|
+
var currentTestHookName = this.currentTestHookName;
|
|
233
|
+
this.currentTest = uuid;
|
|
234
|
+
this.currentTestHookName = hookName;
|
|
235
|
+
this.writeScreenshotAttachment(uuid, test);
|
|
236
|
+
this.onTestEnd(test);
|
|
237
|
+
if (!this.currentTest && currentTest && currentTest !== uuid) {
|
|
238
|
+
this.currentTest = currentTest;
|
|
239
|
+
this.currentTestHookName = currentTestHookName;
|
|
240
|
+
return;
|
|
168
241
|
}
|
|
242
|
+
this.currentTestHookName = undefined;
|
|
243
|
+
}
|
|
244
|
+
attachScreenshot(currentTest, test) {
|
|
245
|
+
recorder.add("allure screenshot attachment", () => {
|
|
246
|
+
this.writeScreenshotAttachment(currentTest, test);
|
|
247
|
+
}, true);
|
|
248
|
+
}
|
|
249
|
+
writeScreenshotAttachment(currentTest, test) {
|
|
250
|
+
var screenshotPath = getScreenshotArtifactPath(test);
|
|
251
|
+
if (!screenshotPath) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
this.runtime.writeAttachment(currentTest, null, basename(screenshotPath), screenshotPath, {
|
|
255
|
+
contentType: ContentType.PNG,
|
|
256
|
+
wrapInStep: true
|
|
257
|
+
});
|
|
169
258
|
}
|
|
170
259
|
stepStarted(step) {
|
|
171
260
|
var _this$currentHook, _this$metaStepStack$i2, _this$metaStepStack2;
|
package/dist/esm/reporter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","names":["basename","ContentType","LabelName","Stage","Status","getMessageAndTraceFromError","getStatusFromError","isMetadataTag","stripAnsi","AllureMochaReporter","event","recorder","MAX_META_STEP_NESTING","TRY_TO_SESSION","knownCodeceptVerificationErrorPatterns","isKnownCodeceptVerificationError","error","message","some","pattern","test","getCodeceptStatusFromError","hookName","status","FAILED","BROKEN","isBeforeHook","isErrorInstance","value","_constructor","Error","constructor","name","isTryToSession","_recorder$getCurrentS","getCurrentSessionId","call","getRecorderPromise","_recorder$promise","promise","AllureCodeceptJsReporter","runner","opts","isInWorker","_defineProperty","undefined","registerEvents","on","mochaTestFailed","bind","dispatcher","before","testStarted","failed","testFailed","finished","testFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","currentTestHookName","tags","extraTagLabels","filter","tag","map","startsWith","substring","trim","length","TAG","runtime","updateTest","tr","labels","push","shouldFinishTest","onTest","statusDetails","result","_objectSpread","currentBddStep","stopCurrentStep","stage","FINISHED","id","metaStepStack","updateStep","stopStep","currentHook","updateFixture","stopFixture","onTestEnd","PASSED","currentLeafStep","add","_test$artifacts","artifacts","screenshot","screenshotPath","writeAttachment","contentType","PNG","wrapInStep","_this$currentHook","_this$metaStepStack$i2","_this$metaStepStack2","root","stepPath","current","metaStep","isBDD","_current$toString","unshift","toString","index","Math","min","i","s","slice","_this$metaStepStack$i","_this$metaStepStack","parentId","startStep","parent","_this$currentHook2","keyword","text","_","inspect","catch","err","Promise","reject","updateFunc","_this$currentHook3","currentStep","stopStepById"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { basename } from \"node:path\";\n\nimport { ContentType, LabelName, Stage, Status, type StepResult } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError, isMetadataTag, stripAnsi } from \"allure-js-commons/sdk\";\nimport AllureMochaReporter from \"allure-mocha\";\nimport { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\n\nimport type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\ninterface CodeceptTestWithArtifacts {\n artifacts?: {\n screenshot?: string;\n };\n}\n\nconst MAX_META_STEP_NESTING = 10;\n// CodeceptJS tryTo() uses a dedicated \"tryTo\" recorder session.\n// Docs: https://codecept.io/effects.html\nconst TRY_TO_SESSION = \"tryTo\";\n\nconst knownCodeceptVerificationErrorPatterns = [\n /^Element \".+\" is (?:not visible on page|still visible on page|not seen in DOM|still seen in DOM)\\.?$/i,\n /^(?:Element|Clickable element|Context element|Frame|Option \".+\" in|Custom locator .+) .*\\b(?:not found|was not found)\\b/i,\n /^element \\(.+\\) .+ after \\d+(?:\\.\\d+)? sec(?:\\n|\\.|$)/i,\n /^Text \".+\" was not found on page after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Expected \\d+ tabs are not met after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Cookie .+ is not found after \\d+(?:\\.\\d+)?s$/i,\n] as const;\n\nconst isKnownCodeceptVerificationError = (error: Partial<Error>): boolean => {\n const message = error.message ? stripAnsi(error.message) : \"\";\n\n if (!message) {\n return false;\n }\n\n return knownCodeceptVerificationErrorPatterns.some((pattern) => pattern.test(message));\n};\n\nconst getCodeceptStatusFromError = (error: Partial<Error>, hookName?: string): Status => {\n const status = getStatusFromError(error);\n\n if (status === Status.FAILED || hookName) {\n return status;\n }\n\n return isKnownCodeceptVerificationError(error) ? Status.FAILED : Status.BROKEN;\n};\n\nconst isBeforeHook = (hookName?: string) => hookName === \"Before\" || hookName === \"BeforeSuite\";\n\nconst isErrorInstance = (value: unknown): value is Error =>\n value instanceof Error ||\n (typeof value === \"object\" &&\n value !== null &&\n (value as { constructor?: { name?: unknown } }).constructor?.name === \"Error\");\n\nconst isTryToSession = () => recorder.getCurrentSessionId?.() === TRY_TO_SESSION;\nconst getRecorderPromise = (): Promise<unknown> | undefined =>\n (recorder.promise as (() => Promise<unknown> | undefined) | undefined)?.();\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n protected currentLeafStep?: string;\n protected currentTestHookName?: string;\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\n runner.on(\"fail\", this.mochaTestFailed.bind(this));\n }\n\n registerEvents() {\n // Test\n event.dispatcher.on(event.test.before, this.testStarted.bind(this));\n event.dispatcher.on(event.test.failed, this.testFailed.bind(this));\n event.dispatcher.on(event.test.finished, this.testFinished.bind(this));\n // Step\n event.dispatcher.on(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.on(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.on(event.step.comment, this.stepComment.bind(this));\n\n event.dispatcher.on(event.bddStep.before, this.bddStepStarted.bind(this));\n event.dispatcher.on(event.bddStep.after, this.stepPassed.bind(this));\n }\n\n testStarted(test: { tags?: string[] }) {\n if (!this.currentTest) {\n return;\n }\n\n this.currentTestHookName = undefined;\n\n const tags = test.tags || [];\n const extraTagLabels = tags\n .filter((tag) => tag && !isMetadataTag(tag))\n .map((tag) => (tag.startsWith(\"@\") ? tag.substring(1) : tag))\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0)\n .map((tag) => ({ name: LabelName.TAG, value: tag }));\n\n this.runtime.updateTest(this.currentTest, (tr) => {\n tr.labels.push(...extraTagLabels);\n });\n }\n\n testFailed(test: Mocha.Test, error: Error, hookName?: string) {\n this.currentTestHookName = hookName;\n const shouldFinishTest = isBeforeHook(hookName);\n\n if (!this.currentTest && shouldFinishTest) {\n this.onTest(test);\n }\n\n const status = getCodeceptStatusFromError(error, hookName);\n const statusDetails = getMessageAndTraceFromError(error);\n\n if (this.currentTest) {\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n }\n\n if (this.currentBddStep) {\n this.stopCurrentStep((result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = [];\n\n if (shouldFinishTest) {\n if (this.currentHook) {\n this.runtime.updateFixture(this.currentHook, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n this.runtime.stopFixture(this.currentHook);\n this.currentHook = undefined;\n }\n\n this.onTestEnd(test);\n this.currentTestHookName = undefined;\n }\n }\n\n testFinished(test?: CodeceptTestWithArtifacts) {\n this.currentTestHookName = undefined;\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n\n this.metaStepStack = [];\n this.currentLeafStep = undefined;\n\n const currentTest = this.currentTest;\n if (currentTest) {\n recorder.add(\n \"allure screenshot attachment\",\n () => {\n if (!test?.artifacts?.screenshot) {\n return;\n }\n const screenshotPath = test.artifacts.screenshot;\n\n this.runtime.writeAttachment(currentTest, null, basename(screenshotPath), screenshotPath, {\n contentType: ContentType.PNG,\n wrapInStep: true,\n });\n },\n true,\n );\n }\n }\n\n stepStarted(step: CodeceptStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n\n const stepPath: string[] = [];\n let current = step.metaStep;\n while (current && !current.isBDD() && stepPath.length < MAX_META_STEP_NESTING) {\n stepPath.unshift(stripAnsi(current.toString() ?? \"\").trim());\n current = current.metaStep;\n }\n\n let index = 0;\n while (\n index < Math.min(this.metaStepStack.length, stepPath.length) &&\n this.metaStepStack[index].name === stepPath[index]\n ) {\n index++;\n }\n\n for (let i = this.metaStepStack.length - 1; i >= index; i--) {\n const { id } = this.metaStepStack[i];\n this.runtime.updateStep(id, (s) => {\n s.status = Status.PASSED;\n s.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = this.metaStepStack.slice(0, index);\n\n for (let i = index; i < stepPath.length; i++) {\n const name = stepPath[i];\n const parentId = this.metaStepStack[i - 1]?.id ?? root;\n const id = this.runtime.startStep(parentId, undefined, {\n name,\n });\n if (id) {\n this.metaStepStack.push({ name, id });\n }\n }\n\n const parent = this.metaStepStack[this.metaStepStack.length - 1]?.id ?? root;\n this.currentLeafStep = this.runtime.startStep(parent, undefined, {\n name: step.toString().trim(),\n });\n }\n\n bddStepStarted(step: CodeceptBddStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = this.runtime.startStep(root, undefined, {\n name: step.keyword + step.text,\n });\n }\n\n // Step errors are usually reported directly, but some paths still require\n // reading the recorder rejection to populate the final step status/details.\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n if (!this.currentLeafStep) {\n return;\n }\n\n const currentLeafStep = this.currentLeafStep;\n\n this.runtime.updateStep(currentLeafStep, (result) => {\n result.stage = Stage.FINISHED;\n if (error) {\n if (!error.message && typeof error.inspect === \"function\") {\n error.message = error.inspect();\n }\n result.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(error as unknown as Error);\n result.statusDetails = getMessageAndTraceFromError(error as unknown as Error);\n } else {\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentLeafStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = getMessageAndTraceFromError(err as Error);\n });\n }\n return Promise.reject(err);\n });\n }\n\n result.status = Status.BROKEN;\n }\n });\n this.runtime.stopStep(currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n if (this.currentBddStep && !this.currentLeafStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n this.currentBddStep = undefined;\n return;\n }\n\n if (!this.currentLeafStep) {\n return;\n }\n\n this.runtime.updateStep(this.currentLeafStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stopCurrentStep(updateFunc: (result: StepResult) => void) {\n const root = this.currentHook ?? this.currentTest;\n const currentStep = root ? this.runtime.currentStep(root) : undefined;\n\n this.stopStepById(currentStep, updateFunc);\n }\n\n stopStepById(currentStep: string | undefined, updateFunc: (result: StepResult) => void) {\n if (!currentStep) {\n return;\n }\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n // AssertionFailedError doesn't set message attribute\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = { ...step.statusDetails, ...getMessageAndTraceFromError(err as Error) };\n });\n }\n return Promise.reject(err);\n });\n }\n\n this.runtime.updateStep(currentStep, updateFunc);\n this.runtime.stopStep(currentStep);\n }\n\n mochaTestFailed(_: Mocha.Test, error: Error) {\n if (!this.currentTest) {\n return;\n }\n\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = getCodeceptStatusFromError(error, this.currentTestHookName);\n result.statusDetails = {\n ...result.statusDetails,\n ...getMessageAndTraceFromError(error),\n };\n });\n }\n\n protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;AAAA,SAASA,QAAQ,QAAQ,WAAW;AAEpC,SAASC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAyB,mBAAmB;AAC1F,SAASC,2BAA2B,EAAEC,kBAAkB,EAAEC,aAAa,EAAEC,SAAS,QAAQ,uBAAuB;AACjH,OAAOC,mBAAmB,MAAM,cAAc;AAC9C,SAASC,KAAK,EAAEC,QAAQ,QAAQ,YAAY;AAgB5C,IAAMC,qBAAqB,GAAG,EAAE;AAChC;AACA;AACA,IAAMC,cAAc,GAAG,OAAO;AAE9B,IAAMC,sCAAsC,GAAG,CAC7C,uGAAuG,EACvG,0HAA0H,EAC1H,wDAAwD,EACxD,+DAA+D,EAC/D,6DAA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AC,IAAI,CAACb,WAAW,EAAGoB,MAAM,IAAK;MACpDA,MAAM,CAACjE,MAAM,GAAGF,0BAA0B,CAACL,KAAK,EAAE,IAAI,CAACqD,mBAAmB,CAAC;MAC3EmB,MAAM,CAACD,aAAa,GAAAE,aAAA,CAAAA,aAAA,KACfD,MAAM,CAACD,aAAa,GACpBlF,2BAA2B,CAACW,KAAK,CAAC,CACtC;IACH,CAAC,CAAC;EACJ;AAKF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"reporter.js","names":["basename","ContentType","LabelName","Stage","Status","getMessageAndTraceFromError","getStatusFromError","isMetadataTag","stripAnsi","AllureMochaReporter","event","recorder","MAX_META_STEP_NESTING","TRY_TO_SESSION","knownCodeceptVerificationErrorPatterns","isKnownCodeceptVerificationError","error","message","some","pattern","test","getCodeceptStatusFromError","hookName","status","FAILED","BROKEN","isBeforeEachHook","isBeforeHook","isErrorInstance","value","_constructor","Error","constructor","name","isTryToSession","_recorder$getCurrentS","getCurrentSessionId","call","getRecorderPromise","_recorder$promise","promise","getScreenshotArtifactPath","artifacts","undefined","screenshot","AllureCodeceptJsReporter","runner","opts","isInWorker","_defineProperty","registerEvents","on","mochaTestFailed","bind","dispatcher","before","testStarted","prependListener","failed","beforeHookTestFailed","testFailed","finished","testFinished","hook","hookFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","currentTestHookName","tags","extraTagLabels","filter","tag","map","startsWith","substring","trim","length","TAG","runtime","updateTest","tr","labels","push","pendingTest","flushPendingFailedBeforeEachHookTest","uuid","_this$pendingFailedBe","pendingFailedBeforeEachHookTest","shouldFinishTest","onTest","statusDetails","result","_objectSpread","currentBddStep","stopCurrentStep","stage","FINISHED","id","metaStepStack","updateStep","stopStep","currentHook","updateFixture","stopFixture","queueFailedBeforeEachHookContext","onTestEnd","PASSED","currentLeafStep","attachScreenshot","add","writeFailedBeforeEachHookTest","_ref","_ref2","writeScreenshotAttachment","screenshotPath","writeAttachment","contentType","PNG","wrapInStep","_this$currentHook","_this$metaStepStack$i2","_this$metaStepStack2","root","stepPath","current","metaStep","isBDD","_current$toString","unshift","toString","index","Math","min","i","s","slice","_this$metaStepStack$i","_this$metaStepStack","parentId","startStep","parent","_this$currentHook2","keyword","text","_","inspect","catch","err","Promise","reject","updateFunc","_this$currentHook3","currentStep","stopStepById"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { basename } from \"node:path\";\n\nimport { ContentType, LabelName, Stage, Status, type StepResult } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError, isMetadataTag, stripAnsi } from \"allure-js-commons/sdk\";\nimport AllureMochaReporter from \"allure-mocha\";\nimport { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\n\nimport type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\ninterface CodeceptTestWithArtifacts {\n artifacts?: unknown;\n}\n\ninterface PendingFailedBeforeEachHookTest {\n test: Mocha.Test;\n uuid: string;\n hookName?: string;\n}\n\nconst MAX_META_STEP_NESTING = 10;\n// CodeceptJS tryTo() uses a dedicated \"tryTo\" recorder session.\n// Docs: https://codecept.io/effects.html\nconst TRY_TO_SESSION = \"tryTo\";\n\nconst knownCodeceptVerificationErrorPatterns = [\n /^Element \".+\" is (?:not visible on page|still visible on page|not seen in DOM|still seen in DOM)\\.?$/i,\n /^(?:Element|Clickable element|Context element|Frame|Option \".+\" in|Custom locator .+) .*\\b(?:not found|was not found)\\b/i,\n /^element \\(.+\\) .+ after \\d+(?:\\.\\d+)? sec(?:\\n|\\.|$)/i,\n /^Text \".+\" was not found on page after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Expected \\d+ tabs are not met after \\d+(?:\\.\\d+)? sec\\.?$/i,\n /^Cookie .+ is not found after \\d+(?:\\.\\d+)?s$/i,\n] as const;\n\nconst isKnownCodeceptVerificationError = (error: Partial<Error>): boolean => {\n const message = error.message ? stripAnsi(error.message) : \"\";\n\n if (!message) {\n return false;\n }\n\n return knownCodeceptVerificationErrorPatterns.some((pattern) => pattern.test(message));\n};\n\nconst getCodeceptStatusFromError = (error: Partial<Error>, hookName?: string): Status => {\n const status = getStatusFromError(error);\n\n if (status === Status.FAILED || hookName) {\n return status;\n }\n\n return isKnownCodeceptVerificationError(error) ? Status.FAILED : Status.BROKEN;\n};\n\nconst isBeforeEachHook = (hookName?: string) => hookName === \"Before\";\nconst isBeforeHook = (hookName?: string) => isBeforeEachHook(hookName) || hookName === \"BeforeSuite\";\n\nconst isErrorInstance = (value: unknown): value is Error =>\n value instanceof Error ||\n (typeof value === \"object\" &&\n value !== null &&\n (value as { constructor?: { name?: unknown } }).constructor?.name === \"Error\");\n\nconst isTryToSession = () => recorder.getCurrentSessionId?.() === TRY_TO_SESSION;\nconst getRecorderPromise = (): Promise<unknown> | undefined =>\n (recorder.promise as (() => Promise<unknown> | undefined) | undefined)?.();\nconst getScreenshotArtifactPath = (test?: CodeceptTestWithArtifacts) => {\n const artifacts = test?.artifacts;\n\n if (typeof artifacts !== \"object\" || artifacts === null || !(\"screenshot\" in artifacts)) {\n return undefined;\n }\n\n return typeof artifacts.screenshot === \"string\" ? artifacts.screenshot : undefined;\n};\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n protected currentLeafStep?: string;\n protected currentTestHookName?: string;\n protected pendingFailedBeforeEachHookTest?: PendingFailedBeforeEachHookTest;\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\n runner.on(\"fail\", this.mochaTestFailed.bind(this));\n }\n\n registerEvents() {\n // Test\n event.dispatcher.on(event.test.before, this.testStarted.bind(this));\n // A failed CodeceptJS Before hook emits test.failed before the scenario has\n // started in Mocha. Start the Allure test before other failure listeners so\n // their runtime attachments target the test, then defer writing the result\n // until queued failure artifacts, such as screenshots, are available.\n event.dispatcher.prependListener(event.test.failed, this.beforeHookTestFailed.bind(this));\n event.dispatcher.on(event.test.failed, this.testFailed.bind(this));\n event.dispatcher.on(event.test.finished, this.testFinished.bind(this));\n event.dispatcher.on(event.hook.finished, this.hookFinished.bind(this));\n // Step\n event.dispatcher.on(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.on(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.on(event.step.comment, this.stepComment.bind(this));\n\n event.dispatcher.on(event.bddStep.before, this.bddStepStarted.bind(this));\n event.dispatcher.on(event.bddStep.after, this.stepPassed.bind(this));\n }\n\n testStarted(test: { tags?: string[] }) {\n if (!this.currentTest) {\n return;\n }\n\n this.currentTestHookName = undefined;\n\n const tags = test.tags || [];\n const extraTagLabels = tags\n .filter((tag) => tag && !isMetadataTag(tag))\n .map((tag) => (tag.startsWith(\"@\") ? tag.substring(1) : tag))\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0)\n .map((tag) => ({ name: LabelName.TAG, value: tag }));\n\n this.runtime.updateTest(this.currentTest, (tr) => {\n tr.labels.push(...extraTagLabels);\n });\n }\n\n beforeHookTestFailed(test: Mocha.Test, error: Error, hookName?: string) {\n if (isBeforeEachHook(hookName)) {\n const pendingTest = this.flushPendingFailedBeforeEachHookTest();\n\n if (pendingTest && pendingTest.test !== test && this.currentTest === pendingTest.uuid) {\n this.currentTest = undefined;\n this.currentTestHookName = undefined;\n }\n\n this.testFailed(test, error, hookName);\n }\n }\n\n testFailed(test: Mocha.Test, error: Error, hookName?: string) {\n if (isBeforeEachHook(hookName) && this.pendingFailedBeforeEachHookTest?.test === test) {\n return;\n }\n\n this.currentTestHookName = hookName;\n const shouldFinishTest = isBeforeHook(hookName);\n\n if (!this.currentTest && shouldFinishTest) {\n this.onTest(test);\n }\n\n const status = getCodeceptStatusFromError(error, hookName);\n const statusDetails = getMessageAndTraceFromError(error);\n\n if (this.currentTest) {\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n }\n\n if (this.currentBddStep) {\n this.stopCurrentStep((result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.stage = Stage.FINISHED;\n result.status = Status.BROKEN;\n if (error) {\n result.status = status;\n result.statusDetails = { ...statusDetails };\n }\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = [];\n\n if (shouldFinishTest) {\n if (this.currentHook) {\n this.runtime.updateFixture(this.currentHook, (result) => {\n result.status = status;\n result.statusDetails = {\n ...result.statusDetails,\n ...statusDetails,\n };\n });\n this.runtime.stopFixture(this.currentHook);\n this.currentHook = undefined;\n }\n\n if (isBeforeEachHook(hookName)) {\n if (this.currentTest) {\n this.pendingFailedBeforeEachHookTest = {\n test,\n uuid: this.currentTest,\n hookName,\n };\n this.queueFailedBeforeEachHookContext(this.pendingFailedBeforeEachHookTest);\n }\n } else {\n this.onTestEnd(test);\n this.currentTestHookName = undefined;\n }\n }\n }\n\n testFinished(test?: CodeceptTestWithArtifacts) {\n this.currentTestHookName = undefined;\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = undefined;\n\n for (const { id } of this.metaStepStack) {\n this.runtime.updateStep(id, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n\n this.metaStepStack = [];\n this.currentLeafStep = undefined;\n\n if (this.currentTest) {\n this.attachScreenshot(this.currentTest, test);\n }\n }\n\n hookFinished() {\n this.flushPendingFailedBeforeEachHookTest();\n }\n\n protected flushPendingFailedBeforeEachHookTest() {\n const pendingTest = this.pendingFailedBeforeEachHookTest;\n\n if (!pendingTest) {\n return undefined;\n }\n\n this.pendingFailedBeforeEachHookTest = undefined;\n\n recorder.add(\n \"allure failed before hook result\",\n () => {\n this.writeFailedBeforeEachHookTest(pendingTest);\n },\n true,\n false,\n );\n\n return pendingTest;\n }\n\n protected queueFailedBeforeEachHookContext({ uuid, hookName }: PendingFailedBeforeEachHookTest) {\n // Helper _failed hooks can await I/O before calling the runtime API, so\n // restore the failure context in the recorder before those hooks run.\n recorder.add(\n \"allure failed before hook context\",\n () => {\n this.currentTest = uuid;\n this.currentTestHookName = hookName;\n },\n true,\n false,\n );\n }\n\n protected writeFailedBeforeEachHookTest({ test, uuid, hookName }: PendingFailedBeforeEachHookTest) {\n const currentTest = this.currentTest;\n const currentTestHookName = this.currentTestHookName;\n\n this.currentTest = uuid;\n this.currentTestHookName = hookName;\n this.writeScreenshotAttachment(uuid, test);\n this.onTestEnd(test);\n\n if (!this.currentTest && currentTest && currentTest !== uuid) {\n this.currentTest = currentTest;\n this.currentTestHookName = currentTestHookName;\n return;\n }\n\n this.currentTestHookName = undefined;\n }\n\n protected attachScreenshot(currentTest: string, test?: CodeceptTestWithArtifacts) {\n recorder.add(\n \"allure screenshot attachment\",\n () => {\n this.writeScreenshotAttachment(currentTest, test);\n },\n true,\n );\n }\n\n protected writeScreenshotAttachment(currentTest: string, test?: CodeceptTestWithArtifacts) {\n const screenshotPath = getScreenshotArtifactPath(test);\n\n if (!screenshotPath) {\n return;\n }\n\n this.runtime.writeAttachment(currentTest, null, basename(screenshotPath), screenshotPath, {\n contentType: ContentType.PNG,\n wrapInStep: true,\n });\n }\n\n stepStarted(step: CodeceptStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n\n const stepPath: string[] = [];\n let current = step.metaStep;\n while (current && !current.isBDD() && stepPath.length < MAX_META_STEP_NESTING) {\n stepPath.unshift(stripAnsi(current.toString() ?? \"\").trim());\n current = current.metaStep;\n }\n\n let index = 0;\n while (\n index < Math.min(this.metaStepStack.length, stepPath.length) &&\n this.metaStepStack[index].name === stepPath[index]\n ) {\n index++;\n }\n\n for (let i = this.metaStepStack.length - 1; i >= index; i--) {\n const { id } = this.metaStepStack[i];\n this.runtime.updateStep(id, (s) => {\n s.status = Status.PASSED;\n s.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(id);\n }\n this.metaStepStack = this.metaStepStack.slice(0, index);\n\n for (let i = index; i < stepPath.length; i++) {\n const name = stepPath[i];\n const parentId = this.metaStepStack[i - 1]?.id ?? root;\n const id = this.runtime.startStep(parentId, undefined, {\n name,\n });\n if (id) {\n this.metaStepStack.push({ name, id });\n }\n }\n\n const parent = this.metaStepStack[this.metaStepStack.length - 1]?.id ?? root;\n this.currentLeafStep = this.runtime.startStep(parent, undefined, {\n name: step.toString().trim(),\n });\n }\n\n bddStepStarted(step: CodeceptBddStep) {\n const root = this.currentHook ?? this.currentTest;\n if (!root) {\n return;\n }\n if (this.currentBddStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n }\n this.currentBddStep = this.runtime.startStep(root, undefined, {\n name: step.keyword + step.text,\n });\n }\n\n // Step errors are usually reported directly, but some paths still require\n // reading the recorder rejection to populate the final step status/details.\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n if (!this.currentLeafStep) {\n return;\n }\n\n const currentLeafStep = this.currentLeafStep;\n\n this.runtime.updateStep(currentLeafStep, (result) => {\n result.stage = Stage.FINISHED;\n if (error) {\n if (!error.message && typeof error.inspect === \"function\") {\n error.message = error.inspect();\n }\n result.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(error as unknown as Error);\n result.statusDetails = getMessageAndTraceFromError(error as unknown as Error);\n } else {\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentLeafStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = getMessageAndTraceFromError(err as Error);\n });\n }\n return Promise.reject(err);\n });\n }\n\n result.status = Status.BROKEN;\n }\n });\n this.runtime.stopStep(currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n if (this.currentBddStep && !this.currentLeafStep) {\n this.runtime.updateStep(this.currentBddStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentBddStep);\n this.currentBddStep = undefined;\n return;\n }\n\n if (!this.currentLeafStep) {\n return;\n }\n\n this.runtime.updateStep(this.currentLeafStep, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n this.runtime.stopStep(this.currentLeafStep);\n this.currentLeafStep = undefined;\n }\n\n stopCurrentStep(updateFunc: (result: StepResult) => void) {\n const root = this.currentHook ?? this.currentTest;\n const currentStep = root ? this.runtime.currentStep(root) : undefined;\n\n this.stopStepById(currentStep, updateFunc);\n }\n\n stopStepById(currentStep: string | undefined, updateFunc: (result: StepResult) => void) {\n if (!currentStep) {\n return;\n }\n const promise = getRecorderPromise();\n if (promise) {\n promise.catch((err) => {\n if (!err.message && typeof err.inspect === \"function\") {\n // AssertionFailedError doesn't set message attribute\n err.message = err.inspect();\n }\n if (isErrorInstance(err)) {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = isTryToSession() ? Status.BROKEN : getCodeceptStatusFromError(err as Error);\n step.statusDetails = { ...step.statusDetails, ...getMessageAndTraceFromError(err as Error) };\n });\n }\n return Promise.reject(err);\n });\n }\n\n this.runtime.updateStep(currentStep, updateFunc);\n this.runtime.stopStep(currentStep);\n }\n\n mochaTestFailed(_: Mocha.Test, error: Error) {\n if (!this.currentTest) {\n return;\n }\n\n this.runtime.updateTest(this.currentTest, (result) => {\n result.status = getCodeceptStatusFromError(error, this.currentTestHookName);\n result.statusDetails = {\n ...result.statusDetails,\n ...getMessageAndTraceFromError(error),\n };\n });\n }\n\n protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;AAAA,SAASA,QAAQ,QAAQ,WAAW;AAEpC,SAASC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAyB,mBAAmB;AAC1F,SAASC,2BAA2B,EAAEC,kBAAkB,EAAEC,aAAa,EAAEC,SAAS,QAAQ,uBAAuB;AACjH,OAAOC,mBAAmB,MAAM,cAAc;AAC9C,SAASC,KAAK,EAAEC,QAAQ,QAAQ,YAAY;AAoB5C,IAAMC,qBAAqB,GAAG,EAAE;AAChC;AACA;AACA,IAAMC,cAAc,GAAG,OAAO;AAE9B,IAAMC,sCAAsC,GAAG,CAC7C,uGAAuG,EACvG,0HAA0H,EAC1H,wDAAwD,EACxD,+DAA+D,EAC/D,6DAA6D,EAC7D,gDAAgD,CACxC;AAEV,IAAMC,gCAAgC,GAAIC,KAAqB,IAAc;EAC3E,IAAMC,OAAO,GAAGD,KAAK,CAACC,OAAO,GAAGT,SAAS,CAACQ,KAAK,CAACC,OAAO,CAAC,GAAG,EAAE;EAE7D,IAAI,CAACA,OAAO,EAAE;IACZ,OAAO,KAAK;EACd;EAEA,OAAOH,sCAAsC,CAACI,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACC,IAAI,CAACH,OAAO,CAAC,CAAC;AACxF,CAAC;AAED,IAAMI,0BAA0B,GAAGA,CAACL,KAAqB,EAAEM,QAAiB,KAAa;EACvF,IAAMC,MAAM,GAAGjB,kBAAkB,CAACU,KAAK,CAAC;EAExC,IAAIO,MAAM,KAAKnB,MAAM,CAACoB,MAAM,IAAIF,QAAQ,EAAE;IACxC,OAAOC,MAAM;EACf;EAEA,OAAOR,gCAAgC,C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AAeA,CAACsG,CAAa,EAAE1I,KAAY,EAAE;IAC3C,IAAI,CAAC,IAAI,CAAC4D,WAAW,EAAE;MACrB;IACF;IAEA,IAAI,CAACY,OAAO,CAACC,UAAU,CAAC,IAAI,CAACb,WAAW,EAAGyB,MAAM,IAAK;MACpDA,MAAM,CAAC9E,MAAM,GAAGF,0BAA0B,CAACL,KAAK,EAAE,IAAI,CAAC6D,mBAAmB,CAAC;MAC3EwB,MAAM,CAACD,aAAa,GAAAE,aAAA,CAAAA,aAAA,KACfD,MAAM,CAACD,aAAa,GACpB/F,2BAA2B,CAACW,KAAK,CAAC,CACtC;IACH,CAAC,CAAC;EACJ;AAKF","ignoreList":[]}
|
package/dist/types/reporter.d.ts
CHANGED
|
@@ -7,22 +7,33 @@ interface MetaStep {
|
|
|
7
7
|
id: string;
|
|
8
8
|
}
|
|
9
9
|
interface CodeceptTestWithArtifacts {
|
|
10
|
-
artifacts?:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
artifacts?: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface PendingFailedBeforeEachHookTest {
|
|
13
|
+
test: Mocha.Test;
|
|
14
|
+
uuid: string;
|
|
15
|
+
hookName?: string;
|
|
13
16
|
}
|
|
14
17
|
export declare class AllureCodeceptJsReporter extends AllureMochaReporter {
|
|
15
18
|
protected currentBddStep?: string;
|
|
16
19
|
protected metaStepStack: MetaStep[];
|
|
17
20
|
protected currentLeafStep?: string;
|
|
18
21
|
protected currentTestHookName?: string;
|
|
22
|
+
protected pendingFailedBeforeEachHookTest?: PendingFailedBeforeEachHookTest;
|
|
19
23
|
constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean);
|
|
20
24
|
registerEvents(): void;
|
|
21
25
|
testStarted(test: {
|
|
22
26
|
tags?: string[];
|
|
23
27
|
}): void;
|
|
28
|
+
beforeHookTestFailed(test: Mocha.Test, error: Error, hookName?: string): void;
|
|
24
29
|
testFailed(test: Mocha.Test, error: Error, hookName?: string): void;
|
|
25
30
|
testFinished(test?: CodeceptTestWithArtifacts): void;
|
|
31
|
+
hookFinished(): void;
|
|
32
|
+
protected flushPendingFailedBeforeEachHookTest(): PendingFailedBeforeEachHookTest | undefined;
|
|
33
|
+
protected queueFailedBeforeEachHookContext({ uuid, hookName }: PendingFailedBeforeEachHookTest): void;
|
|
34
|
+
protected writeFailedBeforeEachHookTest({ test, uuid, hookName }: PendingFailedBeforeEachHookTest): void;
|
|
35
|
+
protected attachScreenshot(currentTest: string, test?: CodeceptTestWithArtifacts): void;
|
|
36
|
+
protected writeScreenshotAttachment(currentTest: string, test?: CodeceptTestWithArtifacts): void;
|
|
26
37
|
stepStarted(step: CodeceptStep): void;
|
|
27
38
|
bddStepStarted(step: CodeceptBddStep): void;
|
|
28
39
|
stepFailed(_: CodeceptJS.Step, error?: CodeceptError): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure-codeceptjs",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.1",
|
|
4
4
|
"description": "Allure codeceptjs integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"test": "vitest run"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"allure-js-commons": "3.12.
|
|
50
|
-
"allure-mocha": "3.12.
|
|
49
|
+
"allure-js-commons": "3.12.1",
|
|
50
|
+
"allure-mocha": "3.12.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/cli": "^8.0.1",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/jasmine": "^6.0.0",
|
|
62
62
|
"@types/node": "^26.0.1",
|
|
63
63
|
"allure-commandline": "^2.29.0",
|
|
64
|
-
"allure-vitest": "3.12.
|
|
64
|
+
"allure-vitest": "3.12.1",
|
|
65
65
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
66
66
|
"codeceptjs": "^4.1.0",
|
|
67
67
|
"codeceptjs-expect": "^1.0.3",
|