allure-playwright 3.3.3 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +158 -135
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils.js +1 -1
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/index.js +158 -135
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils.js +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/package.json +7 -7
package/dist/cjs/index.js
CHANGED
|
@@ -27,7 +27,6 @@ var _legacy = require("./legacy.js");
|
|
|
27
27
|
var _utils = require("./utils.js");
|
|
28
28
|
var _test = require("@playwright/test");
|
|
29
29
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
30
|
-
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
31
30
|
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
31
|
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
|
33
32
|
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); }
|
|
@@ -382,9 +381,9 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
382
381
|
_this$beforeHooksAtta,
|
|
383
382
|
_this$afterHooksAttac,
|
|
384
383
|
_this$attachmentSteps2;
|
|
385
|
-
var testUuid, threadId, thread, error, _test$parent$titlePat, _test$parent$titlePat2, projectSuiteTitle, fileSuiteTitle, suiteTitles, beforeHooksStack, afterHooksStack, attachmentsInBeforeHooks, attachmentsInAfterHooks,
|
|
386
|
-
return _regenerator().w(function (
|
|
387
|
-
while (1) switch (
|
|
384
|
+
var testUuid, threadId, thread, error, _test$parent$titlePat, _test$parent$titlePat2, projectSuiteTitle, fileSuiteTitle, suiteTitles, beforeHooksStack, afterHooksStack, attachmentsInBeforeHooks, attachmentsInAfterHooks, attachmentSteps, attachmentToStepMap, attachmentIndex, _iterator2, _step2, _hookStep, _iterator3, _step3, stepUuid, _iterator4, _step4, _hookStep2, i, attachment, stepInfo, _i, _attachment, _stepInfo, hookStep, isBeforeHook, targetStack, stepResult, fileName;
|
|
385
|
+
return _regenerator().w(function (_context) {
|
|
386
|
+
while (1) switch (_context.n) {
|
|
388
387
|
case 0:
|
|
389
388
|
testUuid = this.allureResultsUuids.get(test.id); // We need to check parallelIndex first because pw introduced this field only in v1.30.0
|
|
390
389
|
threadId = result.parallelIndex !== undefined ? result.parallelIndex : result.workerIndex;
|
|
@@ -432,34 +431,87 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
432
431
|
});
|
|
433
432
|
attachmentsInBeforeHooks = (_this$beforeHooksAtta = this.beforeHooksAttachmentsStack.get(test.id)) !== null && _this$beforeHooksAtta !== void 0 ? _this$beforeHooksAtta : [];
|
|
434
433
|
attachmentsInAfterHooks = (_this$afterHooksAttac = this.afterHooksAttachmentsStack.get(test.id)) !== null && _this$afterHooksAttac !== void 0 ? _this$afterHooksAttac : [];
|
|
435
|
-
hookAttachmentUuids = new Set([].concat(_toConsumableArray(attachmentsInBeforeHooks), _toConsumableArray(attachmentsInAfterHooks)).map(function (hookStep) {
|
|
436
|
-
return (0, _utils.normalizeHookTitle)(hookStep.title);
|
|
437
|
-
}).filter(Boolean));
|
|
438
|
-
hookAttachmentNames = new Set([].concat(_toConsumableArray(attachmentsInBeforeHooks), _toConsumableArray(attachmentsInAfterHooks)).map(function (hookStep) {
|
|
439
|
-
return (0, _utils.normalizeHookTitle)(hookStep.title);
|
|
440
|
-
}).filter(Boolean));
|
|
441
434
|
attachmentSteps = (_this$attachmentSteps2 = this.attachmentSteps.get(testUuid)) !== null && _this$attachmentSteps2 !== void 0 ? _this$attachmentSteps2 : [];
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
435
|
+
attachmentToStepMap = new Map();
|
|
436
|
+
attachmentIndex = 0;
|
|
437
|
+
_iterator2 = _createForOfIteratorHelper(attachmentsInBeforeHooks);
|
|
438
|
+
try {
|
|
439
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
440
|
+
_hookStep = _step2.value;
|
|
441
|
+
attachmentToStepMap.set(attachmentIndex, {
|
|
442
|
+
stepUuid: _hookStep.uuid,
|
|
443
|
+
isHook: true,
|
|
444
|
+
hookStep: _hookStep
|
|
445
|
+
});
|
|
446
|
+
attachmentIndex++;
|
|
447
|
+
}
|
|
448
|
+
} catch (err) {
|
|
449
|
+
_iterator2.e(err);
|
|
450
|
+
} finally {
|
|
451
|
+
_iterator2.f();
|
|
452
|
+
}
|
|
453
|
+
_iterator3 = _createForOfIteratorHelper(attachmentSteps);
|
|
454
|
+
try {
|
|
455
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
456
|
+
stepUuid = _step3.value;
|
|
457
|
+
attachmentToStepMap.set(attachmentIndex, {
|
|
458
|
+
stepUuid: stepUuid,
|
|
459
|
+
isHook: false
|
|
460
|
+
});
|
|
461
|
+
attachmentIndex++;
|
|
462
|
+
}
|
|
463
|
+
} catch (err) {
|
|
464
|
+
_iterator3.e(err);
|
|
465
|
+
} finally {
|
|
466
|
+
_iterator3.f();
|
|
467
|
+
}
|
|
468
|
+
_iterator4 = _createForOfIteratorHelper(attachmentsInAfterHooks);
|
|
469
|
+
try {
|
|
470
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
471
|
+
_hookStep2 = _step4.value;
|
|
472
|
+
attachmentToStepMap.set(attachmentIndex, {
|
|
473
|
+
stepUuid: _hookStep2.uuid,
|
|
474
|
+
isHook: true,
|
|
475
|
+
hookStep: _hookStep2
|
|
476
|
+
});
|
|
477
|
+
attachmentIndex++;
|
|
478
|
+
}
|
|
479
|
+
} catch (err) {
|
|
480
|
+
_iterator4.e(err);
|
|
481
|
+
} finally {
|
|
482
|
+
_iterator4.f();
|
|
483
|
+
}
|
|
448
484
|
i = 0;
|
|
449
485
|
case 1:
|
|
450
|
-
if (!(i <
|
|
451
|
-
|
|
486
|
+
if (!(i < result.attachments.length)) {
|
|
487
|
+
_context.n = 6;
|
|
452
488
|
break;
|
|
453
489
|
}
|
|
454
|
-
attachment =
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
490
|
+
attachment = result.attachments[i];
|
|
491
|
+
stepInfo = attachmentToStepMap.get(i);
|
|
492
|
+
if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.isHook)) {
|
|
493
|
+
_context.n = 2;
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
return _context.a(3, 5);
|
|
458
497
|
case 2:
|
|
498
|
+
if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.stepUuid)) {
|
|
499
|
+
_context.n = 4;
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
_context.n = 3;
|
|
503
|
+
return this.processAttachment(testUuid, stepInfo.stepUuid, attachment);
|
|
504
|
+
case 3:
|
|
505
|
+
_context.n = 5;
|
|
506
|
+
break;
|
|
507
|
+
case 4:
|
|
508
|
+
_context.n = 5;
|
|
509
|
+
return this.processAttachment(testUuid, undefined, attachment);
|
|
510
|
+
case 5:
|
|
459
511
|
i++;
|
|
460
|
-
|
|
512
|
+
_context.n = 1;
|
|
461
513
|
break;
|
|
462
|
-
case
|
|
514
|
+
case 6:
|
|
463
515
|
if (result.stdout.length > 0) {
|
|
464
516
|
this.allureRuntime.writeAttachment(testUuid, undefined, "stdout", Buffer.from((0, _sdk.stripAnsi)(result.stdout.join("")), "utf-8"), {
|
|
465
517
|
contentType: _allureJsCommons.ContentType.TEXT
|
|
@@ -473,74 +525,45 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
473
525
|
|
|
474
526
|
// FIXME: temp logic for labels override, we need it here to keep the reporter compatible with v2 API
|
|
475
527
|
// in next iterations we need to implement the logic for every javascript integration
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
return _regenerator().w(function (_context) {
|
|
481
|
-
while (1) switch (_context.n) {
|
|
482
|
-
case 0:
|
|
483
|
-
attachment = _step2.value;
|
|
484
|
-
matchingBeforeHookStep = attachmentsInBeforeHooks.find(function (step) {
|
|
485
|
-
return (0, _utils.normalizeHookTitle)(step.title) === attachment.name;
|
|
486
|
-
});
|
|
487
|
-
matchingAfterHookStep = attachmentsInAfterHooks.find(function (step) {
|
|
488
|
-
return (0, _utils.normalizeHookTitle)(step.title) === attachment.name;
|
|
489
|
-
});
|
|
490
|
-
targetStack = matchingBeforeHookStep ? beforeHooksStack : afterHooksStack;
|
|
491
|
-
hookStep = matchingBeforeHookStep || matchingAfterHookStep;
|
|
492
|
-
if (!(attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE)) {
|
|
493
|
-
_context.n = 2;
|
|
494
|
-
break;
|
|
495
|
-
}
|
|
496
|
-
_context.n = 1;
|
|
497
|
-
return _this.processAttachment(testUuid, hookStep === null || hookStep === void 0 ? void 0 : hookStep.uuid, attachment);
|
|
498
|
-
case 1:
|
|
499
|
-
return _context.a(2, 1);
|
|
500
|
-
case 2:
|
|
501
|
-
if (targetStack && hookStep) {
|
|
502
|
-
stepResult = targetStack === null || targetStack === void 0 ? void 0 : targetStack.findStepByUuid(hookStep === null || hookStep === void 0 ? void 0 : hookStep.uuid);
|
|
503
|
-
if (stepResult) {
|
|
504
|
-
fileName = targetStack.addAttachment(attachment, _this.allureRuntime.writer);
|
|
505
|
-
stepResult.attachments.push({
|
|
506
|
-
name: attachment.name,
|
|
507
|
-
type: attachment.contentType,
|
|
508
|
-
source: fileName
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
case 3:
|
|
513
|
-
return _context.a(2);
|
|
514
|
-
}
|
|
515
|
-
}, _loop);
|
|
516
|
-
});
|
|
517
|
-
_iterator2.s();
|
|
518
|
-
case 5:
|
|
519
|
-
if ((_step2 = _iterator2.n()).done) {
|
|
520
|
-
_context2.n = 8;
|
|
528
|
+
_i = 0;
|
|
529
|
+
case 7:
|
|
530
|
+
if (!(_i < result.attachments.length)) {
|
|
531
|
+
_context.n = 11;
|
|
521
532
|
break;
|
|
522
533
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
if (!
|
|
526
|
-
|
|
534
|
+
_attachment = result.attachments[_i];
|
|
535
|
+
_stepInfo = attachmentToStepMap.get(_i);
|
|
536
|
+
if (!(_stepInfo !== null && _stepInfo !== void 0 && _stepInfo.isHook && _stepInfo.hookStep)) {
|
|
537
|
+
_context.n = 10;
|
|
527
538
|
break;
|
|
528
539
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
540
|
+
hookStep = _stepInfo.hookStep;
|
|
541
|
+
isBeforeHook = attachmentsInBeforeHooks.includes(hookStep);
|
|
542
|
+
targetStack = isBeforeHook ? beforeHooksStack : afterHooksStack;
|
|
543
|
+
if (!(_attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE)) {
|
|
544
|
+
_context.n = 9;
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
_context.n = 8;
|
|
548
|
+
return this.processAttachment(testUuid, hookStep.uuid, _attachment);
|
|
533
549
|
case 8:
|
|
534
|
-
|
|
535
|
-
break;
|
|
550
|
+
return _context.a(3, 10);
|
|
536
551
|
case 9:
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
552
|
+
if (targetStack) {
|
|
553
|
+
stepResult = targetStack.findStepByUuid(hookStep.uuid);
|
|
554
|
+
if (stepResult) {
|
|
555
|
+
fileName = targetStack.addAttachment(_attachment, this.allureRuntime.writer);
|
|
556
|
+
stepResult.attachments.push({
|
|
557
|
+
name: _attachment.name,
|
|
558
|
+
type: _attachment.contentType,
|
|
559
|
+
source: fileName
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
}
|
|
540
563
|
case 10:
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
564
|
+
_i++;
|
|
565
|
+
_context.n = 7;
|
|
566
|
+
break;
|
|
544
567
|
case 11:
|
|
545
568
|
this.allureRuntime.updateTest(testUuid, function (testResult) {
|
|
546
569
|
var mappedLabels = testResult.labels.reduce(function (acc, label) {
|
|
@@ -574,9 +597,9 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
574
597
|
});
|
|
575
598
|
this.allureRuntime.writeTest(testUuid);
|
|
576
599
|
case 12:
|
|
577
|
-
return
|
|
600
|
+
return _context.a(2);
|
|
578
601
|
}
|
|
579
|
-
}, _callee, this
|
|
602
|
+
}, _callee, this);
|
|
580
603
|
}));
|
|
581
604
|
function onTestEnd(_x, _x2) {
|
|
582
605
|
return _onTestEnd.apply(this, arguments);
|
|
@@ -588,26 +611,26 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
588
611
|
value: function () {
|
|
589
612
|
var _addSkippedResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
590
613
|
var _this2 = this;
|
|
591
|
-
var unprocessedCases,
|
|
592
|
-
return _regenerator().w(function (
|
|
593
|
-
while (1) switch (
|
|
614
|
+
var unprocessedCases, _iterator5, _step5, testCase, _t;
|
|
615
|
+
return _regenerator().w(function (_context2) {
|
|
616
|
+
while (1) switch (_context2.n) {
|
|
594
617
|
case 0:
|
|
595
618
|
unprocessedCases = this.suite.allTests().filter(function (_ref4) {
|
|
596
619
|
var title = _ref4.title;
|
|
597
620
|
var titleMetadata = (0, _sdk.extractMetadataFromString)(title);
|
|
598
621
|
return !_this2.startedTestCasesTitlesCache.includes(titleMetadata.cleanTitle);
|
|
599
622
|
});
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
623
|
+
_iterator5 = _createForOfIteratorHelper(unprocessedCases);
|
|
624
|
+
_context2.p = 1;
|
|
625
|
+
_iterator5.s();
|
|
603
626
|
case 2:
|
|
604
|
-
if ((
|
|
605
|
-
|
|
627
|
+
if ((_step5 = _iterator5.n()).done) {
|
|
628
|
+
_context2.n = 4;
|
|
606
629
|
break;
|
|
607
630
|
}
|
|
608
|
-
testCase =
|
|
631
|
+
testCase = _step5.value;
|
|
609
632
|
this.onTestBegin(testCase);
|
|
610
|
-
|
|
633
|
+
_context2.n = 3;
|
|
611
634
|
return this.onTestEnd(testCase, {
|
|
612
635
|
status: _allureJsCommons.Status.SKIPPED,
|
|
613
636
|
attachments: [],
|
|
@@ -623,21 +646,21 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
623
646
|
annotations: []
|
|
624
647
|
});
|
|
625
648
|
case 3:
|
|
626
|
-
|
|
649
|
+
_context2.n = 2;
|
|
627
650
|
break;
|
|
628
651
|
case 4:
|
|
629
|
-
|
|
652
|
+
_context2.n = 6;
|
|
630
653
|
break;
|
|
631
654
|
case 5:
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
655
|
+
_context2.p = 5;
|
|
656
|
+
_t = _context2.v;
|
|
657
|
+
_iterator5.e(_t);
|
|
635
658
|
case 6:
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
return
|
|
659
|
+
_context2.p = 6;
|
|
660
|
+
_iterator5.f();
|
|
661
|
+
return _context2.f(6);
|
|
639
662
|
case 7:
|
|
640
|
-
return
|
|
663
|
+
return _context2.a(2);
|
|
641
664
|
}
|
|
642
665
|
}, _callee2, this, [[1, 5, 6, 7]]);
|
|
643
666
|
}));
|
|
@@ -650,16 +673,16 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
650
673
|
key: "onEnd",
|
|
651
674
|
value: function () {
|
|
652
675
|
var _onEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
653
|
-
return _regenerator().w(function (
|
|
654
|
-
while (1) switch (
|
|
676
|
+
return _regenerator().w(function (_context3) {
|
|
677
|
+
while (1) switch (_context3.n) {
|
|
655
678
|
case 0:
|
|
656
|
-
|
|
679
|
+
_context3.n = 1;
|
|
657
680
|
return this.addSkippedResults();
|
|
658
681
|
case 1:
|
|
659
682
|
this.allureRuntime.writeEnvironmentInfo();
|
|
660
683
|
this.allureRuntime.writeCategoriesDefinitions();
|
|
661
684
|
case 2:
|
|
662
|
-
return
|
|
685
|
+
return _context3.a(2);
|
|
663
686
|
}
|
|
664
687
|
}, _callee3, this);
|
|
665
688
|
}));
|
|
@@ -693,36 +716,36 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
693
716
|
value: function () {
|
|
694
717
|
var _processAttachment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(testUuid, attachmentStepUuid, attachment) {
|
|
695
718
|
var allureRuntimeMessage, message, parentUuid, contentType, pathWithoutEnd, actualBase64, expectedBase64, diffBase64, diffName;
|
|
696
|
-
return _regenerator().w(function (
|
|
697
|
-
while (1) switch (
|
|
719
|
+
return _regenerator().w(function (_context4) {
|
|
720
|
+
while (1) switch (_context4.n) {
|
|
698
721
|
case 0:
|
|
699
722
|
if (!(!attachment.body && !attachment.path)) {
|
|
700
|
-
|
|
723
|
+
_context4.n = 1;
|
|
701
724
|
break;
|
|
702
725
|
}
|
|
703
|
-
return
|
|
726
|
+
return _context4.a(2);
|
|
704
727
|
case 1:
|
|
705
728
|
allureRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
|
|
706
729
|
if (!(allureRuntimeMessage && !attachment.body)) {
|
|
707
|
-
|
|
730
|
+
_context4.n = 2;
|
|
708
731
|
break;
|
|
709
732
|
}
|
|
710
|
-
return
|
|
733
|
+
return _context4.a(2);
|
|
711
734
|
case 2:
|
|
712
735
|
if (!allureRuntimeMessage) {
|
|
713
|
-
|
|
736
|
+
_context4.n = 4;
|
|
714
737
|
break;
|
|
715
738
|
}
|
|
716
739
|
message = JSON.parse(attachment.body.toString());
|
|
717
740
|
if (!(message.type === "step_metadata")) {
|
|
718
|
-
|
|
741
|
+
_context4.n = 3;
|
|
719
742
|
break;
|
|
720
743
|
}
|
|
721
744
|
this.processStepMetadataMessage(attachmentStepUuid, message);
|
|
722
|
-
return
|
|
745
|
+
return _context4.a(2);
|
|
723
746
|
case 3:
|
|
724
747
|
this.allureRuntime.applyRuntimeMessages(testUuid, [message]);
|
|
725
|
-
return
|
|
748
|
+
return _context4.a(2);
|
|
726
749
|
case 4:
|
|
727
750
|
parentUuid = this.allureRuntime.startStep(testUuid, attachmentStepUuid, {
|
|
728
751
|
name: attachment.name
|
|
@@ -733,20 +756,20 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
733
756
|
this.allureRuntime.stopStep(parentUuid, undefined);
|
|
734
757
|
}
|
|
735
758
|
if (!attachment.body) {
|
|
736
|
-
|
|
759
|
+
_context4.n = 5;
|
|
737
760
|
break;
|
|
738
761
|
}
|
|
739
762
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.body, {
|
|
740
763
|
contentType: attachment.contentType
|
|
741
764
|
});
|
|
742
|
-
|
|
765
|
+
_context4.n = 7;
|
|
743
766
|
break;
|
|
744
767
|
case 5:
|
|
745
768
|
if ((0, _nodeFs.existsSync)(attachment.path)) {
|
|
746
|
-
|
|
769
|
+
_context4.n = 6;
|
|
747
770
|
break;
|
|
748
771
|
}
|
|
749
|
-
return
|
|
772
|
+
return _context4.a(2);
|
|
750
773
|
case 6:
|
|
751
774
|
contentType = attachment.name === "trace" && attachment.contentType === "application/zip" ? "application/vnd.allure.playwright-trace" : attachment.contentType;
|
|
752
775
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.path, {
|
|
@@ -754,30 +777,30 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
754
777
|
});
|
|
755
778
|
case 7:
|
|
756
779
|
if (attachment.name.match(_utils.diffEndRegexp)) {
|
|
757
|
-
|
|
780
|
+
_context4.n = 8;
|
|
758
781
|
break;
|
|
759
782
|
}
|
|
760
|
-
return
|
|
783
|
+
return _context4.a(2);
|
|
761
784
|
case 8:
|
|
762
785
|
pathWithoutEnd = attachment.path.replace(_utils.diffEndRegexp, "");
|
|
763
786
|
if (!this.processedDiffs.includes(pathWithoutEnd)) {
|
|
764
|
-
|
|
787
|
+
_context4.n = 9;
|
|
765
788
|
break;
|
|
766
789
|
}
|
|
767
|
-
return
|
|
790
|
+
return _context4.a(2);
|
|
768
791
|
case 9:
|
|
769
|
-
|
|
792
|
+
_context4.n = 10;
|
|
770
793
|
return (0, _reporter.readImageAsBase64)("".concat(pathWithoutEnd, "-actual.png"));
|
|
771
794
|
case 10:
|
|
772
|
-
actualBase64 =
|
|
773
|
-
|
|
795
|
+
actualBase64 = _context4.v;
|
|
796
|
+
_context4.n = 11;
|
|
774
797
|
return (0, _reporter.readImageAsBase64)("".concat(pathWithoutEnd, "-expected.png"));
|
|
775
798
|
case 11:
|
|
776
|
-
expectedBase64 =
|
|
777
|
-
|
|
799
|
+
expectedBase64 = _context4.v;
|
|
800
|
+
_context4.n = 12;
|
|
778
801
|
return (0, _reporter.readImageAsBase64)("".concat(pathWithoutEnd, "-diff.png"));
|
|
779
802
|
case 12:
|
|
780
|
-
diffBase64 =
|
|
803
|
+
diffBase64 = _context4.v;
|
|
781
804
|
diffName = attachment.name.replace(_utils.diffEndRegexp, "");
|
|
782
805
|
this.allureRuntime.writeAttachment(testUuid, undefined, diffName, Buffer.from(JSON.stringify({
|
|
783
806
|
expected: expectedBase64,
|
|
@@ -790,7 +813,7 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
790
813
|
});
|
|
791
814
|
this.processedDiffs.push(pathWithoutEnd);
|
|
792
815
|
case 13:
|
|
793
|
-
return
|
|
816
|
+
return _context4.a(2);
|
|
794
817
|
}
|
|
795
818
|
}, _callee4, this);
|
|
796
819
|
}));
|