allure-playwright 3.3.2 → 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 +125 -114
- 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 +126 -113
- 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/esm/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
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"); }
|
|
3
2
|
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 }; })(); }
|
|
4
3
|
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); }
|
|
5
4
|
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); }
|
|
@@ -25,6 +24,8 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
25
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
26
25
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
26
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
27
|
+
/* eslint max-lines: off */
|
|
28
|
+
|
|
28
29
|
import { existsSync } from "node:fs";
|
|
29
30
|
import path from "node:path";
|
|
30
31
|
import process from "node:process";
|
|
@@ -362,9 +363,9 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
362
363
|
_this$beforeHooksAtta,
|
|
363
364
|
_this$afterHooksAttac,
|
|
364
365
|
_this$attachmentSteps2;
|
|
365
|
-
var testUuid, threadId, thread, error, _test$parent$titlePat, _test$parent$titlePat2, projectSuiteTitle, fileSuiteTitle, suiteTitles, beforeHooksStack, afterHooksStack, attachmentsInBeforeHooks, attachmentsInAfterHooks,
|
|
366
|
-
return _regenerator().w(function (
|
|
367
|
-
while (1) switch (
|
|
366
|
+
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;
|
|
367
|
+
return _regenerator().w(function (_context) {
|
|
368
|
+
while (1) switch (_context.n) {
|
|
368
369
|
case 0:
|
|
369
370
|
testUuid = this.allureResultsUuids.get(test.id); // We need to check parallelIndex first because pw introduced this field only in v1.30.0
|
|
370
371
|
threadId = result.parallelIndex !== undefined ? result.parallelIndex : result.workerIndex;
|
|
@@ -412,26 +413,49 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
412
413
|
});
|
|
413
414
|
attachmentsInBeforeHooks = (_this$beforeHooksAtta = this.beforeHooksAttachmentsStack.get(test.id)) !== null && _this$beforeHooksAtta !== void 0 ? _this$beforeHooksAtta : [];
|
|
414
415
|
attachmentsInAfterHooks = (_this$afterHooksAttac = this.afterHooksAttachmentsStack.get(test.id)) !== null && _this$afterHooksAttac !== void 0 ? _this$afterHooksAttac : [];
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
hookAttachmentCounts = new Map();
|
|
417
|
+
for (_i = 0, _arr = [].concat(_toConsumableArray(attachmentsInBeforeHooks), _toConsumableArray(attachmentsInAfterHooks)); _i < _arr.length; _i++) {
|
|
418
|
+
hookStep = _arr[_i];
|
|
419
|
+
name = normalizeHookTitle(hookStep.title);
|
|
420
|
+
if (name) {
|
|
421
|
+
hookAttachmentCounts.set(name, (hookAttachmentCounts.get(name) || 0) + 1);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
418
424
|
attachmentSteps = (_this$attachmentSteps2 = this.attachmentSteps.get(testUuid)) !== null && _this$attachmentSteps2 !== void 0 ? _this$attachmentSteps2 : [];
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
425
|
+
onlyHooksAttachments = [];
|
|
426
|
+
attachmentsInSteps = [];
|
|
427
|
+
attachmentCounts = new Map();
|
|
428
|
+
_iterator2 = _createForOfIteratorHelper(result.attachments);
|
|
429
|
+
try {
|
|
430
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
431
|
+
_attachment2 = _step2.value;
|
|
432
|
+
hookCount = hookAttachmentCounts.get(_attachment2.name) || 0;
|
|
433
|
+
currentCount = attachmentCounts.get(_attachment2.name) || 0;
|
|
434
|
+
if (currentCount < hookCount) {
|
|
435
|
+
onlyHooksAttachments.push(_attachment2);
|
|
436
|
+
} else {
|
|
437
|
+
attachmentsInSteps.push(_attachment2);
|
|
438
|
+
}
|
|
439
|
+
attachmentCounts.set(_attachment2.name, currentCount + 1);
|
|
440
|
+
}
|
|
441
|
+
} catch (err) {
|
|
442
|
+
_iterator2.e(err);
|
|
443
|
+
} finally {
|
|
444
|
+
_iterator2.f();
|
|
445
|
+
}
|
|
422
446
|
i = 0;
|
|
423
447
|
case 1:
|
|
424
448
|
if (!(i < attachmentsInSteps.length)) {
|
|
425
|
-
|
|
449
|
+
_context.n = 3;
|
|
426
450
|
break;
|
|
427
451
|
}
|
|
428
452
|
attachment = attachmentsInSteps[i];
|
|
429
453
|
attachmentStep = attachmentSteps.length > i ? attachmentSteps[i] : undefined;
|
|
430
|
-
|
|
454
|
+
_context.n = 2;
|
|
431
455
|
return this.processAttachment(testUuid, attachmentStep, attachment);
|
|
432
456
|
case 2:
|
|
433
457
|
i++;
|
|
434
|
-
|
|
458
|
+
_context.n = 1;
|
|
435
459
|
break;
|
|
436
460
|
case 3:
|
|
437
461
|
if (result.stdout.length > 0) {
|
|
@@ -447,66 +471,55 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
447
471
|
|
|
448
472
|
// FIXME: temp logic for labels override, we need it here to keep the reporter compatible with v2 API
|
|
449
473
|
// in next iterations we need to implement the logic for every javascript integration
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
stepResult.attachments.push({
|
|
477
|
-
name: attachment.name,
|
|
478
|
-
type: attachment.contentType,
|
|
479
|
-
source: fileName
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
case 1:
|
|
484
|
-
return _context.a(2);
|
|
485
|
-
}
|
|
486
|
-
}, _loop);
|
|
487
|
-
});
|
|
488
|
-
_iterator2.s();
|
|
489
|
-
case 5:
|
|
490
|
-
if ((_step2 = _iterator2.n()).done) {
|
|
491
|
-
_context2.n = 7;
|
|
474
|
+
beforeHookIndex = 0;
|
|
475
|
+
afterHookIndex = 0;
|
|
476
|
+
_i2 = 0, _onlyHooksAttachments = onlyHooksAttachments;
|
|
477
|
+
case 4:
|
|
478
|
+
if (!(_i2 < _onlyHooksAttachments.length)) {
|
|
479
|
+
_context.n = 8;
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
_attachment = _onlyHooksAttachments[_i2];
|
|
483
|
+
matchingBeforeHookStep = null;
|
|
484
|
+
matchingAfterHookStep = null;
|
|
485
|
+
targetStack = null;
|
|
486
|
+
_hookStep = null;
|
|
487
|
+
if (beforeHookIndex < attachmentsInBeforeHooks.length) {
|
|
488
|
+
matchingBeforeHookStep = attachmentsInBeforeHooks[beforeHookIndex];
|
|
489
|
+
targetStack = beforeHooksStack;
|
|
490
|
+
_hookStep = matchingBeforeHookStep;
|
|
491
|
+
beforeHookIndex++;
|
|
492
|
+
} else if (afterHookIndex < attachmentsInAfterHooks.length) {
|
|
493
|
+
matchingAfterHookStep = attachmentsInAfterHooks[afterHookIndex];
|
|
494
|
+
targetStack = afterHooksStack;
|
|
495
|
+
_hookStep = matchingAfterHookStep;
|
|
496
|
+
afterHookIndex++;
|
|
497
|
+
}
|
|
498
|
+
if (!(_attachment.contentType === ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE)) {
|
|
499
|
+
_context.n = 6;
|
|
492
500
|
break;
|
|
493
501
|
}
|
|
494
|
-
|
|
502
|
+
_context.n = 5;
|
|
503
|
+
return this.processAttachment(testUuid, (_hookStep2 = _hookStep) === null || _hookStep2 === void 0 ? void 0 : _hookStep2.uuid, _attachment);
|
|
504
|
+
case 5:
|
|
505
|
+
return _context.a(3, 7);
|
|
495
506
|
case 6:
|
|
496
|
-
|
|
497
|
-
|
|
507
|
+
if (targetStack && _hookStep) {
|
|
508
|
+
stepResult = (_targetStack = targetStack) === null || _targetStack === void 0 ? void 0 : _targetStack.findStepByUuid((_hookStep3 = _hookStep) === null || _hookStep3 === void 0 ? void 0 : _hookStep3.uuid);
|
|
509
|
+
if (stepResult) {
|
|
510
|
+
fileName = targetStack.addAttachment(_attachment, this.allureRuntime.writer);
|
|
511
|
+
stepResult.attachments.push({
|
|
512
|
+
name: _attachment.name,
|
|
513
|
+
type: _attachment.contentType,
|
|
514
|
+
source: fileName
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}
|
|
498
518
|
case 7:
|
|
499
|
-
|
|
519
|
+
_i2++;
|
|
520
|
+
_context.n = 4;
|
|
500
521
|
break;
|
|
501
522
|
case 8:
|
|
502
|
-
_context2.p = 8;
|
|
503
|
-
_t = _context2.v;
|
|
504
|
-
_iterator2.e(_t);
|
|
505
|
-
case 9:
|
|
506
|
-
_context2.p = 9;
|
|
507
|
-
_iterator2.f();
|
|
508
|
-
return _context2.f(9);
|
|
509
|
-
case 10:
|
|
510
523
|
this.allureRuntime.updateTest(testUuid, function (testResult) {
|
|
511
524
|
var mappedLabels = testResult.labels.reduce(function (acc, label) {
|
|
512
525
|
if (!acc[label.name]) {
|
|
@@ -538,10 +551,10 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
538
551
|
duration: result.duration
|
|
539
552
|
});
|
|
540
553
|
this.allureRuntime.writeTest(testUuid);
|
|
541
|
-
case
|
|
542
|
-
return
|
|
554
|
+
case 9:
|
|
555
|
+
return _context.a(2);
|
|
543
556
|
}
|
|
544
|
-
}, _callee, this
|
|
557
|
+
}, _callee, this);
|
|
545
558
|
}));
|
|
546
559
|
function onTestEnd(_x, _x2) {
|
|
547
560
|
return _onTestEnd.apply(this, arguments);
|
|
@@ -553,9 +566,9 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
553
566
|
value: function () {
|
|
554
567
|
var _addSkippedResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
555
568
|
var _this2 = this;
|
|
556
|
-
var unprocessedCases, _iterator3, _step3, testCase,
|
|
557
|
-
return _regenerator().w(function (
|
|
558
|
-
while (1) switch (
|
|
569
|
+
var unprocessedCases, _iterator3, _step3, testCase, _t;
|
|
570
|
+
return _regenerator().w(function (_context2) {
|
|
571
|
+
while (1) switch (_context2.n) {
|
|
559
572
|
case 0:
|
|
560
573
|
unprocessedCases = this.suite.allTests().filter(function (_ref4) {
|
|
561
574
|
var title = _ref4.title;
|
|
@@ -563,16 +576,16 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
563
576
|
return !_this2.startedTestCasesTitlesCache.includes(titleMetadata.cleanTitle);
|
|
564
577
|
});
|
|
565
578
|
_iterator3 = _createForOfIteratorHelper(unprocessedCases);
|
|
566
|
-
|
|
579
|
+
_context2.p = 1;
|
|
567
580
|
_iterator3.s();
|
|
568
581
|
case 2:
|
|
569
582
|
if ((_step3 = _iterator3.n()).done) {
|
|
570
|
-
|
|
583
|
+
_context2.n = 4;
|
|
571
584
|
break;
|
|
572
585
|
}
|
|
573
586
|
testCase = _step3.value;
|
|
574
587
|
this.onTestBegin(testCase);
|
|
575
|
-
|
|
588
|
+
_context2.n = 3;
|
|
576
589
|
return this.onTestEnd(testCase, {
|
|
577
590
|
status: Status.SKIPPED,
|
|
578
591
|
attachments: [],
|
|
@@ -588,21 +601,21 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
588
601
|
annotations: []
|
|
589
602
|
});
|
|
590
603
|
case 3:
|
|
591
|
-
|
|
604
|
+
_context2.n = 2;
|
|
592
605
|
break;
|
|
593
606
|
case 4:
|
|
594
|
-
|
|
607
|
+
_context2.n = 6;
|
|
595
608
|
break;
|
|
596
609
|
case 5:
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
_iterator3.e(
|
|
610
|
+
_context2.p = 5;
|
|
611
|
+
_t = _context2.v;
|
|
612
|
+
_iterator3.e(_t);
|
|
600
613
|
case 6:
|
|
601
|
-
|
|
614
|
+
_context2.p = 6;
|
|
602
615
|
_iterator3.f();
|
|
603
|
-
return
|
|
616
|
+
return _context2.f(6);
|
|
604
617
|
case 7:
|
|
605
|
-
return
|
|
618
|
+
return _context2.a(2);
|
|
606
619
|
}
|
|
607
620
|
}, _callee2, this, [[1, 5, 6, 7]]);
|
|
608
621
|
}));
|
|
@@ -615,16 +628,16 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
615
628
|
key: "onEnd",
|
|
616
629
|
value: function () {
|
|
617
630
|
var _onEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
618
|
-
return _regenerator().w(function (
|
|
619
|
-
while (1) switch (
|
|
631
|
+
return _regenerator().w(function (_context3) {
|
|
632
|
+
while (1) switch (_context3.n) {
|
|
620
633
|
case 0:
|
|
621
|
-
|
|
634
|
+
_context3.n = 1;
|
|
622
635
|
return this.addSkippedResults();
|
|
623
636
|
case 1:
|
|
624
637
|
this.allureRuntime.writeEnvironmentInfo();
|
|
625
638
|
this.allureRuntime.writeCategoriesDefinitions();
|
|
626
639
|
case 2:
|
|
627
|
-
return
|
|
640
|
+
return _context3.a(2);
|
|
628
641
|
}
|
|
629
642
|
}, _callee3, this);
|
|
630
643
|
}));
|
|
@@ -658,36 +671,36 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
658
671
|
value: function () {
|
|
659
672
|
var _processAttachment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(testUuid, attachmentStepUuid, attachment) {
|
|
660
673
|
var allureRuntimeMessage, message, parentUuid, contentType, pathWithoutEnd, actualBase64, expectedBase64, diffBase64, diffName;
|
|
661
|
-
return _regenerator().w(function (
|
|
662
|
-
while (1) switch (
|
|
674
|
+
return _regenerator().w(function (_context4) {
|
|
675
|
+
while (1) switch (_context4.n) {
|
|
663
676
|
case 0:
|
|
664
677
|
if (!(!attachment.body && !attachment.path)) {
|
|
665
|
-
|
|
678
|
+
_context4.n = 1;
|
|
666
679
|
break;
|
|
667
680
|
}
|
|
668
|
-
return
|
|
681
|
+
return _context4.a(2);
|
|
669
682
|
case 1:
|
|
670
683
|
allureRuntimeMessage = attachment.contentType === ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
|
|
671
684
|
if (!(allureRuntimeMessage && !attachment.body)) {
|
|
672
|
-
|
|
685
|
+
_context4.n = 2;
|
|
673
686
|
break;
|
|
674
687
|
}
|
|
675
|
-
return
|
|
688
|
+
return _context4.a(2);
|
|
676
689
|
case 2:
|
|
677
690
|
if (!allureRuntimeMessage) {
|
|
678
|
-
|
|
691
|
+
_context4.n = 4;
|
|
679
692
|
break;
|
|
680
693
|
}
|
|
681
694
|
message = JSON.parse(attachment.body.toString());
|
|
682
695
|
if (!(message.type === "step_metadata")) {
|
|
683
|
-
|
|
696
|
+
_context4.n = 3;
|
|
684
697
|
break;
|
|
685
698
|
}
|
|
686
699
|
this.processStepMetadataMessage(attachmentStepUuid, message);
|
|
687
|
-
return
|
|
700
|
+
return _context4.a(2);
|
|
688
701
|
case 3:
|
|
689
702
|
this.allureRuntime.applyRuntimeMessages(testUuid, [message]);
|
|
690
|
-
return
|
|
703
|
+
return _context4.a(2);
|
|
691
704
|
case 4:
|
|
692
705
|
parentUuid = this.allureRuntime.startStep(testUuid, attachmentStepUuid, {
|
|
693
706
|
name: attachment.name
|
|
@@ -698,20 +711,20 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
698
711
|
this.allureRuntime.stopStep(parentUuid, undefined);
|
|
699
712
|
}
|
|
700
713
|
if (!attachment.body) {
|
|
701
|
-
|
|
714
|
+
_context4.n = 5;
|
|
702
715
|
break;
|
|
703
716
|
}
|
|
704
717
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.body, {
|
|
705
718
|
contentType: attachment.contentType
|
|
706
719
|
});
|
|
707
|
-
|
|
720
|
+
_context4.n = 7;
|
|
708
721
|
break;
|
|
709
722
|
case 5:
|
|
710
723
|
if (existsSync(attachment.path)) {
|
|
711
|
-
|
|
724
|
+
_context4.n = 6;
|
|
712
725
|
break;
|
|
713
726
|
}
|
|
714
|
-
return
|
|
727
|
+
return _context4.a(2);
|
|
715
728
|
case 6:
|
|
716
729
|
contentType = attachment.name === "trace" && attachment.contentType === "application/zip" ? "application/vnd.allure.playwright-trace" : attachment.contentType;
|
|
717
730
|
this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.path, {
|
|
@@ -719,30 +732,30 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
719
732
|
});
|
|
720
733
|
case 7:
|
|
721
734
|
if (attachment.name.match(diffEndRegexp)) {
|
|
722
|
-
|
|
735
|
+
_context4.n = 8;
|
|
723
736
|
break;
|
|
724
737
|
}
|
|
725
|
-
return
|
|
738
|
+
return _context4.a(2);
|
|
726
739
|
case 8:
|
|
727
740
|
pathWithoutEnd = attachment.path.replace(diffEndRegexp, "");
|
|
728
741
|
if (!this.processedDiffs.includes(pathWithoutEnd)) {
|
|
729
|
-
|
|
742
|
+
_context4.n = 9;
|
|
730
743
|
break;
|
|
731
744
|
}
|
|
732
|
-
return
|
|
745
|
+
return _context4.a(2);
|
|
733
746
|
case 9:
|
|
734
|
-
|
|
747
|
+
_context4.n = 10;
|
|
735
748
|
return readImageAsBase64("".concat(pathWithoutEnd, "-actual.png"));
|
|
736
749
|
case 10:
|
|
737
|
-
actualBase64 =
|
|
738
|
-
|
|
750
|
+
actualBase64 = _context4.v;
|
|
751
|
+
_context4.n = 11;
|
|
739
752
|
return readImageAsBase64("".concat(pathWithoutEnd, "-expected.png"));
|
|
740
753
|
case 11:
|
|
741
|
-
expectedBase64 =
|
|
742
|
-
|
|
754
|
+
expectedBase64 = _context4.v;
|
|
755
|
+
_context4.n = 12;
|
|
743
756
|
return readImageAsBase64("".concat(pathWithoutEnd, "-diff.png"));
|
|
744
757
|
case 12:
|
|
745
|
-
diffBase64 =
|
|
758
|
+
diffBase64 = _context4.v;
|
|
746
759
|
diffName = attachment.name.replace(diffEndRegexp, "");
|
|
747
760
|
this.allureRuntime.writeAttachment(testUuid, undefined, diffName, Buffer.from(JSON.stringify({
|
|
748
761
|
expected: expectedBase64,
|
|
@@ -755,7 +768,7 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
755
768
|
});
|
|
756
769
|
this.processedDiffs.push(pathWithoutEnd);
|
|
757
770
|
case 13:
|
|
758
|
-
return
|
|
771
|
+
return _context4.a(2);
|
|
759
772
|
}
|
|
760
773
|
}, _callee4, this);
|
|
761
774
|
}));
|