allure-playwright 3.7.1 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/cjs/index.js +538 -212
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model.js.map +1 -1
- package/dist/cjs/playwrightInternals.js +2 -0
- package/dist/cjs/playwrightInternals.js.map +1 -0
- package/dist/cjs/runtime.js +197 -3
- package/dist/cjs/runtime.js.map +1 -1
- package/dist/cjs/syncAnnotations.js +12 -0
- package/dist/cjs/syncAnnotations.js.map +1 -0
- package/dist/cjs/utils.js +14 -8
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/index.js +538 -212
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/playwrightInternals.js +2 -0
- package/dist/esm/playwrightInternals.js.map +1 -0
- package/dist/esm/runtime.js +197 -3
- package/dist/esm/runtime.js.map +1 -1
- package/dist/esm/syncAnnotations.js +6 -0
- package/dist/esm/syncAnnotations.js.map +1 -0
- package/dist/esm/utils.js +14 -8
- package/dist/esm/utils.js.map +1 -1
- package/dist/types/index.d.ts +16 -2
- package/dist/types/model.d.ts +3 -0
- package/dist/types/playwrightInternals.d.ts +29 -0
- package/dist/types/runtime.d.ts +6 -2
- package/dist/types/syncAnnotations.d.ts +3 -0
- package/dist/types/utils.d.ts +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -28,11 +28,11 @@ var _legacy = require("./legacy.js");
|
|
|
28
28
|
var _utils = require("./utils.js");
|
|
29
29
|
var _test = require("@playwright/test");
|
|
30
30
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
31
|
-
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
32
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
33
31
|
function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
|
|
34
32
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
35
33
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
34
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
35
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
36
36
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
37
37
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
38
38
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
@@ -71,8 +71,8 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
71
71
|
_defineProperty(this, "attachmentTargets", new Map());
|
|
72
72
|
_defineProperty(this, "beforeHooksStepsStack", new Map());
|
|
73
73
|
_defineProperty(this, "afterHooksStepsStack", new Map());
|
|
74
|
-
_defineProperty(this, "
|
|
75
|
-
_defineProperty(this, "
|
|
74
|
+
_defineProperty(this, "pendingAttachmentTasks", new Map());
|
|
75
|
+
_defineProperty(this, "attachmentTargetByStep", new WeakMap());
|
|
76
76
|
_defineProperty(this, "pwStepUuid", new WeakMap());
|
|
77
77
|
_defineProperty(this, "testPlan", (0, _reporter.parseTestPlan)());
|
|
78
78
|
this.options = _objectSpread({
|
|
@@ -269,6 +269,259 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
269
269
|
this.allureResultsUuids.set(test.id, testUuid);
|
|
270
270
|
this.startedTestCasesTitlesCache.push(metadata.titleMetadata.cleanTitle);
|
|
271
271
|
}
|
|
272
|
+
}, {
|
|
273
|
+
key: "queueAttachmentTask",
|
|
274
|
+
value: function queueAttachmentTask(testId, task) {
|
|
275
|
+
var _this$pendingAttachme;
|
|
276
|
+
var tasks = (_this$pendingAttachme = this.pendingAttachmentTasks.get(testId)) !== null && _this$pendingAttachme !== void 0 ? _this$pendingAttachme : [];
|
|
277
|
+
tasks.push(task);
|
|
278
|
+
this.pendingAttachmentTasks.set(testId, tasks);
|
|
279
|
+
}
|
|
280
|
+
}, {
|
|
281
|
+
key: "flushAttachmentTasks",
|
|
282
|
+
value: function () {
|
|
283
|
+
var _flushAttachmentTasks = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(testId) {
|
|
284
|
+
var _this$pendingAttachme2;
|
|
285
|
+
var tasks;
|
|
286
|
+
return _regenerator().w(function (_context) {
|
|
287
|
+
while (1) switch (_context.n) {
|
|
288
|
+
case 0:
|
|
289
|
+
tasks = (_this$pendingAttachme2 = this.pendingAttachmentTasks.get(testId)) !== null && _this$pendingAttachme2 !== void 0 ? _this$pendingAttachme2 : [];
|
|
290
|
+
this.pendingAttachmentTasks["delete"](testId);
|
|
291
|
+
if (!(tasks.length > 0)) {
|
|
292
|
+
_context.n = 1;
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
_context.n = 1;
|
|
296
|
+
return Promise.all(tasks);
|
|
297
|
+
case 1:
|
|
298
|
+
return _context.a(2);
|
|
299
|
+
}
|
|
300
|
+
}, _callee, this);
|
|
301
|
+
}));
|
|
302
|
+
function flushAttachmentTasks(_x) {
|
|
303
|
+
return _flushAttachmentTasks.apply(this, arguments);
|
|
304
|
+
}
|
|
305
|
+
return flushAttachmentTasks;
|
|
306
|
+
}()
|
|
307
|
+
}, {
|
|
308
|
+
key: "recordAttachmentTarget",
|
|
309
|
+
value: function recordAttachmentTarget(testId, target) {
|
|
310
|
+
var _this$attachmentTarge;
|
|
311
|
+
var targets = (_this$attachmentTarge = this.attachmentTargets.get(testId)) !== null && _this$attachmentTarge !== void 0 ? _this$attachmentTarge : [];
|
|
312
|
+
targets.push(target);
|
|
313
|
+
this.attachmentTargets.set(testId, targets);
|
|
314
|
+
}
|
|
315
|
+
}, {
|
|
316
|
+
key: "getHookStepsStack",
|
|
317
|
+
value: function getHookStepsStack(testId, hookStep) {
|
|
318
|
+
return hookStep.hookScope === "before" ? this.beforeHooksStepsStack.get(testId) : this.afterHooksStepsStack.get(testId);
|
|
319
|
+
}
|
|
320
|
+
}, {
|
|
321
|
+
key: "removeHookAttachmentPlaceholder",
|
|
322
|
+
value: function removeHookAttachmentPlaceholder(steps, stepUuid) {
|
|
323
|
+
var index = steps.findIndex(function (step) {
|
|
324
|
+
return step.uuid === stepUuid;
|
|
325
|
+
});
|
|
326
|
+
if (index !== -1) {
|
|
327
|
+
steps.splice(index, 1);
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
var _iterator2 = _createForOfIteratorHelper(steps),
|
|
331
|
+
_step2;
|
|
332
|
+
try {
|
|
333
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
334
|
+
var step = _step2.value;
|
|
335
|
+
if (this.removeHookAttachmentPlaceholder(step.steps, stepUuid)) {
|
|
336
|
+
return true;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
} catch (err) {
|
|
340
|
+
_iterator2.e(err);
|
|
341
|
+
} finally {
|
|
342
|
+
_iterator2.f();
|
|
343
|
+
}
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
}, {
|
|
347
|
+
key: "addAttachmentToHookStep",
|
|
348
|
+
value: function addAttachmentToHookStep(test, hookStep, attachment) {
|
|
349
|
+
var targetStack = this.getHookStepsStack(test.id, hookStep);
|
|
350
|
+
if (!targetStack) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
var stepResult = targetStack.findStepByUuid(hookStep.uuid);
|
|
354
|
+
if (!stepResult) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
var fileName = targetStack.addAttachment(attachment, this.allureRuntime.writer);
|
|
358
|
+
stepResult.attachments.push({
|
|
359
|
+
name: attachment.name,
|
|
360
|
+
type: attachment.contentType,
|
|
361
|
+
source: fileName
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}, {
|
|
365
|
+
key: "addRuntimeAttachmentToHookStack",
|
|
366
|
+
value: function addRuntimeAttachmentToHookStack(targetStack, attachment, options) {
|
|
367
|
+
var _this2 = this;
|
|
368
|
+
var currentStep = targetStack.currentStep();
|
|
369
|
+
if (!currentStep) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
var addAttachment = function addAttachment(stepResult) {
|
|
373
|
+
var fileName = targetStack.addAttachment(attachment, _this2.allureRuntime.writer);
|
|
374
|
+
stepResult.attachments.push({
|
|
375
|
+
name: attachment.name,
|
|
376
|
+
type: attachment.contentType,
|
|
377
|
+
source: fileName
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
if (options !== null && options !== void 0 && options.wrapInStep) {
|
|
381
|
+
targetStack.startStep({
|
|
382
|
+
name: attachment.name,
|
|
383
|
+
start: options.timestamp
|
|
384
|
+
});
|
|
385
|
+
addAttachment(targetStack.currentStep());
|
|
386
|
+
targetStack.stopStep({
|
|
387
|
+
stop: options.timestamp
|
|
388
|
+
});
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
addAttachment(currentStep);
|
|
392
|
+
}
|
|
393
|
+
}, {
|
|
394
|
+
key: "processHookRuntimeMessage",
|
|
395
|
+
value: function processHookRuntimeMessage(test, testUuid, hookStep, attachment) {
|
|
396
|
+
if (!attachment.body) {
|
|
397
|
+
return false;
|
|
398
|
+
}
|
|
399
|
+
var targetStack = this.getHookStepsStack(test.id, hookStep);
|
|
400
|
+
if (!targetStack) {
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
this.removeHookAttachmentPlaceholder(targetStack.steps, hookStep.uuid);
|
|
404
|
+
var message = JSON.parse(attachment.body.toString());
|
|
405
|
+
switch (message.type) {
|
|
406
|
+
case "step_start":
|
|
407
|
+
targetStack.startStep(_objectSpread({}, message.data));
|
|
408
|
+
return true;
|
|
409
|
+
case "step_stop":
|
|
410
|
+
{
|
|
411
|
+
var currentStep = targetStack.currentStep();
|
|
412
|
+
if (!currentStep) {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
targetStack.updateStep(function (stepResult) {
|
|
416
|
+
if (message.data.status && !stepResult.status) {
|
|
417
|
+
stepResult.status = message.data.status;
|
|
418
|
+
}
|
|
419
|
+
if (message.data.statusDetails) {
|
|
420
|
+
stepResult.statusDetails = _objectSpread(_objectSpread({}, stepResult.statusDetails), message.data.statusDetails);
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
targetStack.stopStep({
|
|
424
|
+
stop: message.data.stop
|
|
425
|
+
});
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
case "step_metadata":
|
|
429
|
+
{
|
|
430
|
+
var _currentStep$paramete, _message$data$paramet;
|
|
431
|
+
var _currentStep = targetStack.currentStep();
|
|
432
|
+
if (!_currentStep) {
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
if (message.data.name) {
|
|
436
|
+
_currentStep.name = message.data.name;
|
|
437
|
+
}
|
|
438
|
+
(_currentStep$paramete = _currentStep.parameters).push.apply(_currentStep$paramete, _toConsumableArray((_message$data$paramet = message.data.parameters) !== null && _message$data$paramet !== void 0 ? _message$data$paramet : []));
|
|
439
|
+
return true;
|
|
440
|
+
}
|
|
441
|
+
case "attachment_content":
|
|
442
|
+
this.addRuntimeAttachmentToHookStack(targetStack, {
|
|
443
|
+
name: message.data.name,
|
|
444
|
+
body: Buffer.from(message.data.content, message.data.encoding),
|
|
445
|
+
contentType: message.data.contentType
|
|
446
|
+
}, {
|
|
447
|
+
wrapInStep: message.data.wrapInStep,
|
|
448
|
+
timestamp: message.data.timestamp
|
|
449
|
+
});
|
|
450
|
+
return true;
|
|
451
|
+
case "attachment_path":
|
|
452
|
+
this.addRuntimeAttachmentToHookStack(targetStack, {
|
|
453
|
+
name: message.data.name,
|
|
454
|
+
path: message.data.path,
|
|
455
|
+
contentType: message.data.contentType
|
|
456
|
+
}, {
|
|
457
|
+
wrapInStep: message.data.wrapInStep,
|
|
458
|
+
timestamp: message.data.timestamp
|
|
459
|
+
});
|
|
460
|
+
return true;
|
|
461
|
+
default:
|
|
462
|
+
this.queueAttachmentTask(test.id, this.processAttachment(testUuid, undefined, attachment));
|
|
463
|
+
return true;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}, {
|
|
467
|
+
key: "shouldProcessAttachmentAtTestEnd",
|
|
468
|
+
value: function shouldProcessAttachmentAtTestEnd(attachment) {
|
|
469
|
+
if (attachment.name.match(_utils.diffEndRegexp)) {
|
|
470
|
+
return true;
|
|
471
|
+
}
|
|
472
|
+
if (attachment.contentType === "application/vnd.allure.playwright-trace") {
|
|
473
|
+
return true;
|
|
474
|
+
}
|
|
475
|
+
return attachment.name === "trace" && attachment.contentType === "application/zip";
|
|
476
|
+
}
|
|
477
|
+
}, {
|
|
478
|
+
key: "processStepEndAttachments",
|
|
479
|
+
value: function processStepEndAttachments(test, step) {
|
|
480
|
+
var _step$attachments;
|
|
481
|
+
var testUuid = this.allureResultsUuids.get(test.id);
|
|
482
|
+
var stepAttachments = (_step$attachments = step.attachments) !== null && _step$attachments !== void 0 ? _step$attachments : [];
|
|
483
|
+
var stepInfo = this.attachmentTargetByStep.get(step);
|
|
484
|
+
var hasExplicitParent = Boolean((stepInfo === null || stepInfo === void 0 ? void 0 : stepInfo.hookStep) || (stepInfo === null || stepInfo === void 0 ? void 0 : stepInfo.stepUuid));
|
|
485
|
+
if (stepAttachments.length === 0) {
|
|
486
|
+
if (stepInfo) {
|
|
487
|
+
this.recordAttachmentTarget(test.id, stepInfo);
|
|
488
|
+
}
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
var _iterator3 = _createForOfIteratorHelper(stepAttachments),
|
|
492
|
+
_step3;
|
|
493
|
+
try {
|
|
494
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
495
|
+
var _stepInfo$hookStep$uu, _stepInfo$hookStep;
|
|
496
|
+
var attachment = _step3.value;
|
|
497
|
+
var isRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
|
|
498
|
+
var attachmentTarget = _objectSpread(_objectSpread({}, stepInfo), {}, {
|
|
499
|
+
name: attachment.name
|
|
500
|
+
});
|
|
501
|
+
this.recordAttachmentTarget(test.id, attachmentTarget);
|
|
502
|
+
if (this.shouldProcessAttachmentAtTestEnd(attachment) || !isRuntimeMessage && !hasExplicitParent) {
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
attachmentTarget.processedAtStepEnd = true;
|
|
506
|
+
if (stepInfo !== null && stepInfo !== void 0 && stepInfo.hookStep && isRuntimeMessage) {
|
|
507
|
+
if (!this.processHookRuntimeMessage(test, testUuid, stepInfo.hookStep, attachment)) {
|
|
508
|
+
attachmentTarget.processedAtStepEnd = false;
|
|
509
|
+
}
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
if (stepInfo !== null && stepInfo !== void 0 && stepInfo.hookStep) {
|
|
513
|
+
this.addAttachmentToHookStep(test, stepInfo.hookStep, attachment);
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
var attachmentStepUuid = (_stepInfo$hookStep$uu = stepInfo === null || stepInfo === void 0 || (_stepInfo$hookStep = stepInfo.hookStep) === null || _stepInfo$hookStep === void 0 ? void 0 : _stepInfo$hookStep.uuid) !== null && _stepInfo$hookStep$uu !== void 0 ? _stepInfo$hookStep$uu : stepInfo === null || stepInfo === void 0 ? void 0 : stepInfo.stepUuid;
|
|
517
|
+
this.queueAttachmentTask(test.id, this.processAttachment(testUuid, attachmentStepUuid, attachment));
|
|
518
|
+
}
|
|
519
|
+
} catch (err) {
|
|
520
|
+
_iterator3.e(err);
|
|
521
|
+
} finally {
|
|
522
|
+
_iterator3.f();
|
|
523
|
+
}
|
|
524
|
+
}
|
|
272
525
|
}, {
|
|
273
526
|
key: "onStepBegin",
|
|
274
527
|
value: function onStepBegin(test, _result, step) {
|
|
@@ -290,67 +543,49 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
290
543
|
uuid: (0, _reporter.randomUuid)()
|
|
291
544
|
});
|
|
292
545
|
if (["test.attach", "attach"].includes(step.category) && !isHookStep) {
|
|
293
|
-
var _this$pwStepUuid$get
|
|
546
|
+
var _this$pwStepUuid$get;
|
|
294
547
|
var parent = step.parent ? (_this$pwStepUuid$get = this.pwStepUuid.get(step.parent)) !== null && _this$pwStepUuid$get !== void 0 ? _this$pwStepUuid$get : null : null;
|
|
295
|
-
|
|
296
|
-
targets.push({
|
|
548
|
+
this.attachmentTargetByStep.set(step, {
|
|
297
549
|
name: (0, _utils.normalizeAttachStepTitle)(step.title),
|
|
298
550
|
stepUuid: parent !== null && parent !== void 0 ? parent : undefined
|
|
299
551
|
});
|
|
300
|
-
this.attachmentTargets.set(test.id, targets);
|
|
301
552
|
return;
|
|
302
553
|
}
|
|
303
554
|
if (isHookStep) {
|
|
304
|
-
// Lazily initialize the hook stack if it doesn't exist (e.g., when detail: false and root hook was ignored)
|
|
305
|
-
var stack = isBeforeHookDescendant ? this.beforeHooksStepsStack.get(test.id) : this.afterHooksStepsStack.get(test.id);
|
|
306
|
-
if (!stack) {
|
|
307
|
-
stack = new _reporter.ShallowStepsStack();
|
|
308
|
-
var rootHookStep = _objectSpread(_objectSpread({}, (0, _reporter.createStepResult)()), {}, {
|
|
309
|
-
name: isBeforeHookDescendant ? _utils.BEFORE_HOOKS_ROOT_STEP_TITLE : _utils.AFTER_HOOKS_ROOT_STEP_TITLE,
|
|
310
|
-
start: step.startTime.getTime(),
|
|
311
|
-
stage: _allureJsCommons.Stage.RUNNING,
|
|
312
|
-
uuid: (0, _reporter.randomUuid)()
|
|
313
|
-
});
|
|
314
|
-
stack.startStep(rootHookStep);
|
|
315
|
-
if (isBeforeHookDescendant) {
|
|
316
|
-
this.beforeHooksStepsStack.set(test.id, stack);
|
|
317
|
-
} else {
|
|
318
|
-
this.afterHooksStepsStack.set(test.id, stack);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
555
|
if (["test.attach", "attach"].includes(step.category)) {
|
|
322
|
-
var
|
|
556
|
+
var _stack$currentStep;
|
|
557
|
+
var attachmentName = (0, _utils.normalizeAttachStepTitle)(step.title);
|
|
558
|
+
var _stack = _assertClassBrand(_AllureReporter_brand, this, _getOrCreateHookStack).call(this, test.id, isBeforeHookDescendant, step.startTime);
|
|
323
559
|
var hookStepWithUuid;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
var _attachStack$get;
|
|
560
|
+
var parentHookStepUuid = (_stack$currentStep = _stack.currentStep()) === null || _stack$currentStep === void 0 ? void 0 : _stack$currentStep.uuid;
|
|
561
|
+
_stack.startStep(baseStep);
|
|
562
|
+
_stack.updateStep(function (stepResult) {
|
|
328
563
|
hookStepWithUuid = _objectSpread(_objectSpread({}, step), {}, {
|
|
329
|
-
uuid: stepResult.uuid
|
|
564
|
+
uuid: stepResult.uuid,
|
|
565
|
+
hookScope: isBeforeHookDescendant ? "before" : "after"
|
|
330
566
|
});
|
|
331
567
|
stepResult.name = (0, _utils.normalizeHookTitle)(stepResult.name);
|
|
332
568
|
stepResult.stage = _allureJsCommons.Stage.FINISHED;
|
|
333
|
-
attachStack.set(test.id, [].concat(_toConsumableArray((_attachStack$get = attachStack.get(test.id)) !== null && _attachStack$get !== void 0 ? _attachStack$get : []), [hookStepWithUuid]));
|
|
334
569
|
});
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
570
|
+
_stack.stopStep();
|
|
571
|
+
this.attachmentTargetByStep.set(step, {
|
|
572
|
+
name: attachmentName,
|
|
573
|
+
hookStep: hookStepWithUuid,
|
|
574
|
+
stepUuid: attachmentName === "Allure Step Metadata" ? parentHookStepUuid : undefined
|
|
340
575
|
});
|
|
341
|
-
this.attachmentTargets.set(test.id, _targets);
|
|
342
576
|
return;
|
|
343
577
|
}
|
|
578
|
+
var stack = _assertClassBrand(_AllureReporter_brand, this, _getOrCreateHookStack).call(this, test.id, isBeforeHookDescendant, step.startTime);
|
|
344
579
|
stack.startStep(baseStep);
|
|
345
580
|
return;
|
|
346
581
|
}
|
|
347
582
|
if (isRootHook) {
|
|
348
|
-
var
|
|
349
|
-
|
|
583
|
+
var _stack2 = new _reporter.ShallowStepsStack();
|
|
584
|
+
_stack2.startStep(baseStep);
|
|
350
585
|
if (isRootBeforeHook) {
|
|
351
|
-
this.beforeHooksStepsStack.set(test.id,
|
|
586
|
+
this.beforeHooksStepsStack.set(test.id, _stack2);
|
|
352
587
|
} else {
|
|
353
|
-
this.afterHooksStepsStack.set(test.id,
|
|
588
|
+
this.afterHooksStepsStack.set(test.id, _stack2);
|
|
354
589
|
}
|
|
355
590
|
return;
|
|
356
591
|
}
|
|
@@ -385,8 +620,8 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
385
620
|
if (_assertClassBrand(_AllureReporter_brand, this, _shouldIgnoreStep).call(this, step)) {
|
|
386
621
|
return;
|
|
387
622
|
}
|
|
388
|
-
// ignore test.attach steps since attachments are already in the report
|
|
389
623
|
if (["test.attach", "attach"].includes(step.category)) {
|
|
624
|
+
this.processStepEndAttachments(test, step);
|
|
390
625
|
return;
|
|
391
626
|
}
|
|
392
627
|
var testUuid = this.allureResultsUuids.get(test.id);
|
|
@@ -395,16 +630,16 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
395
630
|
var isAfterHook = isAfterHookDescendant;
|
|
396
631
|
var isHook = isBeforeHookDescendant || isAfterHookDescendant;
|
|
397
632
|
if (isHook) {
|
|
398
|
-
var
|
|
633
|
+
var _stack3 = isAfterHook ? this.afterHooksStepsStack.get(test.id) : this.beforeHooksStepsStack.get(test.id);
|
|
399
634
|
|
|
400
635
|
// Stack might not exist if root hook was ignored (e.g., detail: false) and no test.step was called inside it
|
|
401
|
-
if (!
|
|
636
|
+
if (!_stack3) {
|
|
402
637
|
return;
|
|
403
638
|
}
|
|
404
|
-
|
|
639
|
+
_stack3.updateStep(function (stepResult) {
|
|
405
640
|
return (0, _utils.finalizeStepResult)(stepResult, step);
|
|
406
641
|
});
|
|
407
|
-
|
|
642
|
+
_stack3.stopStep({
|
|
408
643
|
duration: step.duration
|
|
409
644
|
});
|
|
410
645
|
return;
|
|
@@ -427,13 +662,12 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
427
662
|
}, {
|
|
428
663
|
key: "onTestEnd",
|
|
429
664
|
value: function () {
|
|
430
|
-
var _onTestEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
431
|
-
var
|
|
432
|
-
_this$
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
while (1) switch (_context.n) {
|
|
665
|
+
var _onTestEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(test, result) {
|
|
666
|
+
var _this3 = this,
|
|
667
|
+
_this$attachmentTarge2;
|
|
668
|
+
var testUuid, threadId, thread, error, _test$parent$titlePat, _test$parent$titlePat2, projectSuiteTitle, fileSuiteTitle, suiteTitles, beforeHooksStack, afterHooksStack, targets, targetsByName, _iterator4, _step4, _targetsByName$get, t, q, takeByName, _iterator5, _step5, attachment, isRuntimeMessage, stepInfo, _stepInfo$hookStep$uu2, _stepInfo$hookStep2, message, targetStack, _targetStack, stepUuid, _targetStack2, stepResult, fileName, _t;
|
|
669
|
+
return _regenerator().w(function (_context2) {
|
|
670
|
+
while (1) switch (_context2.n) {
|
|
437
671
|
case 0:
|
|
438
672
|
testUuid = this.allureResultsUuids.get(test.id); // We need to check parallelIndex first because pw introduced this field only in v1.30.0
|
|
439
673
|
threadId = result.parallelIndex !== undefined ? result.parallelIndex : result.workerIndex;
|
|
@@ -451,7 +685,7 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
451
685
|
value: projectSuiteTitle
|
|
452
686
|
});
|
|
453
687
|
}
|
|
454
|
-
if (
|
|
688
|
+
if (_this3.options.suiteTitle && fileSuiteTitle && !(0, _sdk.hasLabel)(testResult, _allureJsCommons.LabelName.SUITE)) {
|
|
455
689
|
testResult.labels.push({
|
|
456
690
|
name: _allureJsCommons.LabelName.SUITE,
|
|
457
691
|
value: fileSuiteTitle
|
|
@@ -489,21 +723,22 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
489
723
|
contentType: _allureJsCommons.ContentType.TEXT
|
|
490
724
|
});
|
|
491
725
|
}
|
|
492
|
-
|
|
493
|
-
|
|
726
|
+
|
|
727
|
+
// FIFO
|
|
728
|
+
targets = (_this$attachmentTarge2 = this.attachmentTargets.get(test.id)) !== null && _this$attachmentTarge2 !== void 0 ? _this$attachmentTarge2 : [];
|
|
494
729
|
targetsByName = new Map();
|
|
495
|
-
|
|
730
|
+
_iterator4 = _createForOfIteratorHelper(targets);
|
|
496
731
|
try {
|
|
497
|
-
for (
|
|
498
|
-
t =
|
|
732
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
733
|
+
t = _step4.value;
|
|
499
734
|
q = (_targetsByName$get = targetsByName.get(t.name)) !== null && _targetsByName$get !== void 0 ? _targetsByName$get : [];
|
|
500
735
|
q.push(t);
|
|
501
736
|
targetsByName.set(t.name, q);
|
|
502
737
|
}
|
|
503
738
|
} catch (err) {
|
|
504
|
-
|
|
739
|
+
_iterator4.e(err);
|
|
505
740
|
} finally {
|
|
506
|
-
|
|
741
|
+
_iterator4.f();
|
|
507
742
|
}
|
|
508
743
|
takeByName = function takeByName(name) {
|
|
509
744
|
var target = targetsByName.get(name);
|
|
@@ -512,38 +747,59 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
512
747
|
}
|
|
513
748
|
return target.shift();
|
|
514
749
|
};
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
750
|
+
_iterator5 = _createForOfIteratorHelper(result.attachments);
|
|
751
|
+
_context2.p = 1;
|
|
752
|
+
_iterator5.s();
|
|
518
753
|
case 2:
|
|
519
|
-
if ((
|
|
520
|
-
|
|
754
|
+
if ((_step5 = _iterator5.n()).done) {
|
|
755
|
+
_context2.n = 11;
|
|
521
756
|
break;
|
|
522
757
|
}
|
|
523
|
-
attachment =
|
|
758
|
+
attachment = _step5.value;
|
|
524
759
|
isRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
|
|
525
760
|
stepInfo = takeByName(attachment.name);
|
|
526
|
-
if (!
|
|
527
|
-
|
|
761
|
+
if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.processedAtStepEnd)) {
|
|
762
|
+
_context2.n = 3;
|
|
528
763
|
break;
|
|
529
764
|
}
|
|
530
|
-
|
|
531
|
-
_context.n = 3;
|
|
532
|
-
return this.processAttachment(testUuid, stepUuid, attachment);
|
|
765
|
+
return _context2.a(3, 10);
|
|
533
766
|
case 3:
|
|
534
|
-
|
|
767
|
+
if (!isRuntimeMessage) {
|
|
768
|
+
_context2.n = 6;
|
|
769
|
+
break;
|
|
770
|
+
}
|
|
771
|
+
message = attachment.body ? JSON.parse(attachment.body.toString()) : undefined;
|
|
772
|
+
if (stepInfo !== null && stepInfo !== void 0 && stepInfo.hookStep) {
|
|
773
|
+
targetStack = this.getHookStepsStack(test.id, stepInfo.hookStep);
|
|
774
|
+
this.removeStepFromHookStack(targetStack, stepInfo.hookStep.uuid);
|
|
775
|
+
}
|
|
776
|
+
if (!((message === null || message === void 0 ? void 0 : message.type) === "step_metadata" && stepInfo !== null && stepInfo !== void 0 && stepInfo.stepUuid)) {
|
|
777
|
+
_context2.n = 4;
|
|
778
|
+
break;
|
|
779
|
+
}
|
|
780
|
+
if (stepInfo.hookStep) {
|
|
781
|
+
_targetStack = this.getHookStepsStack(test.id, stepInfo.hookStep);
|
|
782
|
+
this.processHookStepMetadataMessage(_targetStack, stepInfo.stepUuid, message);
|
|
783
|
+
} else {
|
|
784
|
+
this.processStepMetadataMessage(stepInfo.stepUuid, message);
|
|
785
|
+
}
|
|
786
|
+
return _context2.a(3, 10);
|
|
535
787
|
case 4:
|
|
788
|
+
stepUuid = (_stepInfo$hookStep$uu2 = stepInfo === null || stepInfo === void 0 || (_stepInfo$hookStep2 = stepInfo.hookStep) === null || _stepInfo$hookStep2 === void 0 ? void 0 : _stepInfo$hookStep2.uuid) !== null && _stepInfo$hookStep$uu2 !== void 0 ? _stepInfo$hookStep$uu2 : stepInfo === null || stepInfo === void 0 ? void 0 : stepInfo.stepUuid;
|
|
789
|
+
_context2.n = 5;
|
|
790
|
+
return this.processAttachment(testUuid, stepUuid, attachment);
|
|
791
|
+
case 5:
|
|
792
|
+
return _context2.a(3, 10);
|
|
793
|
+
case 6:
|
|
536
794
|
if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.hookStep)) {
|
|
537
|
-
|
|
795
|
+
_context2.n = 7;
|
|
538
796
|
break;
|
|
539
797
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
if (targetStack) {
|
|
544
|
-
stepResult = targetStack.findStepByUuid(hookStep.uuid);
|
|
798
|
+
_targetStack2 = this.getHookStepsStack(test.id, stepInfo.hookStep);
|
|
799
|
+
if (_targetStack2) {
|
|
800
|
+
stepResult = _targetStack2.findStepByUuid(stepInfo.hookStep.uuid);
|
|
545
801
|
if (stepResult) {
|
|
546
|
-
fileName =
|
|
802
|
+
fileName = _targetStack2.addAttachment(attachment, this.allureRuntime.writer);
|
|
547
803
|
stepResult.attachments.push({
|
|
548
804
|
name: attachment.name,
|
|
549
805
|
type: attachment.contentType,
|
|
@@ -551,34 +807,37 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
551
807
|
});
|
|
552
808
|
}
|
|
553
809
|
}
|
|
554
|
-
return
|
|
555
|
-
case
|
|
810
|
+
return _context2.a(3, 10);
|
|
811
|
+
case 7:
|
|
556
812
|
if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.stepUuid)) {
|
|
557
|
-
|
|
813
|
+
_context2.n = 9;
|
|
558
814
|
break;
|
|
559
815
|
}
|
|
560
|
-
|
|
816
|
+
_context2.n = 8;
|
|
561
817
|
return this.processAttachment(testUuid, stepInfo.stepUuid, attachment);
|
|
562
|
-
case 6:
|
|
563
|
-
return _context.a(3, 8);
|
|
564
|
-
case 7:
|
|
565
|
-
_context.n = 8;
|
|
566
|
-
return this.processAttachment(testUuid, undefined, attachment);
|
|
567
818
|
case 8:
|
|
568
|
-
|
|
569
|
-
break;
|
|
819
|
+
return _context2.a(3, 10);
|
|
570
820
|
case 9:
|
|
571
|
-
|
|
572
|
-
|
|
821
|
+
_context2.n = 10;
|
|
822
|
+
return this.processAttachment(testUuid, undefined, attachment);
|
|
573
823
|
case 10:
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
_iterator3.e(_t);
|
|
824
|
+
_context2.n = 2;
|
|
825
|
+
break;
|
|
577
826
|
case 11:
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
return _context.f(11);
|
|
827
|
+
_context2.n = 13;
|
|
828
|
+
break;
|
|
581
829
|
case 12:
|
|
830
|
+
_context2.p = 12;
|
|
831
|
+
_t = _context2.v;
|
|
832
|
+
_iterator5.e(_t);
|
|
833
|
+
case 13:
|
|
834
|
+
_context2.p = 13;
|
|
835
|
+
_iterator5.f();
|
|
836
|
+
return _context2.f(13);
|
|
837
|
+
case 14:
|
|
838
|
+
_context2.n = 15;
|
|
839
|
+
return this.flushAttachmentTasks(test.id);
|
|
840
|
+
case 15:
|
|
582
841
|
// FIXME: temp logic for labels override, we need it here to keep the reporter compatible with v2 API
|
|
583
842
|
// in next iterations we need to implement the logic for every javascript integration
|
|
584
843
|
this.allureRuntime.updateTest(testUuid, function (testResult) {
|
|
@@ -598,14 +857,14 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
598
857
|
});
|
|
599
858
|
if (beforeHooksStack) {
|
|
600
859
|
var _testResult$steps;
|
|
601
|
-
(_testResult$steps = testResult.steps).unshift.apply(_testResult$steps, _toConsumableArray(beforeHooksStack.steps));
|
|
602
|
-
_this2.beforeHooksStepsStack["delete"](test.id);
|
|
860
|
+
(_testResult$steps = testResult.steps).unshift.apply(_testResult$steps, _toConsumableArray(_this3.pruneEmptyHookRoots(beforeHooksStack.steps)));
|
|
603
861
|
}
|
|
862
|
+
_this3.beforeHooksStepsStack["delete"](test.id);
|
|
604
863
|
if (afterHooksStack) {
|
|
605
864
|
var _testResult$steps2;
|
|
606
|
-
(_testResult$steps2 = testResult.steps).push.apply(_testResult$steps2, _toConsumableArray(afterHooksStack.steps));
|
|
607
|
-
_this2.afterHooksStepsStack["delete"](test.id);
|
|
865
|
+
(_testResult$steps2 = testResult.steps).push.apply(_testResult$steps2, _toConsumableArray(_this3.pruneEmptyHookRoots(afterHooksStack.steps)));
|
|
608
866
|
}
|
|
867
|
+
_this3.afterHooksStepsStack["delete"](test.id);
|
|
609
868
|
testResult.labels = newLabels;
|
|
610
869
|
});
|
|
611
870
|
this.allureRuntime.stopTest(testUuid, {
|
|
@@ -613,12 +872,13 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
613
872
|
});
|
|
614
873
|
this.allureRuntime.writeTest(testUuid);
|
|
615
874
|
this.attachmentTargets["delete"](test.id);
|
|
616
|
-
|
|
617
|
-
|
|
875
|
+
this.pendingAttachmentTasks["delete"](test.id);
|
|
876
|
+
case 16:
|
|
877
|
+
return _context2.a(2);
|
|
618
878
|
}
|
|
619
|
-
},
|
|
879
|
+
}, _callee2, this, [[1, 12, 13, 14]]);
|
|
620
880
|
}));
|
|
621
|
-
function onTestEnd(
|
|
881
|
+
function onTestEnd(_x2, _x3) {
|
|
622
882
|
return _onTestEnd.apply(this, arguments);
|
|
623
883
|
}
|
|
624
884
|
return onTestEnd;
|
|
@@ -626,28 +886,28 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
626
886
|
}, {
|
|
627
887
|
key: "addSkippedResults",
|
|
628
888
|
value: function () {
|
|
629
|
-
var _addSkippedResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
630
|
-
var
|
|
631
|
-
var unprocessedCases,
|
|
632
|
-
return _regenerator().w(function (
|
|
633
|
-
while (1) switch (
|
|
889
|
+
var _addSkippedResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
890
|
+
var _this4 = this;
|
|
891
|
+
var unprocessedCases, _iterator6, _step6, testCase, _t2;
|
|
892
|
+
return _regenerator().w(function (_context3) {
|
|
893
|
+
while (1) switch (_context3.n) {
|
|
634
894
|
case 0:
|
|
635
895
|
unprocessedCases = this.suite.allTests().filter(function (_ref2) {
|
|
636
896
|
var title = _ref2.title;
|
|
637
897
|
var titleMetadata = (0, _sdk.extractMetadataFromString)(title);
|
|
638
|
-
return !
|
|
898
|
+
return !_this4.startedTestCasesTitlesCache.includes(titleMetadata.cleanTitle);
|
|
639
899
|
});
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
900
|
+
_iterator6 = _createForOfIteratorHelper(unprocessedCases);
|
|
901
|
+
_context3.p = 1;
|
|
902
|
+
_iterator6.s();
|
|
643
903
|
case 2:
|
|
644
|
-
if ((
|
|
645
|
-
|
|
904
|
+
if ((_step6 = _iterator6.n()).done) {
|
|
905
|
+
_context3.n = 4;
|
|
646
906
|
break;
|
|
647
907
|
}
|
|
648
|
-
testCase =
|
|
908
|
+
testCase = _step6.value;
|
|
649
909
|
this.onTestBegin(testCase);
|
|
650
|
-
|
|
910
|
+
_context3.n = 3;
|
|
651
911
|
return this.onTestEnd(testCase, {
|
|
652
912
|
status: _allureJsCommons.Status.SKIPPED,
|
|
653
913
|
attachments: [],
|
|
@@ -663,23 +923,23 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
663
923
|
annotations: []
|
|
664
924
|
});
|
|
665
925
|
case 3:
|
|
666
|
-
|
|
926
|
+
_context3.n = 2;
|
|
667
927
|
break;
|
|
668
928
|
case 4:
|
|
669
|
-
|
|
929
|
+
_context3.n = 6;
|
|
670
930
|
break;
|
|
671
931
|
case 5:
|
|
672
|
-
|
|
673
|
-
_t2 =
|
|
674
|
-
|
|
932
|
+
_context3.p = 5;
|
|
933
|
+
_t2 = _context3.v;
|
|
934
|
+
_iterator6.e(_t2);
|
|
675
935
|
case 6:
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
return
|
|
936
|
+
_context3.p = 6;
|
|
937
|
+
_iterator6.f();
|
|
938
|
+
return _context3.f(6);
|
|
679
939
|
case 7:
|
|
680
|
-
return
|
|
940
|
+
return _context3.a(2);
|
|
681
941
|
}
|
|
682
|
-
},
|
|
942
|
+
}, _callee3, this, [[1, 5, 6, 7]]);
|
|
683
943
|
}));
|
|
684
944
|
function addSkippedResults() {
|
|
685
945
|
return _addSkippedResults.apply(this, arguments);
|
|
@@ -689,19 +949,19 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
689
949
|
}, {
|
|
690
950
|
key: "onEnd",
|
|
691
951
|
value: function () {
|
|
692
|
-
var _onEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
693
|
-
return _regenerator().w(function (
|
|
694
|
-
while (1) switch (
|
|
952
|
+
var _onEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
953
|
+
return _regenerator().w(function (_context4) {
|
|
954
|
+
while (1) switch (_context4.n) {
|
|
695
955
|
case 0:
|
|
696
|
-
|
|
956
|
+
_context4.n = 1;
|
|
697
957
|
return this.addSkippedResults();
|
|
698
958
|
case 1:
|
|
699
959
|
this.allureRuntime.writeEnvironmentInfo();
|
|
700
960
|
this.allureRuntime.writeCategoriesDefinitions();
|
|
701
961
|
case 2:
|
|
702
|
-
return
|
|
962
|
+
return _context4.a(2);
|
|
703
963
|
}
|
|
704
|
-
},
|
|
964
|
+
}, _callee4, this);
|
|
705
965
|
}));
|
|
706
966
|
function onEnd() {
|
|
707
967
|
return _onEnd.apply(this, arguments);
|
|
@@ -713,6 +973,46 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
713
973
|
value: function printsToStdio() {
|
|
714
974
|
return false;
|
|
715
975
|
}
|
|
976
|
+
}, {
|
|
977
|
+
key: "isEmptyPassedHookRoot",
|
|
978
|
+
value: function isEmptyPassedHookRoot(step) {
|
|
979
|
+
if (this.options.detail) {
|
|
980
|
+
return false;
|
|
981
|
+
}
|
|
982
|
+
return (step.name === _utils.BEFORE_HOOKS_ROOT_STEP_TITLE || step.name === _utils.AFTER_HOOKS_ROOT_STEP_TITLE) && step.steps.length === 0 && step.attachments.length === 0 && step.status === _allureJsCommons.Status.PASSED;
|
|
983
|
+
}
|
|
984
|
+
}, {
|
|
985
|
+
key: "pruneEmptyHookRoots",
|
|
986
|
+
value: function pruneEmptyHookRoots(steps) {
|
|
987
|
+
var _this5 = this;
|
|
988
|
+
return steps.map(function (step) {
|
|
989
|
+
return _objectSpread(_objectSpread({}, step), {}, {
|
|
990
|
+
steps: _this5.pruneEmptyHookRoots(step.steps)
|
|
991
|
+
});
|
|
992
|
+
}).filter(function (step) {
|
|
993
|
+
return !_this5.isEmptyPassedHookRoot(step);
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
}, {
|
|
997
|
+
key: "removeStepFromHookStack",
|
|
998
|
+
value: function removeStepFromHookStack(stack, stepUuid) {
|
|
999
|
+
var _this6 = this;
|
|
1000
|
+
if (!stack) {
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
var _removeRecursively = function removeRecursively(steps) {
|
|
1004
|
+
return steps.filter(function (step) {
|
|
1005
|
+
return step.uuid !== stepUuid;
|
|
1006
|
+
}).map(function (step) {
|
|
1007
|
+
return _objectSpread(_objectSpread({}, step), {}, {
|
|
1008
|
+
steps: _removeRecursively(step.steps)
|
|
1009
|
+
});
|
|
1010
|
+
}).filter(function (step) {
|
|
1011
|
+
return !_this6.isEmptyPassedHookRoot(step);
|
|
1012
|
+
});
|
|
1013
|
+
};
|
|
1014
|
+
stack.steps = _removeRecursively(stack.steps);
|
|
1015
|
+
}
|
|
716
1016
|
}, {
|
|
717
1017
|
key: "getStaticTestMetadata",
|
|
718
1018
|
value: function getStaticTestMetadata(test) {
|
|
@@ -742,11 +1042,11 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
742
1042
|
|
|
743
1043
|
// Test-plan matching happens during discovery, so runtime API labels are intentionally excluded here.
|
|
744
1044
|
if (!staticAllureId && "annotations" in test) {
|
|
745
|
-
var
|
|
746
|
-
|
|
1045
|
+
var _iterator7 = _createForOfIteratorHelper(test.annotations),
|
|
1046
|
+
_step7;
|
|
747
1047
|
try {
|
|
748
|
-
for (
|
|
749
|
-
var annotation =
|
|
1048
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1049
|
+
var annotation = _step7.value;
|
|
750
1050
|
var label = (0, _sdk.getMetadataLabel)(annotation.type, annotation.description);
|
|
751
1051
|
if ((label === null || label === void 0 ? void 0 : label.name) === _allureJsCommons.LabelName.ALLURE_ID) {
|
|
752
1052
|
staticAllureId = label.value;
|
|
@@ -754,9 +1054,9 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
754
1054
|
}
|
|
755
1055
|
}
|
|
756
1056
|
} catch (err) {
|
|
757
|
-
|
|
1057
|
+
_iterator7.e(err);
|
|
758
1058
|
} finally {
|
|
759
|
-
|
|
1059
|
+
_iterator7.f();
|
|
760
1060
|
}
|
|
761
1061
|
}
|
|
762
1062
|
return {
|
|
@@ -794,8 +1094,8 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
794
1094
|
value: function processStepMetadataMessage(attachmentStepUuid, message) {
|
|
795
1095
|
var _message$data = message.data,
|
|
796
1096
|
name = _message$data.name,
|
|
797
|
-
_message$data$
|
|
798
|
-
parameters = _message$data$
|
|
1097
|
+
_message$data$paramet2 = _message$data.parameters,
|
|
1098
|
+
parameters = _message$data$paramet2 === void 0 ? [] : _message$data$paramet2;
|
|
799
1099
|
this.allureRuntime.updateStep(attachmentStepUuid, function (step) {
|
|
800
1100
|
var _step$parameters;
|
|
801
1101
|
if (name) {
|
|
@@ -804,43 +1104,53 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
804
1104
|
(_step$parameters = step.parameters).push.apply(_step$parameters, _toConsumableArray(parameters));
|
|
805
1105
|
});
|
|
806
1106
|
}
|
|
1107
|
+
}, {
|
|
1108
|
+
key: "processHookStepMetadataMessage",
|
|
1109
|
+
value: function processHookStepMetadataMessage(stack, attachmentStepUuid, message) {
|
|
1110
|
+
var _step$parameters2;
|
|
1111
|
+
var step = stack === null || stack === void 0 ? void 0 : stack.findStepByUuid(attachmentStepUuid);
|
|
1112
|
+
if (!step) {
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
var _message$data2 = message.data,
|
|
1116
|
+
name = _message$data2.name,
|
|
1117
|
+
_message$data2$parame = _message$data2.parameters,
|
|
1118
|
+
parameters = _message$data2$parame === void 0 ? [] : _message$data2$parame;
|
|
1119
|
+
if (name) {
|
|
1120
|
+
step.name = name;
|
|
1121
|
+
}
|
|
1122
|
+
(_step$parameters2 = step.parameters).push.apply(_step$parameters2, _toConsumableArray(parameters));
|
|
1123
|
+
}
|
|
807
1124
|
}, {
|
|
808
1125
|
key: "processAttachment",
|
|
809
1126
|
value: function () {
|
|
810
|
-
var _processAttachment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1127
|
+
var _processAttachment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(testUuid, attachmentStepUuid, attachment) {
|
|
811
1128
|
var _replace;
|
|
812
1129
|
var allureRuntimeMessage, message, parentUuid, contentType, pathWithoutEndFromSnapshotDir, pathWithoutEnd, fileExists, readImageFromDirs, actualBase64, expectedBase64, diffBase64, diffName;
|
|
813
|
-
return _regenerator().w(function (
|
|
814
|
-
while (1) switch (
|
|
1130
|
+
return _regenerator().w(function (_context7) {
|
|
1131
|
+
while (1) switch (_context7.n) {
|
|
815
1132
|
case 0:
|
|
816
1133
|
if (!(!attachment.body && !attachment.path)) {
|
|
817
|
-
|
|
1134
|
+
_context7.n = 1;
|
|
818
1135
|
break;
|
|
819
1136
|
}
|
|
820
|
-
return
|
|
1137
|
+
return _context7.a(2);
|
|
821
1138
|
case 1:
|
|
822
1139
|
allureRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
|
|
823
1140
|
if (!(allureRuntimeMessage && !attachment.body)) {
|
|
824
|
-
|
|
1141
|
+
_context7.n = 2;
|
|
825
1142
|
break;
|
|
826
1143
|
}
|
|
827
|
-
return
|
|
1144
|
+
return _context7.a(2);
|
|
828
1145
|
case 2:
|
|
829
1146
|
if (!allureRuntimeMessage) {
|
|
830
|
-
|
|
1147
|
+
_context7.n = 3;
|
|
831
1148
|
break;
|
|
832
1149
|
}
|
|
833
1150
|
message = JSON.parse(attachment.body.toString());
|
|
834
|
-
if (!(message.type === "step_metadata")) {
|
|
835
|
-
_context6.n = 3;
|
|
836
|
-
break;
|
|
837
|
-
}
|
|
838
|
-
this.processStepMetadataMessage(attachmentStepUuid, message);
|
|
839
|
-
return _context6.a(2);
|
|
840
|
-
case 3:
|
|
841
1151
|
this.allureRuntime.applyRuntimeMessages(testUuid, [message]);
|
|
842
|
-
return
|
|
843
|
-
case
|
|
1152
|
+
return _context7.a(2);
|
|
1153
|
+
case 3:
|
|
844
1154
|
parentUuid = this.allureRuntime.startStep(testUuid, attachmentStepUuid, {
|
|
845
1155
|
name: attachment.name
|
|
846
1156
|
}); // only stop if step is created. Step may not be created only if test with specified uuid doesn't exists.
|
|
@@ -850,112 +1160,112 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
850
1160
|
this.allureRuntime.stopStep(parentUuid, undefined);
|
|
851
1161
|
}
|
|
852
1162
|
if (!attachment.body) {
|
|
853
|
-
|
|
1163
|
+
_context7.n = 4;
|
|
854
1164
|
break;
|
|
855
1165
|
}
|
|
856
1166
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.body, {
|
|
857
1167
|
contentType: attachment.contentType
|
|
858
1168
|
});
|
|
859
|
-
|
|
1169
|
+
_context7.n = 6;
|
|
860
1170
|
break;
|
|
861
|
-
case
|
|
1171
|
+
case 4:
|
|
862
1172
|
if ((0, _nodeFs.existsSync)(attachment.path)) {
|
|
863
|
-
|
|
1173
|
+
_context7.n = 5;
|
|
864
1174
|
break;
|
|
865
1175
|
}
|
|
866
|
-
return
|
|
867
|
-
case
|
|
868
|
-
contentType = attachment.name === "trace" && attachment.contentType === "application/zip" ?
|
|
1176
|
+
return _context7.a(2);
|
|
1177
|
+
case 5:
|
|
1178
|
+
contentType = attachment.name === "trace" && attachment.contentType === "application/zip" ? _allureJsCommons.ContentType.PLAYWRIGHT_TRACE : attachment.contentType;
|
|
869
1179
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.path, {
|
|
870
1180
|
contentType: contentType
|
|
871
1181
|
});
|
|
872
|
-
case
|
|
1182
|
+
case 6:
|
|
873
1183
|
if (attachment.name.match(_utils.diffEndRegexp)) {
|
|
874
|
-
|
|
1184
|
+
_context7.n = 7;
|
|
875
1185
|
break;
|
|
876
1186
|
}
|
|
877
|
-
return
|
|
878
|
-
case
|
|
1187
|
+
return _context7.a(2);
|
|
1188
|
+
case 7:
|
|
879
1189
|
pathWithoutEndFromSnapshotDir = (_replace = attachment.path.replace(this.outputDir, this.snapshotDir)) === null || _replace === void 0 ? void 0 : _replace.replace(_utils.diffEndRegexp, "").replace(/\.png/, "");
|
|
880
1190
|
pathWithoutEnd = attachment.path.replace(_utils.diffEndRegexp, "").replace(/\.png/, "");
|
|
881
1191
|
if (!(this.processedDiffs.includes(pathWithoutEnd) || this.processedDiffs.includes(pathWithoutEndFromSnapshotDir))) {
|
|
882
|
-
|
|
1192
|
+
_context7.n = 8;
|
|
883
1193
|
break;
|
|
884
1194
|
}
|
|
885
|
-
return
|
|
886
|
-
case
|
|
1195
|
+
return _context7.a(2);
|
|
1196
|
+
case 8:
|
|
887
1197
|
fileExists = /*#__PURE__*/function () {
|
|
888
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
889
|
-
return _regenerator().w(function (
|
|
890
|
-
while (1) switch (
|
|
1198
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(filePath) {
|
|
1199
|
+
return _regenerator().w(function (_context5) {
|
|
1200
|
+
while (1) switch (_context5.n) {
|
|
891
1201
|
case 0:
|
|
892
|
-
|
|
1202
|
+
_context5.n = 1;
|
|
893
1203
|
return (0, _promises.access)(filePath).then(function () {
|
|
894
1204
|
return true;
|
|
895
1205
|
})["catch"](function () {
|
|
896
1206
|
return false;
|
|
897
1207
|
});
|
|
898
1208
|
case 1:
|
|
899
|
-
return
|
|
1209
|
+
return _context5.a(2, _context5.v);
|
|
900
1210
|
}
|
|
901
|
-
},
|
|
1211
|
+
}, _callee5);
|
|
902
1212
|
}));
|
|
903
|
-
return function fileExists(
|
|
1213
|
+
return function fileExists(_x7) {
|
|
904
1214
|
return _ref4.apply(this, arguments);
|
|
905
1215
|
};
|
|
906
1216
|
}();
|
|
907
1217
|
readImageFromDirs = /*#__PURE__*/function () {
|
|
908
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1218
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(modifier) {
|
|
909
1219
|
var defaultPath, snapshotPath;
|
|
910
|
-
return _regenerator().w(function (
|
|
911
|
-
while (1) switch (
|
|
1220
|
+
return _regenerator().w(function (_context6) {
|
|
1221
|
+
while (1) switch (_context6.n) {
|
|
912
1222
|
case 0:
|
|
913
1223
|
defaultPath = "".concat(pathWithoutEnd, "-").concat(modifier, ".png");
|
|
914
1224
|
snapshotPath = "".concat(pathWithoutEndFromSnapshotDir, "-").concat(modifier, ".png");
|
|
915
|
-
|
|
1225
|
+
_context6.n = 1;
|
|
916
1226
|
return fileExists(defaultPath);
|
|
917
1227
|
case 1:
|
|
918
|
-
if (!
|
|
919
|
-
|
|
1228
|
+
if (!_context6.v) {
|
|
1229
|
+
_context6.n = 3;
|
|
920
1230
|
break;
|
|
921
1231
|
}
|
|
922
|
-
|
|
1232
|
+
_context6.n = 2;
|
|
923
1233
|
return (0, _reporter.readImageAsBase64)(defaultPath);
|
|
924
1234
|
case 2:
|
|
925
|
-
return
|
|
1235
|
+
return _context6.a(2, _context6.v);
|
|
926
1236
|
case 3:
|
|
927
|
-
|
|
1237
|
+
_context6.n = 4;
|
|
928
1238
|
return fileExists(snapshotPath);
|
|
929
1239
|
case 4:
|
|
930
|
-
if (!
|
|
931
|
-
|
|
1240
|
+
if (!_context6.v) {
|
|
1241
|
+
_context6.n = 6;
|
|
932
1242
|
break;
|
|
933
1243
|
}
|
|
934
|
-
|
|
1244
|
+
_context6.n = 5;
|
|
935
1245
|
return (0, _reporter.readImageAsBase64)(snapshotPath);
|
|
936
1246
|
case 5:
|
|
937
|
-
return
|
|
1247
|
+
return _context6.a(2, _context6.v);
|
|
938
1248
|
case 6:
|
|
939
|
-
return
|
|
1249
|
+
return _context6.a(2, undefined);
|
|
940
1250
|
}
|
|
941
|
-
},
|
|
1251
|
+
}, _callee6);
|
|
942
1252
|
}));
|
|
943
|
-
return function readImageFromDirs(
|
|
1253
|
+
return function readImageFromDirs(_x8) {
|
|
944
1254
|
return _ref5.apply(this, arguments);
|
|
945
1255
|
};
|
|
946
1256
|
}();
|
|
947
|
-
|
|
1257
|
+
_context7.n = 9;
|
|
948
1258
|
return readImageFromDirs("actual");
|
|
949
|
-
case
|
|
950
|
-
actualBase64 =
|
|
951
|
-
|
|
1259
|
+
case 9:
|
|
1260
|
+
actualBase64 = _context7.v;
|
|
1261
|
+
_context7.n = 10;
|
|
952
1262
|
return readImageFromDirs("expected");
|
|
953
|
-
case
|
|
954
|
-
expectedBase64 =
|
|
955
|
-
|
|
1263
|
+
case 10:
|
|
1264
|
+
expectedBase64 = _context7.v;
|
|
1265
|
+
_context7.n = 11;
|
|
956
1266
|
return readImageFromDirs("diff");
|
|
957
|
-
case
|
|
958
|
-
diffBase64 =
|
|
1267
|
+
case 11:
|
|
1268
|
+
diffBase64 = _context7.v;
|
|
959
1269
|
diffName = attachment.name.replace(_utils.diffEndRegexp, "");
|
|
960
1270
|
this.allureRuntime.writeAttachment(testUuid, undefined, diffName, Buffer.from(JSON.stringify({
|
|
961
1271
|
expected: expectedBase64,
|
|
@@ -967,12 +1277,12 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
967
1277
|
fileExtension: ".imagediff"
|
|
968
1278
|
});
|
|
969
1279
|
this.processedDiffs.push(pathWithoutEnd);
|
|
970
|
-
case
|
|
971
|
-
return
|
|
1280
|
+
case 12:
|
|
1281
|
+
return _context7.a(2);
|
|
972
1282
|
}
|
|
973
|
-
},
|
|
1283
|
+
}, _callee7, this);
|
|
974
1284
|
}));
|
|
975
|
-
function processAttachment(
|
|
1285
|
+
function processAttachment(_x4, _x5, _x6) {
|
|
976
1286
|
return _processAttachment.apply(this, arguments);
|
|
977
1287
|
}
|
|
978
1288
|
return processAttachment;
|
|
@@ -1003,6 +1313,22 @@ function _shouldIgnoreStep(step) {
|
|
|
1003
1313
|
}
|
|
1004
1314
|
return false;
|
|
1005
1315
|
}
|
|
1316
|
+
function _getOrCreateHookStack(testId, isBeforeHook, startTime) {
|
|
1317
|
+
var map = isBeforeHook ? this.beforeHooksStepsStack : this.afterHooksStepsStack;
|
|
1318
|
+
var stack = map.get(testId);
|
|
1319
|
+
if (!stack) {
|
|
1320
|
+
stack = new _reporter.ShallowStepsStack();
|
|
1321
|
+
var rootHookStep = _objectSpread(_objectSpread({}, (0, _reporter.createStepResult)()), {}, {
|
|
1322
|
+
name: isBeforeHook ? _utils.BEFORE_HOOKS_ROOT_STEP_TITLE : _utils.AFTER_HOOKS_ROOT_STEP_TITLE,
|
|
1323
|
+
start: startTime.getTime(),
|
|
1324
|
+
stage: _allureJsCommons.Stage.RUNNING,
|
|
1325
|
+
uuid: (0, _reporter.randomUuid)()
|
|
1326
|
+
});
|
|
1327
|
+
stack.startStep(rootHookStep);
|
|
1328
|
+
map.set(testId, stack);
|
|
1329
|
+
}
|
|
1330
|
+
return stack;
|
|
1331
|
+
}
|
|
1006
1332
|
var allure = exports.allure = _legacy.allurePlaywrightLegacyApi;
|
|
1007
1333
|
|
|
1008
1334
|
/**
|