allure-codeceptjs 3.4.4 → 3.4.5

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.
@@ -21,6 +21,7 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
21
21
  super(runner, opts, isInWorker);
22
22
  _defineProperty(this, "currentBddStep", void 0);
23
23
  _defineProperty(this, "metaStepStack", []);
24
+ _defineProperty(this, "currentLeafStep", void 0);
24
25
  _defineProperty(this, "getFrameworkName", () => "codeceptjs");
25
26
  _defineProperty(this, "getWorkerId", () => undefined);
26
27
  this.registerEvents();
@@ -101,9 +102,10 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
101
102
  this.runtime.stopStep(id);
102
103
  }
103
104
  this.metaStepStack = [];
105
+ this.currentLeafStep = undefined;
104
106
  }
105
107
  stepStarted(step) {
106
- var _this$currentHook;
108
+ var _this$currentHook, _this$metaStepStack$i2, _this$metaStepStack2;
107
109
  var root = (_this$currentHook = this.currentHook) !== null && _this$currentHook !== void 0 ? _this$currentHook : this.currentTest;
108
110
  if (!root) {
109
111
  return;
@@ -112,24 +114,29 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
112
114
  var current = step.metaStep;
113
115
  while (current && !current.isBDD() && stepPath.length < MAX_META_STEP_NESTING) {
114
116
  var _current$toString;
115
- stepPath.push((0, _sdk.stripAnsi)((_current$toString = current.toString()) !== null && _current$toString !== void 0 ? _current$toString : "").trim());
117
+ stepPath.unshift((0, _sdk.stripAnsi)((_current$toString = current.toString()) !== null && _current$toString !== void 0 ? _current$toString : "").trim());
116
118
  current = current.metaStep;
117
119
  }
118
120
  var index = 0;
119
121
  while (index < Math.min(this.metaStepStack.length, stepPath.length) && this.metaStepStack[index].name === stepPath[index]) {
120
122
  index++;
121
123
  }
122
- for (var i = index; i < this.metaStepStack.length; i++) {
123
- var id = this.metaStepStack[i].id;
124
- this.runtime.updateStep(id, result => {
125
- result.status = _allureJsCommons.Status.PASSED;
126
- result.stage = _allureJsCommons.Stage.FINISHED;
124
+ for (var i = this.metaStepStack.length - 1; i >= index; i--) {
125
+ var {
126
+ id
127
+ } = this.metaStepStack[i];
128
+ this.runtime.updateStep(id, s => {
129
+ s.status = _allureJsCommons.Status.PASSED;
130
+ s.stage = _allureJsCommons.Stage.FINISHED;
127
131
  });
128
132
  this.runtime.stopStep(id);
129
133
  }
134
+ this.metaStepStack = this.metaStepStack.slice(0, index);
130
135
  for (var _i = index; _i < stepPath.length; _i++) {
136
+ var _this$metaStepStack$i, _this$metaStepStack;
131
137
  var name = stepPath[_i];
132
- var _id = this.runtime.startStep(root, undefined, {
138
+ var parentId = (_this$metaStepStack$i = (_this$metaStepStack = this.metaStepStack[_i - 1]) === null || _this$metaStepStack === void 0 ? void 0 : _this$metaStepStack.id) !== null && _this$metaStepStack$i !== void 0 ? _this$metaStepStack$i : root;
139
+ var _id = this.runtime.startStep(parentId, undefined, {
133
140
  name
134
141
  });
135
142
  if (_id) {
@@ -139,7 +146,8 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
139
146
  });
140
147
  }
141
148
  }
142
- this.runtime.startStep(root, undefined, {
149
+ var parent = (_this$metaStepStack$i2 = (_this$metaStepStack2 = this.metaStepStack[this.metaStepStack.length - 1]) === null || _this$metaStepStack2 === void 0 ? void 0 : _this$metaStepStack2.id) !== null && _this$metaStepStack$i2 !== void 0 ? _this$metaStepStack$i2 : root;
150
+ this.currentLeafStep = this.runtime.startStep(parent, undefined, {
143
151
  name: step.toString().trim()
144
152
  });
145
153
  }
@@ -149,6 +157,13 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
149
157
  if (!root) {
150
158
  return;
151
159
  }
160
+ if (this.currentBddStep) {
161
+ this.runtime.updateStep(this.currentBddStep, result => {
162
+ result.status = _allureJsCommons.Status.PASSED;
163
+ result.stage = _allureJsCommons.Stage.FINISHED;
164
+ });
165
+ this.runtime.stopStep(this.currentBddStep);
166
+ }
152
167
  this.currentBddStep = this.runtime.startStep(root, undefined, {
153
168
  name: step.keyword + step.text
154
169
  });
@@ -157,17 +172,23 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
157
172
  // according to the docs, codeceptjs supposed to report the error,
158
173
  // but actually it's never reported
159
174
  stepFailed(_, error) {
160
- this.stopCurrentStep(result => {
175
+ if (!this.currentLeafStep) {
176
+ return;
177
+ }
178
+ this.runtime.updateStep(this.currentLeafStep, result => {
161
179
  result.stage = _allureJsCommons.Stage.FINISHED;
162
180
  if (error) {
163
- result.status = (0, _sdk.getStatusFromError)({
164
- message: error.message
165
- });
181
+ if (!error.message && typeof error.inspect === "function") {
182
+ error.message = error.inspect();
183
+ }
184
+ result.status = (0, _sdk.getStatusFromError)(error);
166
185
  result.statusDetails = (0, _sdk.getMessageAndTraceFromError)(error);
167
186
  } else {
168
187
  result.status = _nodeProcess.env.TRY_TO === "true" ? _allureJsCommons.Status.BROKEN : _allureJsCommons.Status.FAILED;
169
188
  }
170
189
  });
190
+ this.runtime.stopStep(this.currentLeafStep);
191
+ this.currentLeafStep = undefined;
171
192
  }
172
193
  stepComment() {
173
194
  this.stopCurrentStep(result => {
@@ -176,10 +197,24 @@ class AllureCodeceptJsReporter extends _allureMocha.default {
176
197
  });
177
198
  }
178
199
  stepPassed() {
179
- this.stopCurrentStep(result => {
200
+ if (this.currentBddStep && !this.currentLeafStep) {
201
+ this.runtime.updateStep(this.currentBddStep, result => {
202
+ result.status = _allureJsCommons.Status.PASSED;
203
+ result.stage = _allureJsCommons.Stage.FINISHED;
204
+ });
205
+ this.runtime.stopStep(this.currentBddStep);
206
+ this.currentBddStep = undefined;
207
+ return;
208
+ }
209
+ if (!this.currentLeafStep) {
210
+ return;
211
+ }
212
+ this.runtime.updateStep(this.currentLeafStep, result => {
180
213
  result.status = _allureJsCommons.Status.PASSED;
181
214
  result.stage = _allureJsCommons.Stage.FINISHED;
182
215
  });
216
+ this.runtime.stopStep(this.currentLeafStep);
217
+ this.currentLeafStep = undefined;
183
218
  }
184
219
  stopCurrentStep(updateFunc) {
185
220
  var _this$currentHook3;
@@ -1 +1 @@
1
- {"version":3,"file":"reporter.js","names":["_codeceptjs","require","_nodeProcess","_allureJsCommons","_sdk","_allureMocha","_interopRequireDefault","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","AllureCodeceptJsReporter","AllureMochaReporter","constructor","runner","opts","isInWorker","undefined","registerEvents","event","dispatcher","on","test","before","testStarted","bind","failed","testFailed","finished","testFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","tags","extraTagLabels","tag","isMetadataTag","map","startsWith","substring","trim","name","LabelName","TAG","runtime","updateTest","tr","labels","_","error","status","getStatusFromError","message","statusDetails","getMessageAndTraceFromError","currentBddStep","stopCurrentStep","result","stage","Stage","FINISHED","Status","BROKEN","id","metaStepStack","updateStep","stopStep","PASSED","_this$currentHook","root","currentHook","stepPath","current","metaStep","isBDD","_current$toString","stripAnsi","toString","index","Math","min","startStep","_this$currentHook2","keyword","text","env","TRY_TO","FAILED","updateFunc","_this$currentHook3","currentStep","stopStepById","promise","recorder","catch","err","inspect","Error","Promise","reject","exports"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\nimport { env } from \"node:process\";\nimport { 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 type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\nconst MAX_META_STEP_NESTING = 10;\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\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 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(_: {}, error: Error) {\n const status = getStatusFromError({ message: error.message } as Error);\n const statusDetails = getMessageAndTraceFromError(error);\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\n testFinished() {\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 }\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.push(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 = index; i < this.metaStepStack.length; i++) {\n const id = this.metaStepStack[i].id;\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 for (let i = index; i < stepPath.length; i++) {\n const name = stepPath[i];\n const id = this.runtime.startStep(root, undefined, {\n name,\n });\n if (id) {\n this.metaStepStack.push({ name, id });\n }\n }\n\n this.runtime.startStep(root, 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 this.currentBddStep = this.runtime.startStep(root, undefined, {\n name: step.keyword + step.text,\n });\n }\n\n // according to the docs, codeceptjs supposed to report the error,\n // but actually it's never reported\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n this.stopCurrentStep((result) => {\n result.stage = Stage.FINISHED;\n if (error) {\n result.status = getStatusFromError({ message: error.message } as Error);\n result.statusDetails = getMessageAndTraceFromError(error);\n } else {\n result.status = env.TRY_TO === \"true\" ? Status.BROKEN : Status.FAILED;\n }\n });\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\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 = recorder.promise();\n // @ts-ignore\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 (err instanceof Error || err.constructor.name === \"Error\") {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = getStatusFromError(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 protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AAA+C,SAAAK,uBAAAC,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,C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AE;UACrD;UACAD,GAAG,CAAC3C,OAAO,GAAG2C,GAAG,CAACC,OAAO,CAAC,CAAC;QAC7B;QACA,IAAID,GAAG,YAAYE,KAAK,IAAIF,GAAG,CAAC3F,WAAW,CAACqC,IAAI,KAAK,OAAO,EAAE;UAC5D,IAAI,CAACG,OAAO,CAACqB,UAAU,CAACyB,WAAW,EAAGrE,IAAI,IAAK;YAC7CA,IAAI,CAAC6B,MAAM,GAAG,IAAAC,uBAAkB,EAAC4C,GAAY,CAAC;YAC9C1E,IAAI,CAACgC,aAAa,GAAAxE,aAAA,CAAAA,aAAA,KAAQwC,IAAI,CAACgC,aAAa,GAAK,IAAAC,gCAA2B,EAACyC,GAAY,CAAC,CAAE;UAC9F,CAAC,CAAC;QACJ;QACA,OAAOG,OAAO,CAACC,MAAM,CAACJ,GAAG,CAAC;MAC5B,CAAC,CAAC;IACJ;IAEA,IAAI,CAACnD,OAAO,CAACqB,UAAU,CAACyB,WAAW,EAAEF,UAAU,CAAC;IAChD,IAAI,CAAC5C,OAAO,CAACsB,QAAQ,CAACwB,WAAW,CAAC;EACpC;AAKF;AAACU,OAAA,CAAAlG,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"file":"reporter.js","names":["_codeceptjs","require","_nodeProcess","_allureJsCommons","_sdk","_allureMocha","_interopRequireDefault","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","AllureCodeceptJsReporter","AllureMochaReporter","constructor","runner","opts","isInWorker","undefined","registerEvents","event","dispatcher","on","test","before","testStarted","bind","failed","testFailed","finished","testFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","tags","extraTagLabels","tag","isMetadataTag","map","startsWith","substring","trim","name","LabelName","TAG","runtime","updateTest","tr","labels","_","error","status","getStatusFromError","message","statusDetails","getMessageAndTraceFromError","currentBddStep","stopCurrentStep","result","stage","Stage","FINISHED","Status","BROKEN","id","metaStepStack","updateStep","stopStep","PASSED","currentLeafStep","_this$currentHook","_this$metaStepStack$i2","_this$metaStepStack2","root","currentHook","stepPath","current","metaStep","isBDD","_current$toString","unshift","stripAnsi","toString","index","Math","min","s","slice","_this$metaStepStack$i","_this$metaStepStack","parentId","startStep","parent","_this$currentHook2","keyword","text","inspect","env","TRY_TO","FAILED","updateFunc","_this$currentHook3","currentStep","stopStepById","promise","recorder","catch","err","Error","Promise","reject","exports"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\nimport { env } from \"node:process\";\nimport { 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 type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\nconst MAX_META_STEP_NESTING = 10;\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n protected currentLeafStep?: string;\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\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 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(_: {}, error: Error) {\n const status = getStatusFromError({ message: error.message } as Error);\n const statusDetails = getMessageAndTraceFromError(error);\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\n testFinished() {\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\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 // according to the docs, codeceptjs supposed to report the error,\n // but actually it's never reported\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n if (!this.currentLeafStep) {\n return;\n }\n\n this.runtime.updateStep(this.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 = getStatusFromError(error as unknown as Error);\n result.statusDetails = getMessageAndTraceFromError(error as unknown as Error);\n } else {\n result.status = env.TRY_TO === \"true\" ? Status.BROKEN : Status.FAILED;\n }\n });\n this.runtime.stopStep(this.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 = recorder.promise();\n // @ts-ignore\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 (err instanceof Error || err.constructor.name === \"Error\") {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = getStatusFromError(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 protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,O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,CAAC;YAC9CrF,IAAI,CAACgC,aAAa,GAAAxE,aAAA,CAAAA,aAAA,KAAQwC,IAAI,CAACgC,aAAa,GAAK,IAAAC,gCAA2B,EAACoD,GAAY,CAAC,CAAE;UAC9F,CAAC,CAAC;QACJ;QACA,OAAOE,OAAO,CAACC,MAAM,CAACH,GAAG,CAAC;MAC5B,CAAC,CAAC;IACJ;IAEA,IAAI,CAAC9D,OAAO,CAACqB,UAAU,CAACoC,WAAW,EAAEF,UAAU,CAAC;IAChD,IAAI,CAACvD,OAAO,CAACsB,QAAQ,CAACmC,WAAW,CAAC;EACpC;AAKF;AAACS,OAAA,CAAA5G,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -14,6 +14,7 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
14
14
  super(runner, opts, isInWorker);
15
15
  _defineProperty(this, "currentBddStep", void 0);
16
16
  _defineProperty(this, "metaStepStack", []);
17
+ _defineProperty(this, "currentLeafStep", void 0);
17
18
  _defineProperty(this, "getFrameworkName", () => "codeceptjs");
18
19
  _defineProperty(this, "getWorkerId", () => undefined);
19
20
  this.registerEvents();
@@ -94,9 +95,10 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
94
95
  this.runtime.stopStep(id);
95
96
  }
96
97
  this.metaStepStack = [];
98
+ this.currentLeafStep = undefined;
97
99
  }
98
100
  stepStarted(step) {
99
- var _this$currentHook;
101
+ var _this$currentHook, _this$metaStepStack$i2, _this$metaStepStack2;
100
102
  var root = (_this$currentHook = this.currentHook) !== null && _this$currentHook !== void 0 ? _this$currentHook : this.currentTest;
101
103
  if (!root) {
102
104
  return;
@@ -105,24 +107,29 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
105
107
  var current = step.metaStep;
106
108
  while (current && !current.isBDD() && stepPath.length < MAX_META_STEP_NESTING) {
107
109
  var _current$toString;
108
- stepPath.push(stripAnsi((_current$toString = current.toString()) !== null && _current$toString !== void 0 ? _current$toString : "").trim());
110
+ stepPath.unshift(stripAnsi((_current$toString = current.toString()) !== null && _current$toString !== void 0 ? _current$toString : "").trim());
109
111
  current = current.metaStep;
110
112
  }
111
113
  var index = 0;
112
114
  while (index < Math.min(this.metaStepStack.length, stepPath.length) && this.metaStepStack[index].name === stepPath[index]) {
113
115
  index++;
114
116
  }
115
- for (var i = index; i < this.metaStepStack.length; i++) {
116
- var id = this.metaStepStack[i].id;
117
- this.runtime.updateStep(id, result => {
118
- result.status = Status.PASSED;
119
- result.stage = Stage.FINISHED;
117
+ for (var i = this.metaStepStack.length - 1; i >= index; i--) {
118
+ var {
119
+ id
120
+ } = this.metaStepStack[i];
121
+ this.runtime.updateStep(id, s => {
122
+ s.status = Status.PASSED;
123
+ s.stage = Stage.FINISHED;
120
124
  });
121
125
  this.runtime.stopStep(id);
122
126
  }
127
+ this.metaStepStack = this.metaStepStack.slice(0, index);
123
128
  for (var _i = index; _i < stepPath.length; _i++) {
129
+ var _this$metaStepStack$i, _this$metaStepStack;
124
130
  var name = stepPath[_i];
125
- var _id = this.runtime.startStep(root, undefined, {
131
+ var parentId = (_this$metaStepStack$i = (_this$metaStepStack = this.metaStepStack[_i - 1]) === null || _this$metaStepStack === void 0 ? void 0 : _this$metaStepStack.id) !== null && _this$metaStepStack$i !== void 0 ? _this$metaStepStack$i : root;
132
+ var _id = this.runtime.startStep(parentId, undefined, {
126
133
  name
127
134
  });
128
135
  if (_id) {
@@ -132,7 +139,8 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
132
139
  });
133
140
  }
134
141
  }
135
- this.runtime.startStep(root, undefined, {
142
+ var parent = (_this$metaStepStack$i2 = (_this$metaStepStack2 = this.metaStepStack[this.metaStepStack.length - 1]) === null || _this$metaStepStack2 === void 0 ? void 0 : _this$metaStepStack2.id) !== null && _this$metaStepStack$i2 !== void 0 ? _this$metaStepStack$i2 : root;
143
+ this.currentLeafStep = this.runtime.startStep(parent, undefined, {
136
144
  name: step.toString().trim()
137
145
  });
138
146
  }
@@ -142,6 +150,13 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
142
150
  if (!root) {
143
151
  return;
144
152
  }
153
+ if (this.currentBddStep) {
154
+ this.runtime.updateStep(this.currentBddStep, result => {
155
+ result.status = Status.PASSED;
156
+ result.stage = Stage.FINISHED;
157
+ });
158
+ this.runtime.stopStep(this.currentBddStep);
159
+ }
145
160
  this.currentBddStep = this.runtime.startStep(root, undefined, {
146
161
  name: step.keyword + step.text
147
162
  });
@@ -150,17 +165,23 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
150
165
  // according to the docs, codeceptjs supposed to report the error,
151
166
  // but actually it's never reported
152
167
  stepFailed(_, error) {
153
- this.stopCurrentStep(result => {
168
+ if (!this.currentLeafStep) {
169
+ return;
170
+ }
171
+ this.runtime.updateStep(this.currentLeafStep, result => {
154
172
  result.stage = Stage.FINISHED;
155
173
  if (error) {
156
- result.status = getStatusFromError({
157
- message: error.message
158
- });
174
+ if (!error.message && typeof error.inspect === "function") {
175
+ error.message = error.inspect();
176
+ }
177
+ result.status = getStatusFromError(error);
159
178
  result.statusDetails = getMessageAndTraceFromError(error);
160
179
  } else {
161
180
  result.status = env.TRY_TO === "true" ? Status.BROKEN : Status.FAILED;
162
181
  }
163
182
  });
183
+ this.runtime.stopStep(this.currentLeafStep);
184
+ this.currentLeafStep = undefined;
164
185
  }
165
186
  stepComment() {
166
187
  this.stopCurrentStep(result => {
@@ -169,10 +190,24 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
169
190
  });
170
191
  }
171
192
  stepPassed() {
172
- this.stopCurrentStep(result => {
193
+ if (this.currentBddStep && !this.currentLeafStep) {
194
+ this.runtime.updateStep(this.currentBddStep, result => {
195
+ result.status = Status.PASSED;
196
+ result.stage = Stage.FINISHED;
197
+ });
198
+ this.runtime.stopStep(this.currentBddStep);
199
+ this.currentBddStep = undefined;
200
+ return;
201
+ }
202
+ if (!this.currentLeafStep) {
203
+ return;
204
+ }
205
+ this.runtime.updateStep(this.currentLeafStep, result => {
173
206
  result.status = Status.PASSED;
174
207
  result.stage = Stage.FINISHED;
175
208
  });
209
+ this.runtime.stopStep(this.currentLeafStep);
210
+ this.currentLeafStep = undefined;
176
211
  }
177
212
  stopCurrentStep(updateFunc) {
178
213
  var _this$currentHook3;
@@ -1 +1 @@
1
- {"version":3,"file":"reporter.js","names":["event","recorder","env","LabelName","Stage","Status","getMessageAndTraceFromError","getStatusFromError","isMetadataTag","stripAnsi","AllureMochaReporter","MAX_META_STEP_NESTING","AllureCodeceptJsReporter","constructor","runner","opts","isInWorker","_defineProperty","undefined","registerEvents","dispatcher","on","test","before","testStarted","bind","failed","testFailed","finished","testFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","tags","extraTagLabels","filter","tag","map","startsWith","substring","trim","length","name","TAG","value","runtime","updateTest","tr","labels","push","_","error","status","message","statusDetails","currentBddStep","stopCurrentStep","result","stage","FINISHED","BROKEN","_objectSpread","id","metaStepStack","updateStep","stopStep","PASSED","_this$currentHook","root","currentHook","stepPath","current","metaStep","isBDD","_current$toString","toString","index","Math","min","i","startStep","_this$currentHook2","keyword","text","TRY_TO","FAILED","updateFunc","_this$currentHook3","currentStep","stopStepById","promise","catch","err","inspect","Error","Promise","reject"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\nimport { env } from \"node:process\";\nimport { 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 type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\nconst MAX_META_STEP_NESTING = 10;\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\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 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(_: {}, error: Error) {\n const status = getStatusFromError({ message: error.message } as Error);\n const statusDetails = getMessageAndTraceFromError(error);\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\n testFinished() {\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 }\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.push(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 = index; i < this.metaStepStack.length; i++) {\n const id = this.metaStepStack[i].id;\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 for (let i = index; i < stepPath.length; i++) {\n const name = stepPath[i];\n const id = this.runtime.startStep(root, undefined, {\n name,\n });\n if (id) {\n this.metaStepStack.push({ name, id });\n }\n }\n\n this.runtime.startStep(root, 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 this.currentBddStep = this.runtime.startStep(root, undefined, {\n name: step.keyword + step.text,\n });\n }\n\n // according to the docs, codeceptjs supposed to report the error,\n // but actually it's never reported\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n this.stopCurrentStep((result) => {\n result.stage = Stage.FINISHED;\n if (error) {\n result.status = getStatusFromError({ message: error.message } as Error);\n result.statusDetails = getMessageAndTraceFromError(error);\n } else {\n result.status = env.TRY_TO === \"true\" ? Status.BROKEN : Status.FAILED;\n }\n });\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\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 = recorder.promise();\n // @ts-ignore\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 (err instanceof Error || err.constructor.name === \"Error\") {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = getStatusFromError(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 protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;AAAA,SAASA,KAAK,EAAEC,QAAQ,QAAQ,YAAY;AAE5C,SAASC,GAAG,QAAQ,cAAc;AAClC,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAyB,mBAAmB;AAC7E,SAASC,2BAA2B,EAAEC,kBAAkB,EAAEC,aAAa,EAAEC,SAAS,QAAQ,uBAAuB;AACjH,OAAOC,mBAAmB,MAAM,cAAc;AAQ9C,IAAMC,qBAAqB,GAAG,EAAE;AAEhC,OAAO,MAAMC,wBAAwB,SAASF,mBAAmB,CAAC;EAIhEG,WAAWA,CAACC,MAAoB,EAAEC,IAAwB,EAAEC,UAAmB,EAAE;IAC/E,KAAK,CAACF,MAAM,EAAEC,IAAI,EAAEC,UAAU,CAAC;IAACC,eAAA;IAAAA,eAAA,wBAHI,EAAE;IAAAA,eAAA,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ACuB,WAAW,CAAC;EACpC;AAKF","ignoreList":[]}
1
+ {"version":3,"file":"reporter.js","names":["event","recorder","env","LabelName","Stage","Status","getMessageAndTraceFromError","getStatusFromError","isMetadataTag","stripAnsi","AllureMochaReporter","MAX_META_STEP_NESTING","AllureCodeceptJsReporter","constructor","runner","opts","isInWorker","_defineProperty","undefined","registerEvents","dispatcher","on","test","before","testStarted","bind","failed","testFailed","finished","testFinished","step","started","stepStarted","passed","stepPassed","stepFailed","comment","stepComment","bddStep","bddStepStarted","after","currentTest","tags","extraTagLabels","filter","tag","map","startsWith","substring","trim","length","name","TAG","value","runtime","updateTest","tr","labels","push","_","error","status","message","statusDetails","currentBddStep","stopCurrentStep","result","stage","FINISHED","BROKEN","_objectSpread","id","metaStepStack","updateStep","stopStep","PASSED","currentLeafStep","_this$currentHook","_this$metaStepStack$i2","_this$metaStepStack2","root","currentHook","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","TRY_TO","FAILED","updateFunc","_this$currentHook3","currentStep","stopStepById","promise","catch","err","Error","Promise","reject"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event, recorder } from \"codeceptjs\";\nimport type * as Mocha from \"mocha\";\nimport { env } from \"node:process\";\nimport { 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 type { CodeceptBddStep, CodeceptError, CodeceptStep } from \"./model.js\";\n\ninterface MetaStep {\n name: string;\n id: string;\n}\n\nconst MAX_META_STEP_NESTING = 10;\n\nexport class AllureCodeceptJsReporter extends AllureMochaReporter {\n protected currentBddStep?: string;\n protected metaStepStack: MetaStep[] = [];\n protected currentLeafStep?: string;\n\n constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {\n super(runner, opts, isInWorker);\n this.registerEvents();\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 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(_: {}, error: Error) {\n const status = getStatusFromError({ message: error.message } as Error);\n const statusDetails = getMessageAndTraceFromError(error);\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\n testFinished() {\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\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 // according to the docs, codeceptjs supposed to report the error,\n // but actually it's never reported\n stepFailed(_: CodeceptJS.Step, error?: CodeceptError) {\n if (!this.currentLeafStep) {\n return;\n }\n\n this.runtime.updateStep(this.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 = getStatusFromError(error as unknown as Error);\n result.statusDetails = getMessageAndTraceFromError(error as unknown as Error);\n } else {\n result.status = env.TRY_TO === \"true\" ? Status.BROKEN : Status.FAILED;\n }\n });\n this.runtime.stopStep(this.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 = recorder.promise();\n // @ts-ignore\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 (err instanceof Error || err.constructor.name === \"Error\") {\n this.runtime.updateStep(currentStep, (step) => {\n step.status = getStatusFromError(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 protected getFrameworkName = () => \"codeceptjs\";\n\n protected getWorkerId = () => undefined;\n}\n"],"mappings":";;;;;AAAA,SAASA,KAAK,EAAEC,QAAQ,QAAQ,YAAY;AAE5C,SAASC,GAAG,QAAQ,cAAc;AAClC,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAyB,mBAAmB;AAC7E,SAASC,2BAA2B,EAAEC,kBAAkB,EAAEC,aAAa,EAAEC,SAAS,QAAQ,uBAAuB;AACjH,OAAOC,mBAAmB,MAAM,cAAc;AAQ9C,IAAMC,qBAAqB,GAAG,EAAE;AAEhC,OAAO,MAAMC,wBAAwB,SAASF,mBAAmB,CAAC;EAKhEG,WAAWA,CAACC,MAAoB,EAAEC,IAAwB,EAAEC,UAAmB,EAAE;IAC/E,KAAK,CAACF,MAAM,EAAEC,IAAI,EAAEC,UAAU,CAAC;IAACC,eAAA;IAAAA,eAAA,wBAJI,EAAE;IAAAA,eAAA;IAAAA,eAAA,2BAmPX,MAAM,YAAY;IAAAA,eAAA,sBAEvB,MAAMC,SAAS;IAhPrC,IAAI,CAACC,cAAc,CAAC,CAAC;EACvB;EAEAA,cAAcA,CAAA,EAAG;IACf;IACAnB,KAAK,CAACoB,UAAU,CAACC,EAAE,CAACrB,KAAK,CAACsB,IAAI,CAACC,MAAM,EAAE,IAAI,CAACC,WAAW,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnEzB,KAAK,CAACoB,UAAU,CAACC,EAAE,CAACrB,KAAK,CAACsB,IAAI,CAACI,MAAM,EAAE,IAAI,CAACC,UAAU,CAACF,IAAI,CAAC,IAAI,CAAC,CAAC;IAClEzB,KAAK,CAACoB,UAAU,CAACC,EAAE,CAACrB,KAAK,CAACsB,IAAI,CAACM,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACJ,IAAI,CAAC,IAAI,CAAC,CAAC;IACtE;IACAzB,KAAK,CAACoB,UAAU,CAAC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AU,CAACmC,WAAW,EAAEF,UAAU,CAAC;IAChD,IAAI,CAACpD,OAAO,CAACoB,QAAQ,CAACkC,WAAW,CAAC;EACpC;AAKF","ignoreList":[]}
@@ -9,6 +9,7 @@ interface MetaStep {
9
9
  export declare class AllureCodeceptJsReporter extends AllureMochaReporter {
10
10
  protected currentBddStep?: string;
11
11
  protected metaStepStack: MetaStep[];
12
+ protected currentLeafStep?: string;
12
13
  constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean);
13
14
  registerEvents(): void;
14
15
  testStarted(test: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure-codeceptjs",
3
- "version": "3.4.4",
3
+ "version": "3.4.5",
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.4.4",
50
- "allure-mocha": "3.4.4"
49
+ "allure-js-commons": "3.4.5",
50
+ "allure-mocha": "3.4.5"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@babel/cli": "^7.28.0",
@@ -66,7 +66,7 @@
66
66
  "@typescript-eslint/eslint-plugin": "^8.0.0",
67
67
  "@typescript-eslint/parser": "^8.0.0",
68
68
  "allure-commandline": "^2.29.0",
69
- "allure-vitest": "3.4.4",
69
+ "allure-vitest": "3.4.5",
70
70
  "babel-plugin-add-module-exports": "^1.0.4",
71
71
  "codeceptjs": "^3.7.6-beta.1",
72
72
  "codeceptjs-expect": "^1.0.3",