allure-playwright 3.3.3 → 3.4.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/dist/cjs/index.js +123 -127
- 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 +123 -127
- 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, hookAttachmentCounts, _i, _arr, hookStep, name, attachmentSteps, onlyHooksAttachments, attachmentsInSteps, attachmentCounts, _iterator2, _step2, _attachment2, hookCount, currentCount, i, attachment, attachmentStep, beforeHookIndex, afterHookIndex, _i2, _onlyHooksAttachments, _attachment, matchingBeforeHookStep, matchingAfterHookStep, targetStack, _hookStep, _hookStep2, _targetStack, _hookStep3, 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,32 +431,49 @@ 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
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
434
|
+
hookAttachmentCounts = new Map();
|
|
435
|
+
for (_i = 0, _arr = [].concat(_toConsumableArray(attachmentsInBeforeHooks), _toConsumableArray(attachmentsInAfterHooks)); _i < _arr.length; _i++) {
|
|
436
|
+
hookStep = _arr[_i];
|
|
437
|
+
name = (0, _utils.normalizeHookTitle)(hookStep.title);
|
|
438
|
+
if (name) {
|
|
439
|
+
hookAttachmentCounts.set(name, (hookAttachmentCounts.get(name) || 0) + 1);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
441
442
|
attachmentSteps = (_this$attachmentSteps2 = this.attachmentSteps.get(testUuid)) !== null && _this$attachmentSteps2 !== void 0 ? _this$attachmentSteps2 : [];
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
443
|
+
onlyHooksAttachments = [];
|
|
444
|
+
attachmentsInSteps = [];
|
|
445
|
+
attachmentCounts = new Map();
|
|
446
|
+
_iterator2 = _createForOfIteratorHelper(result.attachments);
|
|
447
|
+
try {
|
|
448
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
449
|
+
_attachment2 = _step2.value;
|
|
450
|
+
hookCount = hookAttachmentCounts.get(_attachment2.name) || 0;
|
|
451
|
+
currentCount = attachmentCounts.get(_attachment2.name) || 0;
|
|
452
|
+
if (currentCount < hookCount) {
|
|
453
|
+
onlyHooksAttachments.push(_attachment2);
|
|
454
|
+
} else {
|
|
455
|
+
attachmentsInSteps.push(_attachment2);
|
|
456
|
+
}
|
|
457
|
+
attachmentCounts.set(_attachment2.name, currentCount + 1);
|
|
458
|
+
}
|
|
459
|
+
} catch (err) {
|
|
460
|
+
_iterator2.e(err);
|
|
461
|
+
} finally {
|
|
462
|
+
_iterator2.f();
|
|
463
|
+
}
|
|
448
464
|
i = 0;
|
|
449
465
|
case 1:
|
|
450
466
|
if (!(i < attachmentsInSteps.length)) {
|
|
451
|
-
|
|
467
|
+
_context.n = 3;
|
|
452
468
|
break;
|
|
453
469
|
}
|
|
454
470
|
attachment = attachmentsInSteps[i];
|
|
455
471
|
attachmentStep = attachmentSteps.length > i ? attachmentSteps[i] : undefined;
|
|
456
|
-
|
|
472
|
+
_context.n = 2;
|
|
457
473
|
return this.processAttachment(testUuid, attachmentStep, attachment);
|
|
458
474
|
case 2:
|
|
459
475
|
i++;
|
|
460
|
-
|
|
476
|
+
_context.n = 1;
|
|
461
477
|
break;
|
|
462
478
|
case 3:
|
|
463
479
|
if (result.stdout.length > 0) {
|
|
@@ -473,75 +489,55 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
473
489
|
|
|
474
490
|
// FIXME: temp logic for labels override, we need it here to keep the reporter compatible with v2 API
|
|
475
491
|
// in next iterations we need to implement the logic for every javascript integration
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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;
|
|
492
|
+
beforeHookIndex = 0;
|
|
493
|
+
afterHookIndex = 0;
|
|
494
|
+
_i2 = 0, _onlyHooksAttachments = onlyHooksAttachments;
|
|
495
|
+
case 4:
|
|
496
|
+
if (!(_i2 < _onlyHooksAttachments.length)) {
|
|
497
|
+
_context.n = 8;
|
|
521
498
|
break;
|
|
522
499
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
500
|
+
_attachment = _onlyHooksAttachments[_i2];
|
|
501
|
+
matchingBeforeHookStep = null;
|
|
502
|
+
matchingAfterHookStep = null;
|
|
503
|
+
targetStack = null;
|
|
504
|
+
_hookStep = null;
|
|
505
|
+
if (beforeHookIndex < attachmentsInBeforeHooks.length) {
|
|
506
|
+
matchingBeforeHookStep = attachmentsInBeforeHooks[beforeHookIndex];
|
|
507
|
+
targetStack = beforeHooksStack;
|
|
508
|
+
_hookStep = matchingBeforeHookStep;
|
|
509
|
+
beforeHookIndex++;
|
|
510
|
+
} else if (afterHookIndex < attachmentsInAfterHooks.length) {
|
|
511
|
+
matchingAfterHookStep = attachmentsInAfterHooks[afterHookIndex];
|
|
512
|
+
targetStack = afterHooksStack;
|
|
513
|
+
_hookStep = matchingAfterHookStep;
|
|
514
|
+
afterHookIndex++;
|
|
515
|
+
}
|
|
516
|
+
if (!(_attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE)) {
|
|
517
|
+
_context.n = 6;
|
|
527
518
|
break;
|
|
528
519
|
}
|
|
529
|
-
|
|
520
|
+
_context.n = 5;
|
|
521
|
+
return this.processAttachment(testUuid, (_hookStep2 = _hookStep) === null || _hookStep2 === void 0 ? void 0 : _hookStep2.uuid, _attachment);
|
|
522
|
+
case 5:
|
|
523
|
+
return _context.a(3, 7);
|
|
524
|
+
case 6:
|
|
525
|
+
if (targetStack && _hookStep) {
|
|
526
|
+
stepResult = (_targetStack = targetStack) === null || _targetStack === void 0 ? void 0 : _targetStack.findStepByUuid((_hookStep3 = _hookStep) === null || _hookStep3 === void 0 ? void 0 : _hookStep3.uuid);
|
|
527
|
+
if (stepResult) {
|
|
528
|
+
fileName = targetStack.addAttachment(_attachment, this.allureRuntime.writer);
|
|
529
|
+
stepResult.attachments.push({
|
|
530
|
+
name: _attachment.name,
|
|
531
|
+
type: _attachment.contentType,
|
|
532
|
+
source: fileName
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
}
|
|
530
536
|
case 7:
|
|
531
|
-
|
|
537
|
+
_i2++;
|
|
538
|
+
_context.n = 4;
|
|
532
539
|
break;
|
|
533
540
|
case 8:
|
|
534
|
-
_context2.n = 10;
|
|
535
|
-
break;
|
|
536
|
-
case 9:
|
|
537
|
-
_context2.p = 9;
|
|
538
|
-
_t = _context2.v;
|
|
539
|
-
_iterator2.e(_t);
|
|
540
|
-
case 10:
|
|
541
|
-
_context2.p = 10;
|
|
542
|
-
_iterator2.f();
|
|
543
|
-
return _context2.f(10);
|
|
544
|
-
case 11:
|
|
545
541
|
this.allureRuntime.updateTest(testUuid, function (testResult) {
|
|
546
542
|
var mappedLabels = testResult.labels.reduce(function (acc, label) {
|
|
547
543
|
if (!acc[label.name]) {
|
|
@@ -573,10 +569,10 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
573
569
|
duration: result.duration
|
|
574
570
|
});
|
|
575
571
|
this.allureRuntime.writeTest(testUuid);
|
|
576
|
-
case
|
|
577
|
-
return
|
|
572
|
+
case 9:
|
|
573
|
+
return _context.a(2);
|
|
578
574
|
}
|
|
579
|
-
}, _callee, this
|
|
575
|
+
}, _callee, this);
|
|
580
576
|
}));
|
|
581
577
|
function onTestEnd(_x, _x2) {
|
|
582
578
|
return _onTestEnd.apply(this, arguments);
|
|
@@ -588,9 +584,9 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
588
584
|
value: function () {
|
|
589
585
|
var _addSkippedResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
590
586
|
var _this2 = this;
|
|
591
|
-
var unprocessedCases, _iterator3, _step3, testCase,
|
|
592
|
-
return _regenerator().w(function (
|
|
593
|
-
while (1) switch (
|
|
587
|
+
var unprocessedCases, _iterator3, _step3, testCase, _t;
|
|
588
|
+
return _regenerator().w(function (_context2) {
|
|
589
|
+
while (1) switch (_context2.n) {
|
|
594
590
|
case 0:
|
|
595
591
|
unprocessedCases = this.suite.allTests().filter(function (_ref4) {
|
|
596
592
|
var title = _ref4.title;
|
|
@@ -598,16 +594,16 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
598
594
|
return !_this2.startedTestCasesTitlesCache.includes(titleMetadata.cleanTitle);
|
|
599
595
|
});
|
|
600
596
|
_iterator3 = _createForOfIteratorHelper(unprocessedCases);
|
|
601
|
-
|
|
597
|
+
_context2.p = 1;
|
|
602
598
|
_iterator3.s();
|
|
603
599
|
case 2:
|
|
604
600
|
if ((_step3 = _iterator3.n()).done) {
|
|
605
|
-
|
|
601
|
+
_context2.n = 4;
|
|
606
602
|
break;
|
|
607
603
|
}
|
|
608
604
|
testCase = _step3.value;
|
|
609
605
|
this.onTestBegin(testCase);
|
|
610
|
-
|
|
606
|
+
_context2.n = 3;
|
|
611
607
|
return this.onTestEnd(testCase, {
|
|
612
608
|
status: _allureJsCommons.Status.SKIPPED,
|
|
613
609
|
attachments: [],
|
|
@@ -623,21 +619,21 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
623
619
|
annotations: []
|
|
624
620
|
});
|
|
625
621
|
case 3:
|
|
626
|
-
|
|
622
|
+
_context2.n = 2;
|
|
627
623
|
break;
|
|
628
624
|
case 4:
|
|
629
|
-
|
|
625
|
+
_context2.n = 6;
|
|
630
626
|
break;
|
|
631
627
|
case 5:
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
_iterator3.e(
|
|
628
|
+
_context2.p = 5;
|
|
629
|
+
_t = _context2.v;
|
|
630
|
+
_iterator3.e(_t);
|
|
635
631
|
case 6:
|
|
636
|
-
|
|
632
|
+
_context2.p = 6;
|
|
637
633
|
_iterator3.f();
|
|
638
|
-
return
|
|
634
|
+
return _context2.f(6);
|
|
639
635
|
case 7:
|
|
640
|
-
return
|
|
636
|
+
return _context2.a(2);
|
|
641
637
|
}
|
|
642
638
|
}, _callee2, this, [[1, 5, 6, 7]]);
|
|
643
639
|
}));
|
|
@@ -650,16 +646,16 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
650
646
|
key: "onEnd",
|
|
651
647
|
value: function () {
|
|
652
648
|
var _onEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
653
|
-
return _regenerator().w(function (
|
|
654
|
-
while (1) switch (
|
|
649
|
+
return _regenerator().w(function (_context3) {
|
|
650
|
+
while (1) switch (_context3.n) {
|
|
655
651
|
case 0:
|
|
656
|
-
|
|
652
|
+
_context3.n = 1;
|
|
657
653
|
return this.addSkippedResults();
|
|
658
654
|
case 1:
|
|
659
655
|
this.allureRuntime.writeEnvironmentInfo();
|
|
660
656
|
this.allureRuntime.writeCategoriesDefinitions();
|
|
661
657
|
case 2:
|
|
662
|
-
return
|
|
658
|
+
return _context3.a(2);
|
|
663
659
|
}
|
|
664
660
|
}, _callee3, this);
|
|
665
661
|
}));
|
|
@@ -693,36 +689,36 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
693
689
|
value: function () {
|
|
694
690
|
var _processAttachment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(testUuid, attachmentStepUuid, attachment) {
|
|
695
691
|
var allureRuntimeMessage, message, parentUuid, contentType, pathWithoutEnd, actualBase64, expectedBase64, diffBase64, diffName;
|
|
696
|
-
return _regenerator().w(function (
|
|
697
|
-
while (1) switch (
|
|
692
|
+
return _regenerator().w(function (_context4) {
|
|
693
|
+
while (1) switch (_context4.n) {
|
|
698
694
|
case 0:
|
|
699
695
|
if (!(!attachment.body && !attachment.path)) {
|
|
700
|
-
|
|
696
|
+
_context4.n = 1;
|
|
701
697
|
break;
|
|
702
698
|
}
|
|
703
|
-
return
|
|
699
|
+
return _context4.a(2);
|
|
704
700
|
case 1:
|
|
705
701
|
allureRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
|
|
706
702
|
if (!(allureRuntimeMessage && !attachment.body)) {
|
|
707
|
-
|
|
703
|
+
_context4.n = 2;
|
|
708
704
|
break;
|
|
709
705
|
}
|
|
710
|
-
return
|
|
706
|
+
return _context4.a(2);
|
|
711
707
|
case 2:
|
|
712
708
|
if (!allureRuntimeMessage) {
|
|
713
|
-
|
|
709
|
+
_context4.n = 4;
|
|
714
710
|
break;
|
|
715
711
|
}
|
|
716
712
|
message = JSON.parse(attachment.body.toString());
|
|
717
713
|
if (!(message.type === "step_metadata")) {
|
|
718
|
-
|
|
714
|
+
_context4.n = 3;
|
|
719
715
|
break;
|
|
720
716
|
}
|
|
721
717
|
this.processStepMetadataMessage(attachmentStepUuid, message);
|
|
722
|
-
return
|
|
718
|
+
return _context4.a(2);
|
|
723
719
|
case 3:
|
|
724
720
|
this.allureRuntime.applyRuntimeMessages(testUuid, [message]);
|
|
725
|
-
return
|
|
721
|
+
return _context4.a(2);
|
|
726
722
|
case 4:
|
|
727
723
|
parentUuid = this.allureRuntime.startStep(testUuid, attachmentStepUuid, {
|
|
728
724
|
name: attachment.name
|
|
@@ -733,20 +729,20 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
733
729
|
this.allureRuntime.stopStep(parentUuid, undefined);
|
|
734
730
|
}
|
|
735
731
|
if (!attachment.body) {
|
|
736
|
-
|
|
732
|
+
_context4.n = 5;
|
|
737
733
|
break;
|
|
738
734
|
}
|
|
739
735
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.body, {
|
|
740
736
|
contentType: attachment.contentType
|
|
741
737
|
});
|
|
742
|
-
|
|
738
|
+
_context4.n = 7;
|
|
743
739
|
break;
|
|
744
740
|
case 5:
|
|
745
741
|
if ((0, _nodeFs.existsSync)(attachment.path)) {
|
|
746
|
-
|
|
742
|
+
_context4.n = 6;
|
|
747
743
|
break;
|
|
748
744
|
}
|
|
749
|
-
return
|
|
745
|
+
return _context4.a(2);
|
|
750
746
|
case 6:
|
|
751
747
|
contentType = attachment.name === "trace" && attachment.contentType === "application/zip" ? "application/vnd.allure.playwright-trace" : attachment.contentType;
|
|
752
748
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.path, {
|
|
@@ -754,30 +750,30 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
754
750
|
});
|
|
755
751
|
case 7:
|
|
756
752
|
if (attachment.name.match(_utils.diffEndRegexp)) {
|
|
757
|
-
|
|
753
|
+
_context4.n = 8;
|
|
758
754
|
break;
|
|
759
755
|
}
|
|
760
|
-
return
|
|
756
|
+
return _context4.a(2);
|
|
761
757
|
case 8:
|
|
762
758
|
pathWithoutEnd = attachment.path.replace(_utils.diffEndRegexp, "");
|
|
763
759
|
if (!this.processedDiffs.includes(pathWithoutEnd)) {
|
|
764
|
-
|
|
760
|
+
_context4.n = 9;
|
|
765
761
|
break;
|
|
766
762
|
}
|
|
767
|
-
return
|
|
763
|
+
return _context4.a(2);
|
|
768
764
|
case 9:
|
|
769
|
-
|
|
765
|
+
_context4.n = 10;
|
|
770
766
|
return (0, _reporter.readImageAsBase64)("".concat(pathWithoutEnd, "-actual.png"));
|
|
771
767
|
case 10:
|
|
772
|
-
actualBase64 =
|
|
773
|
-
|
|
768
|
+
actualBase64 = _context4.v;
|
|
769
|
+
_context4.n = 11;
|
|
774
770
|
return (0, _reporter.readImageAsBase64)("".concat(pathWithoutEnd, "-expected.png"));
|
|
775
771
|
case 11:
|
|
776
|
-
expectedBase64 =
|
|
777
|
-
|
|
772
|
+
expectedBase64 = _context4.v;
|
|
773
|
+
_context4.n = 12;
|
|
778
774
|
return (0, _reporter.readImageAsBase64)("".concat(pathWithoutEnd, "-diff.png"));
|
|
779
775
|
case 12:
|
|
780
|
-
diffBase64 =
|
|
776
|
+
diffBase64 = _context4.v;
|
|
781
777
|
diffName = attachment.name.replace(_utils.diffEndRegexp, "");
|
|
782
778
|
this.allureRuntime.writeAttachment(testUuid, undefined, diffName, Buffer.from(JSON.stringify({
|
|
783
779
|
expected: expectedBase64,
|
|
@@ -790,7 +786,7 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
|
|
|
790
786
|
});
|
|
791
787
|
this.processedDiffs.push(pathWithoutEnd);
|
|
792
788
|
case 13:
|
|
793
|
-
return
|
|
789
|
+
return _context4.a(2);
|
|
794
790
|
}
|
|
795
791
|
}, _callee4, this);
|
|
796
792
|
}));
|