@testomatio/reporter 2.9.1-beta.2-allure-tms-link → 2.9.1-beta.3-allure-steps

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.
@@ -44,6 +44,19 @@ declare class AllureReader {
44
44
  overwrite: boolean;
45
45
  };
46
46
  mapStatus(status: any): any;
47
+ /**
48
+ * Map an Allure step status to the Testomat.io Step status enum
49
+ * (`passed | failed | none | custom`, see testomat-api-definition.yml).
50
+ *
51
+ * Allure marks a step `broken` when it threw an unexpected error — that is a
52
+ * failure for reporting purposes, matching how `mapStatus` treats tests.
53
+ * `skipped` and anything unknown/absent become `none` (the neutral value),
54
+ * since the step enum has no `skipped`.
55
+ *
56
+ * @param {string} status - Allure step status
57
+ * @returns {'passed'|'failed'|'none'} Testomat.io step status
58
+ */
59
+ mapStepStatus(status: string): "passed" | "failed" | "none";
47
60
  extractSuiteTitle(result: any): any;
48
61
  stripNamespace(suiteName: any): any;
49
62
  extractFile(result: any): string;
@@ -209,6 +209,28 @@ class AllureReader {
209
209
  };
210
210
  return statusMap[status] || 'failed';
211
211
  }
212
+ /**
213
+ * Map an Allure step status to the Testomat.io Step status enum
214
+ * (`passed | failed | none | custom`, see testomat-api-definition.yml).
215
+ *
216
+ * Allure marks a step `broken` when it threw an unexpected error — that is a
217
+ * failure for reporting purposes, matching how `mapStatus` treats tests.
218
+ * `skipped` and anything unknown/absent become `none` (the neutral value),
219
+ * since the step enum has no `skipped`.
220
+ *
221
+ * @param {string} status - Allure step status
222
+ * @returns {'passed'|'failed'|'none'} Testomat.io step status
223
+ */
224
+ mapStepStatus(status) {
225
+ const statusMap = {
226
+ passed: 'passed',
227
+ failed: 'failed',
228
+ broken: 'failed',
229
+ skipped: 'none',
230
+ pending: 'none',
231
+ };
232
+ return statusMap[status] || 'none';
233
+ }
212
234
  extractSuiteTitle(result) {
213
235
  const labels = result.labels || [];
214
236
  // Only use suite label for suite_title
@@ -360,6 +382,7 @@ class AllureReader {
360
382
  const convertedStep = {
361
383
  category: 'user',
362
384
  title: step.name || step.title || 'Unknown step',
385
+ status: this.mapStepStatus(step.status),
363
386
  duration: this.calculateRunTime(step),
364
387
  steps: this.convertSteps(step.steps || [], depth + 1),
365
388
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.9.1-beta.2-allure-tms-link",
3
+ "version": "2.9.1-beta.3-allure-steps",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -240,6 +240,29 @@ class AllureReader {
240
240
  return statusMap[status] || 'failed';
241
241
  }
242
242
 
243
+ /**
244
+ * Map an Allure step status to the Testomat.io Step status enum
245
+ * (`passed | failed | none | custom`, see testomat-api-definition.yml).
246
+ *
247
+ * Allure marks a step `broken` when it threw an unexpected error — that is a
248
+ * failure for reporting purposes, matching how `mapStatus` treats tests.
249
+ * `skipped` and anything unknown/absent become `none` (the neutral value),
250
+ * since the step enum has no `skipped`.
251
+ *
252
+ * @param {string} status - Allure step status
253
+ * @returns {'passed'|'failed'|'none'} Testomat.io step status
254
+ */
255
+ mapStepStatus(status) {
256
+ const statusMap = {
257
+ passed: 'passed',
258
+ failed: 'failed',
259
+ broken: 'failed',
260
+ skipped: 'none',
261
+ pending: 'none',
262
+ };
263
+ return statusMap[status] || 'none';
264
+ }
265
+
243
266
  extractSuiteTitle(result) {
244
267
  const labels = result.labels || [];
245
268
 
@@ -413,6 +436,7 @@ class AllureReader {
413
436
  const convertedStep = {
414
437
  category: 'user',
415
438
  title: step.name || step.title || 'Unknown step',
439
+ status: this.mapStepStatus(step.status),
416
440
  duration: this.calculateRunTime(step),
417
441
  steps: this.convertSteps(step.steps || [], depth + 1),
418
442
  };