allure-playwright 3.11.1 → 3.12.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 CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ 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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -7,18 +8,17 @@ exports["default"] = exports.allure = exports.AllureReporter = void 0;
7
8
  Object.defineProperty(exports, "expect", {
8
9
  enumerable: true,
9
10
  get: function get() {
10
- return _test.expect;
11
+ return _test().expect;
11
12
  }
12
13
  });
13
14
  Object.defineProperty(exports, "test", {
14
15
  enumerable: true,
15
16
  get: function get() {
16
- return _test.test;
17
+ return _test().test;
17
18
  }
18
19
  });
19
20
  var _nodeFs = require("node:fs");
20
21
  var _promises = require("node:fs/promises");
21
- var _nodeModule = require("node:module");
22
22
  var _nodePath = _interopRequireDefault(require("node:path"));
23
23
  var _nodeProcess = _interopRequireDefault(require("node:process"));
24
24
  var _allureJsCommons = require("allure-js-commons");
@@ -26,23 +26,28 @@ var _sdk = require("allure-js-commons/sdk");
26
26
  var _reporter = require("allure-js-commons/sdk/reporter");
27
27
  var _legacy = require("./legacy.js");
28
28
  var _utils = require("./utils.js");
29
- var _test = require("@playwright/test");
29
+ function _test() {
30
+ var data = require("@playwright/test");
31
+ _test = function _test() {
32
+ return data;
33
+ };
34
+ return data;
35
+ }
30
36
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
31
37
  function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
32
38
  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."); }
33
39
  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
- 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
- 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
- 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; } } }; }
39
40
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
40
41
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
41
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
42
42
  function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
43
43
  function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
44
+ 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 }; })(); }
45
+ 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); }
46
+ 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; } } }; }
47
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
44
48
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
45
- 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); }
49
+ 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); }
50
+ 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); }); }; }
46
51
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
47
52
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
48
53
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -54,9 +59,6 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
54
59
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
55
60
  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); }
56
61
  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"); } /* eslint max-lines: off */
57
- var localRequire = typeof require === "function" ? require : (0, _nodeModule.createRequire)(require('url').pathToFileURL(__filename).toString());
58
- var testPlanFilterSymbol = Symbol["for"]("allure-playwright.testPlanFilter");
59
- var testPlanFilterPatchSymbol = Symbol["for"]("allure-playwright.testPlanFilterPatch");
60
62
  var _AllureReporter_brand = /*#__PURE__*/new WeakSet();
61
63
  var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
62
64
  function AllureReporter(config) {
@@ -78,6 +80,7 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
78
80
  _defineProperty(this, "pendingAttachmentTasks", new Map());
79
81
  _defineProperty(this, "attachmentTargetByStep", new WeakMap());
80
82
  _defineProperty(this, "pwStepUuid", new WeakMap());
83
+ _defineProperty(this, "testFullNames", new WeakMap());
81
84
  _defineProperty(this, "emittedHookGlobalErrorKeys", new Set());
82
85
  _defineProperty(this, "testPlan", (0, _reporter.parseTestPlan)());
83
86
  this.options = _objectSpread({
@@ -86,74 +89,116 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
86
89
  }, config);
87
90
  }
88
91
  return _createClass(AllureReporter, [{
92
+ key: "preprocess",
93
+ value: function () {
94
+ var _preprocess = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
95
+ var suite, testRun, readonlyProjectNames, _iterator, _step, projectSuite, project, _iterator2, _step2, _projectSuite, _project, readonlyProject, _iterator3, _step3, test, metadata, _t, _t2;
96
+ return _regenerator().w(function (_context) {
97
+ while (1) switch (_context.n) {
98
+ case 0:
99
+ suite = _ref.suite, testRun = _ref.testRun;
100
+ if (this.testPlan) {
101
+ _context.n = 1;
102
+ break;
103
+ }
104
+ return _context.a(2);
105
+ case 1:
106
+ readonlyProjectNames = new Set();
107
+ _iterator = _createForOfIteratorHelper(suite.suites);
108
+ try {
109
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
110
+ projectSuite = _step.value;
111
+ project = projectSuite.project();
112
+ project === null || project === void 0 || project.dependencies.forEach(function (dependency) {
113
+ return readonlyProjectNames.add(dependency);
114
+ });
115
+ if (project !== null && project !== void 0 && project.teardown) {
116
+ readonlyProjectNames.add(project.teardown);
117
+ }
118
+ }
119
+ } catch (err) {
120
+ _iterator.e(err);
121
+ } finally {
122
+ _iterator.f();
123
+ }
124
+ _iterator2 = _createForOfIteratorHelper(suite.suites);
125
+ _context.p = 2;
126
+ _iterator2.s();
127
+ case 3:
128
+ if ((_step2 = _iterator2.n()).done) {
129
+ _context.n = 13;
130
+ break;
131
+ }
132
+ _projectSuite = _step2.value;
133
+ _project = _projectSuite.project();
134
+ readonlyProject = _project ? readonlyProjectNames.has(_project.name) : false;
135
+ if (!readonlyProject) {
136
+ _context.n = 4;
137
+ break;
138
+ }
139
+ return _context.a(3, 12);
140
+ case 4:
141
+ _iterator3 = _createForOfIteratorHelper(_projectSuite.allTests());
142
+ _context.p = 5;
143
+ _iterator3.s();
144
+ case 6:
145
+ if ((_step3 = _iterator3.n()).done) {
146
+ _context.n = 9;
147
+ break;
148
+ }
149
+ test = _step3.value;
150
+ metadata = this.getStaticTestMetadata(test);
151
+ if (!this.isInTestPlan(test, metadata)) {
152
+ _context.n = 7;
153
+ break;
154
+ }
155
+ return _context.a(3, 8);
156
+ case 7:
157
+ testRun.exclude(test);
158
+ case 8:
159
+ _context.n = 6;
160
+ break;
161
+ case 9:
162
+ _context.n = 11;
163
+ break;
164
+ case 10:
165
+ _context.p = 10;
166
+ _t = _context.v;
167
+ _iterator3.e(_t);
168
+ case 11:
169
+ _context.p = 11;
170
+ _iterator3.f();
171
+ return _context.f(11);
172
+ case 12:
173
+ _context.n = 3;
174
+ break;
175
+ case 13:
176
+ _context.n = 15;
177
+ break;
178
+ case 14:
179
+ _context.p = 14;
180
+ _t2 = _context.v;
181
+ _iterator2.e(_t2);
182
+ case 15:
183
+ _context.p = 15;
184
+ _iterator2.f();
185
+ return _context.f(15);
186
+ case 16:
187
+ return _context.a(2);
188
+ }
189
+ }, _callee, this, [[5, 10, 11, 12], [2, 14, 15, 16]]);
190
+ }));
191
+ function preprocess(_x) {
192
+ return _preprocess.apply(this, arguments);
193
+ }
194
+ return preprocess;
195
+ }()
196
+ }, {
89
197
  key: "onConfigure",
90
198
  value: function onConfigure(config) {
91
- var _configElement$preOnl,
92
- _this = this;
93
199
  this.config = config;
94
200
  this.outputDir = config.projects[0].outputDir;
95
201
  this.snapshotDir = config.projects[0].snapshotDir;
96
- var testPlan = this.testPlan;
97
- if (!testPlan) {
98
- return;
99
- }
100
- this.installTestPlanExecutionFilter();
101
- var configElement = Object.getOwnPropertySymbols(config).map(function (symbol) {
102
- return config[symbol];
103
- }).find(function (value) {
104
- return _typeof(value) === "object" && value !== null && ("preOnlyTestFilters" in value || "cliArgs" in value);
105
- });
106
- configElement === null || configElement === void 0 || (_configElement$preOnl = configElement.preOnlyTestFilters) === null || _configElement$preOnl === void 0 || _configElement$preOnl.push(function (test) {
107
- return _this.isInTestPlan(test);
108
- });
109
- if (testPlan.tests.some(function (test) {
110
- return test.id !== undefined;
111
- })) {
112
- return;
113
- }
114
- var testsWithSelectors = testPlan.tests.filter(function (test) {
115
- return test.selector;
116
- });
117
- var v1ReporterTests = [];
118
- var v2ReporterTests = [];
119
- var cliArgs = [];
120
- testsWithSelectors.forEach(function (test) {
121
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
122
- if (!/#/.test(test.selector)) {
123
- v2ReporterTests.push(test);
124
- return;
125
- }
126
- v1ReporterTests.push(test);
127
- });
128
-
129
- // The path needs to be specific to the current OS. Otherwise, it may not match against the test file.
130
- var selectorToGrepPattern = function selectorToGrepPattern(selector) {
131
- return (0, _reporter.escapeRegExp)(_nodePath["default"].normalize("/".concat(selector)));
132
- };
133
- if (v2ReporterTests.length) {
134
- // we need to cut off column because playwright works only with line number
135
- var v2SelectorsArgs = v2ReporterTests
136
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
137
- .map(function (test) {
138
- return test.selector.replace(/:\d+$/, "");
139
- }).map(selectorToGrepPattern);
140
- cliArgs.push.apply(cliArgs, _toConsumableArray(v2SelectorsArgs));
141
- }
142
- if (v1ReporterTests.length) {
143
- var v1SelectorsArgs = v1ReporterTests
144
- // we can filter tests only by absolute path, so we need to cut off test name
145
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
146
- .map(function (test) {
147
- return test.selector.split("#")[0];
148
- }).map(selectorToGrepPattern);
149
- cliArgs.push.apply(cliArgs, _toConsumableArray(v1SelectorsArgs));
150
- }
151
- if (!cliArgs.length) {
152
- return;
153
- }
154
- if (configElement) {
155
- configElement.cliArgs = cliArgs;
156
- }
157
202
  }
158
203
  }, {
159
204
  key: "onError",
@@ -205,21 +250,21 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
205
250
 
206
251
  // support for earlier playwright versions
207
252
  if ("tags" in test) {
208
- var _ref;
253
+ var _ref2;
209
254
  var tags = test.tags.map(function (tag) {
210
255
  return {
211
256
  name: _allureJsCommons.LabelName.TAG,
212
257
  value: tag.startsWith("@") ? tag.substring(1) : tag
213
258
  };
214
259
  });
215
- (_ref = result.labels).push.apply(_ref, _toConsumableArray(tags));
260
+ (_ref2 = result.labels).push.apply(_ref2, _toConsumableArray(tags));
216
261
  }
217
262
  if ("annotations" in test) {
218
- var _iterator = _createForOfIteratorHelper(test.annotations),
219
- _step;
263
+ var _iterator4 = _createForOfIteratorHelper(test.annotations),
264
+ _step4;
220
265
  try {
221
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
222
- var annotation = _step.value;
266
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
267
+ var annotation = _step4.value;
223
268
  if (annotation.type === "skip" || annotation.type === "fixme") {
224
269
  continue;
225
270
  }
@@ -259,9 +304,9 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
259
304
  });
260
305
  }
261
306
  } catch (err) {
262
- _iterator.e(err);
307
+ _iterator4.e(err);
263
308
  } finally {
264
- _iterator.f();
309
+ _iterator4.f();
265
310
  }
266
311
  }
267
312
  if ((_metadata$project = metadata.project) !== null && _metadata$project !== void 0 && _metadata$project.name) {
@@ -291,26 +336,26 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
291
336
  }, {
292
337
  key: "flushAttachmentTasks",
293
338
  value: function () {
294
- var _flushAttachmentTasks = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(testId) {
339
+ var _flushAttachmentTasks = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(testId) {
295
340
  var _this$pendingAttachme2;
296
341
  var tasks;
297
- return _regenerator().w(function (_context) {
298
- while (1) switch (_context.n) {
342
+ return _regenerator().w(function (_context2) {
343
+ while (1) switch (_context2.n) {
299
344
  case 0:
300
345
  tasks = (_this$pendingAttachme2 = this.pendingAttachmentTasks.get(testId)) !== null && _this$pendingAttachme2 !== void 0 ? _this$pendingAttachme2 : [];
301
346
  this.pendingAttachmentTasks["delete"](testId);
302
347
  if (!(tasks.length > 0)) {
303
- _context.n = 1;
348
+ _context2.n = 1;
304
349
  break;
305
350
  }
306
- _context.n = 1;
351
+ _context2.n = 1;
307
352
  return Promise.all(tasks);
308
353
  case 1:
309
- return _context.a(2);
354
+ return _context2.a(2);
310
355
  }
311
- }, _callee, this);
356
+ }, _callee2, this);
312
357
  }));
313
- function flushAttachmentTasks(_x) {
358
+ function flushAttachmentTasks(_x2) {
314
359
  return _flushAttachmentTasks.apply(this, arguments);
315
360
  }
316
361
  return flushAttachmentTasks;
@@ -338,19 +383,19 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
338
383
  steps.splice(index, 1);
339
384
  return true;
340
385
  }
341
- var _iterator2 = _createForOfIteratorHelper(steps),
342
- _step2;
386
+ var _iterator5 = _createForOfIteratorHelper(steps),
387
+ _step5;
343
388
  try {
344
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
345
- var step = _step2.value;
389
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
390
+ var step = _step5.value;
346
391
  if (this.removeHookAttachmentPlaceholder(step.steps, stepUuid)) {
347
392
  return true;
348
393
  }
349
394
  }
350
395
  } catch (err) {
351
- _iterator2.e(err);
396
+ _iterator5.e(err);
352
397
  } finally {
353
- _iterator2.f();
398
+ _iterator5.f();
354
399
  }
355
400
  return false;
356
401
  }
@@ -375,13 +420,13 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
375
420
  }, {
376
421
  key: "addRuntimeAttachmentToHookStack",
377
422
  value: function addRuntimeAttachmentToHookStack(targetStack, attachment, options) {
378
- var _this2 = this;
423
+ var _this = this;
379
424
  var currentStep = targetStack.currentStep();
380
425
  if (!currentStep) {
381
426
  return;
382
427
  }
383
428
  var addAttachment = function addAttachment(stepResult) {
384
- var fileName = targetStack.addAttachment(attachment, _this2.allureRuntime.writer);
429
+ var fileName = targetStack.addAttachment(attachment, _this.allureRuntime.writer);
385
430
  stepResult.attachments.push({
386
431
  name: attachment.name,
387
432
  type: attachment.contentType,
@@ -499,12 +544,12 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
499
544
  }
500
545
  return;
501
546
  }
502
- var _iterator3 = _createForOfIteratorHelper(stepAttachments),
503
- _step3;
547
+ var _iterator6 = _createForOfIteratorHelper(stepAttachments),
548
+ _step6;
504
549
  try {
505
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
550
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
506
551
  var _stepInfo$hookStep$uu, _stepInfo$hookStep;
507
- var attachment = _step3.value;
552
+ var attachment = _step6.value;
508
553
  var isRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
509
554
  var attachmentTarget = _objectSpread(_objectSpread({}, stepInfo), {}, {
510
555
  name: attachment.name
@@ -528,9 +573,9 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
528
573
  this.queueAttachmentTask(test.id, this.processAttachment(testUuid, attachmentStepUuid, attachment));
529
574
  }
530
575
  } catch (err) {
531
- _iterator3.e(err);
576
+ _iterator6.e(err);
532
577
  } finally {
533
- _iterator3.f();
578
+ _iterator6.f();
534
579
  }
535
580
  }
536
581
  }, {
@@ -688,21 +733,21 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
688
733
  }, {
689
734
  key: "onTestEnd",
690
735
  value: function () {
691
- var _onTestEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(test, result) {
692
- var _this3 = this,
736
+ var _onTestEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(test, result) {
737
+ var _this2 = this,
693
738
  _this$attachmentTarge2;
694
- 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;
695
- return _regenerator().w(function (_context2) {
696
- while (1) switch (_context2.n) {
739
+ var testUuid, threadId, thread, error, _test$parent$titlePat, _test$parent$titlePat2, projectSuiteTitle, fileSuiteTitle, suiteTitles, beforeHooksStack, afterHooksStack, targets, targetsByName, _iterator7, _step7, _targetsByName$get, t, q, takeByName, _iterator8, _step8, attachment, isRuntimeMessage, stepInfo, _stepInfo$hookStep$uu2, _stepInfo$hookStep2, message, targetStack, _targetStack, stepUuid, _targetStack2, stepResult, fileName, _t3;
740
+ return _regenerator().w(function (_context3) {
741
+ while (1) switch (_context3.n) {
697
742
  case 0:
698
743
  testUuid = this.allureResultsUuids.get(test.id);
699
744
  if (testUuid) {
700
- _context2.n = 1;
745
+ _context3.n = 1;
701
746
  break;
702
747
  }
703
748
  // eslint-disable-next-line no-console
704
749
  console.warn("[allure-playwright] Ignoring onTestEnd for \"".concat(test.title, "\" because no Allure test result has been started."));
705
- return _context2.a(2);
750
+ return _context3.a(2);
706
751
  case 1:
707
752
  // We need to check parallelIndex first because pw introduced this field only in v1.30.0
708
753
  threadId = result.parallelIndex !== undefined ? result.parallelIndex : result.workerIndex;
@@ -720,7 +765,7 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
720
765
  value: projectSuiteTitle
721
766
  });
722
767
  }
723
- if (_this3.options.suiteTitle && fileSuiteTitle && !(0, _sdk.hasLabel)(testResult, _allureJsCommons.LabelName.SUITE)) {
768
+ if (_this2.options.suiteTitle && fileSuiteTitle && !(0, _sdk.hasLabel)(testResult, _allureJsCommons.LabelName.SUITE)) {
724
769
  testResult.labels.push({
725
770
  name: _allureJsCommons.LabelName.SUITE,
726
771
  value: fileSuiteTitle
@@ -769,18 +814,18 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
769
814
  // FIFO
770
815
  targets = (_this$attachmentTarge2 = this.attachmentTargets.get(test.id)) !== null && _this$attachmentTarge2 !== void 0 ? _this$attachmentTarge2 : [];
771
816
  targetsByName = new Map();
772
- _iterator4 = _createForOfIteratorHelper(targets);
817
+ _iterator7 = _createForOfIteratorHelper(targets);
773
818
  try {
774
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
775
- t = _step4.value;
819
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
820
+ t = _step7.value;
776
821
  q = (_targetsByName$get = targetsByName.get(t.name)) !== null && _targetsByName$get !== void 0 ? _targetsByName$get : [];
777
822
  q.push(t);
778
823
  targetsByName.set(t.name, q);
779
824
  }
780
825
  } catch (err) {
781
- _iterator4.e(err);
826
+ _iterator7.e(err);
782
827
  } finally {
783
- _iterator4.f();
828
+ _iterator7.f();
784
829
  }
785
830
  takeByName = function takeByName(name) {
786
831
  var target = targetsByName.get(name);
@@ -789,25 +834,25 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
789
834
  }
790
835
  return target.shift();
791
836
  };
792
- _iterator5 = _createForOfIteratorHelper(result.attachments);
793
- _context2.p = 2;
794
- _iterator5.s();
837
+ _iterator8 = _createForOfIteratorHelper(result.attachments);
838
+ _context3.p = 2;
839
+ _iterator8.s();
795
840
  case 3:
796
- if ((_step5 = _iterator5.n()).done) {
797
- _context2.n = 12;
841
+ if ((_step8 = _iterator8.n()).done) {
842
+ _context3.n = 12;
798
843
  break;
799
844
  }
800
- attachment = _step5.value;
845
+ attachment = _step8.value;
801
846
  isRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
802
847
  stepInfo = takeByName(attachment.name);
803
848
  if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.processedAtStepEnd)) {
804
- _context2.n = 4;
849
+ _context3.n = 4;
805
850
  break;
806
851
  }
807
- return _context2.a(3, 11);
852
+ return _context3.a(3, 11);
808
853
  case 4:
809
854
  if (!isRuntimeMessage) {
810
- _context2.n = 7;
855
+ _context3.n = 7;
811
856
  break;
812
857
  }
813
858
  message = attachment.body ? JSON.parse(attachment.body.toString()) : undefined;
@@ -816,7 +861,7 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
816
861
  this.removeStepFromHookStack(targetStack, stepInfo.hookStep.uuid);
817
862
  }
818
863
  if (!((message === null || message === void 0 ? void 0 : message.type) === "step_metadata" && stepInfo !== null && stepInfo !== void 0 && stepInfo.stepUuid)) {
819
- _context2.n = 5;
864
+ _context3.n = 5;
820
865
  break;
821
866
  }
822
867
  if (stepInfo.hookStep) {
@@ -825,16 +870,16 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
825
870
  } else {
826
871
  this.processStepMetadataMessage(stepInfo.stepUuid, message);
827
872
  }
828
- return _context2.a(3, 11);
873
+ return _context3.a(3, 11);
829
874
  case 5:
830
875
  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;
831
- _context2.n = 6;
876
+ _context3.n = 6;
832
877
  return this.processAttachment(testUuid, stepUuid, attachment);
833
878
  case 6:
834
- return _context2.a(3, 11);
879
+ return _context3.a(3, 11);
835
880
  case 7:
836
881
  if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.hookStep)) {
837
- _context2.n = 8;
882
+ _context3.n = 8;
838
883
  break;
839
884
  }
840
885
  _targetStack2 = this.getHookStepsStack(test.id, stepInfo.hookStep);
@@ -849,35 +894,35 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
849
894
  });
850
895
  }
851
896
  }
852
- return _context2.a(3, 11);
897
+ return _context3.a(3, 11);
853
898
  case 8:
854
899
  if (!(stepInfo !== null && stepInfo !== void 0 && stepInfo.stepUuid)) {
855
- _context2.n = 10;
900
+ _context3.n = 10;
856
901
  break;
857
902
  }
858
- _context2.n = 9;
903
+ _context3.n = 9;
859
904
  return this.processAttachment(testUuid, stepInfo.stepUuid, attachment);
860
905
  case 9:
861
- return _context2.a(3, 11);
906
+ return _context3.a(3, 11);
862
907
  case 10:
863
- _context2.n = 11;
908
+ _context3.n = 11;
864
909
  return this.processAttachment(testUuid, undefined, attachment);
865
910
  case 11:
866
- _context2.n = 3;
911
+ _context3.n = 3;
867
912
  break;
868
913
  case 12:
869
- _context2.n = 14;
914
+ _context3.n = 14;
870
915
  break;
871
916
  case 13:
872
- _context2.p = 13;
873
- _t = _context2.v;
874
- _iterator5.e(_t);
917
+ _context3.p = 13;
918
+ _t3 = _context3.v;
919
+ _iterator8.e(_t3);
875
920
  case 14:
876
- _context2.p = 14;
877
- _iterator5.f();
878
- return _context2.f(14);
921
+ _context3.p = 14;
922
+ _iterator8.f();
923
+ return _context3.f(14);
879
924
  case 15:
880
- _context2.n = 16;
925
+ _context3.n = 16;
881
926
  return this.flushAttachmentTasks(test.id);
882
927
  case 16:
883
928
  // FIXME: temp logic for labels override, we need it here to keep the reporter compatible with v2 API
@@ -899,14 +944,14 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
899
944
  });
900
945
  if (beforeHooksStack) {
901
946
  var _testResult$steps;
902
- (_testResult$steps = testResult.steps).unshift.apply(_testResult$steps, _toConsumableArray(_this3.pruneEmptyHookRoots(beforeHooksStack.steps)));
947
+ (_testResult$steps = testResult.steps).unshift.apply(_testResult$steps, _toConsumableArray(_this2.pruneEmptyHookRoots(beforeHooksStack.steps)));
903
948
  }
904
- _this3.beforeHooksStepsStack["delete"](test.id);
949
+ _this2.beforeHooksStepsStack["delete"](test.id);
905
950
  if (afterHooksStack) {
906
951
  var _testResult$steps2;
907
- (_testResult$steps2 = testResult.steps).push.apply(_testResult$steps2, _toConsumableArray(_this3.pruneEmptyHookRoots(afterHooksStack.steps)));
952
+ (_testResult$steps2 = testResult.steps).push.apply(_testResult$steps2, _toConsumableArray(_this2.pruneEmptyHookRoots(afterHooksStack.steps)));
908
953
  }
909
- _this3.afterHooksStepsStack["delete"](test.id);
954
+ _this2.afterHooksStepsStack["delete"](test.id);
910
955
  testResult.labels = newLabels;
911
956
  });
912
957
  this.allureRuntime.stopTest(testUuid, {
@@ -916,11 +961,11 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
916
961
  this.attachmentTargets["delete"](test.id);
917
962
  this.pendingAttachmentTasks["delete"](test.id);
918
963
  case 17:
919
- return _context2.a(2);
964
+ return _context3.a(2);
920
965
  }
921
- }, _callee2, this, [[2, 13, 14, 15]]);
966
+ }, _callee3, this, [[2, 13, 14, 15]]);
922
967
  }));
923
- function onTestEnd(_x2, _x3) {
968
+ function onTestEnd(_x3, _x4) {
924
969
  return _onTestEnd.apply(this, arguments);
925
970
  }
926
971
  return onTestEnd;
@@ -943,28 +988,28 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
943
988
  }, {
944
989
  key: "addSkippedResults",
945
990
  value: function () {
946
- var _addSkippedResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
947
- var _this4 = this;
948
- var unprocessedCases, _iterator6, _step6, testCase, _t2;
949
- return _regenerator().w(function (_context3) {
950
- while (1) switch (_context3.n) {
991
+ var _addSkippedResults = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
992
+ var _this3 = this;
993
+ var unprocessedCases, _iterator9, _step9, testCase, _t4;
994
+ return _regenerator().w(function (_context4) {
995
+ while (1) switch (_context4.n) {
951
996
  case 0:
952
997
  unprocessedCases = this.suite.allTests().filter(function (testCase) {
953
998
  var title = testCase.title;
954
999
  var titleMetadata = (0, _sdk.extractMetadataFromString)(title);
955
- return !_this4.startedTestCasesTitlesCache.includes(titleMetadata.cleanTitle);
1000
+ return !_this3.startedTestCasesTitlesCache.includes(titleMetadata.cleanTitle);
956
1001
  });
957
- _iterator6 = _createForOfIteratorHelper(unprocessedCases);
958
- _context3.p = 1;
959
- _iterator6.s();
1002
+ _iterator9 = _createForOfIteratorHelper(unprocessedCases);
1003
+ _context4.p = 1;
1004
+ _iterator9.s();
960
1005
  case 2:
961
- if ((_step6 = _iterator6.n()).done) {
962
- _context3.n = 4;
1006
+ if ((_step9 = _iterator9.n()).done) {
1007
+ _context4.n = 4;
963
1008
  break;
964
1009
  }
965
- testCase = _step6.value;
1010
+ testCase = _step9.value;
966
1011
  this.onTestBegin(testCase);
967
- _context3.n = 3;
1012
+ _context4.n = 3;
968
1013
  return this.onTestEnd(testCase, {
969
1014
  status: _allureJsCommons.Status.SKIPPED,
970
1015
  attachments: [],
@@ -980,23 +1025,23 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
980
1025
  annotations: []
981
1026
  });
982
1027
  case 3:
983
- _context3.n = 2;
1028
+ _context4.n = 2;
984
1029
  break;
985
1030
  case 4:
986
- _context3.n = 6;
1031
+ _context4.n = 6;
987
1032
  break;
988
1033
  case 5:
989
- _context3.p = 5;
990
- _t2 = _context3.v;
991
- _iterator6.e(_t2);
1034
+ _context4.p = 5;
1035
+ _t4 = _context4.v;
1036
+ _iterator9.e(_t4);
992
1037
  case 6:
993
- _context3.p = 6;
994
- _iterator6.f();
995
- return _context3.f(6);
1038
+ _context4.p = 6;
1039
+ _iterator9.f();
1040
+ return _context4.f(6);
996
1041
  case 7:
997
- return _context3.a(2);
1042
+ return _context4.a(2);
998
1043
  }
999
- }, _callee3, this, [[1, 5, 6, 7]]);
1044
+ }, _callee4, this, [[1, 5, 6, 7]]);
1000
1045
  }));
1001
1046
  function addSkippedResults() {
1002
1047
  return _addSkippedResults.apply(this, arguments);
@@ -1006,19 +1051,19 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1006
1051
  }, {
1007
1052
  key: "onEnd",
1008
1053
  value: function () {
1009
- var _onEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
1010
- return _regenerator().w(function (_context4) {
1011
- while (1) switch (_context4.n) {
1054
+ var _onEnd = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
1055
+ return _regenerator().w(function (_context5) {
1056
+ while (1) switch (_context5.n) {
1012
1057
  case 0:
1013
- _context4.n = 1;
1058
+ _context5.n = 1;
1014
1059
  return this.addSkippedResults();
1015
1060
  case 1:
1016
1061
  this.allureRuntime.writeEnvironmentInfo();
1017
1062
  this.allureRuntime.writeCategoriesDefinitions();
1018
1063
  case 2:
1019
- return _context4.a(2);
1064
+ return _context5.a(2);
1020
1065
  }
1021
- }, _callee4, this);
1066
+ }, _callee5, this);
1022
1067
  }));
1023
1068
  function onEnd() {
1024
1069
  return _onEnd.apply(this, arguments);
@@ -1041,19 +1086,19 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1041
1086
  }, {
1042
1087
  key: "pruneEmptyHookRoots",
1043
1088
  value: function pruneEmptyHookRoots(steps) {
1044
- var _this5 = this;
1089
+ var _this4 = this;
1045
1090
  return steps.map(function (step) {
1046
1091
  return _objectSpread(_objectSpread({}, step), {}, {
1047
- steps: _this5.pruneEmptyHookRoots(step.steps)
1092
+ steps: _this4.pruneEmptyHookRoots(step.steps)
1048
1093
  });
1049
1094
  }).filter(function (step) {
1050
- return !_this5.isEmptyPassedHookRoot(step);
1095
+ return !_this4.isEmptyPassedHookRoot(step);
1051
1096
  });
1052
1097
  }
1053
1098
  }, {
1054
1099
  key: "removeStepFromHookStack",
1055
1100
  value: function removeStepFromHookStack(stack, stepUuid) {
1056
- var _this6 = this;
1101
+ var _this5 = this;
1057
1102
  if (!stack) {
1058
1103
  return;
1059
1104
  }
@@ -1065,49 +1110,46 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1065
1110
  steps: _removeRecursively(step.steps)
1066
1111
  });
1067
1112
  }).filter(function (step) {
1068
- return !_this6.isEmptyPassedHookRoot(step);
1113
+ return !_this5.isEmptyPassedHookRoot(step);
1069
1114
  });
1070
1115
  };
1071
1116
  stack.steps = _removeRecursively(stack.steps);
1072
1117
  }
1073
1118
  }, {
1074
1119
  key: "getStaticTestMetadata",
1075
- value: function getStaticTestMetadata(test, parentSuite) {
1076
- var _ref2, _testParent$project, _testParent$titlePath, _titleMetadata$labels;
1120
+ value: function getStaticTestMetadata(test) {
1121
+ var _ref3, _test$parent$project, _titleMetadata$labels;
1077
1122
  var titleMetadata = (0, _sdk.extractMetadataFromString)(test.title);
1078
- var testParent = parentSuite !== null && parentSuite !== void 0 ? parentSuite : test.parent;
1079
- var project = (_ref2 = (_testParent$project = testParent === null || testParent === void 0 ? void 0 : testParent.project()) !== null && _testParent$project !== void 0 ? _testParent$project : this.config.projects.find(function (candidate) {
1123
+ var project = (_ref3 = (_test$parent$project = test.parent.project()) !== null && _test$parent$project !== void 0 ? _test$parent$project : this.config.projects.find(function (candidate) {
1080
1124
  return test.location.file === candidate.testDir || test.location.file.startsWith("".concat(candidate.testDir).concat(_nodePath["default"].sep));
1081
- })) !== null && _ref2 !== void 0 ? _ref2 : this.config.projects[0];
1125
+ })) !== null && _ref3 !== void 0 ? _ref3 : this.config.projects[0];
1082
1126
  var testFilePath = _nodePath["default"].relative(project.testDir, test.location.file);
1083
1127
  var relativeFileParts = testFilePath.split(_nodePath["default"].sep);
1084
1128
  var relativeFile = relativeFileParts.join("/");
1085
- var normalizedAbsoluteFile = _nodePath["default"].normalize(test.location.file);
1086
- var normalizedRelativeFile = _nodePath["default"].normalize(testFilePath);
1087
- var fileTitleCandidates = new Set([normalizedAbsoluteFile, normalizedRelativeFile, relativeFile]);
1088
- var suiteTitles = (_testParent$titlePath = testParent === null || testParent === void 0 ? void 0 : testParent.titlePath().filter(Boolean)) !== null && _testParent$titlePath !== void 0 ? _testParent$titlePath : [];
1089
- if (project.name && suiteTitles[0] === project.name) {
1090
- suiteTitles = suiteTitles.slice(1);
1091
- }
1092
- if (suiteTitles.length > 0 && fileTitleCandidates.has(_nodePath["default"].normalize(suiteTitles[0]))) {
1093
- suiteTitles = suiteTitles.slice(1);
1094
- }
1129
+ var suiteTitles = test.titlePath().slice(3, -1);
1095
1130
  var suitePrefix = suiteTitles.length > 0 ? "".concat(suiteTitles.join(" "), " ") : "";
1096
1131
  var projectRootSearchFrom = _nodePath["default"].dirname(test.location.file);
1097
1132
  var projectName = (0, _reporter.getProjectName)(projectRootSearchFrom);
1098
1133
  var testCaseIdBase = "".concat(relativeFile, "#").concat(suitePrefix).concat(test.title);
1099
1134
  var legacyFullName = "".concat(relativeFile, "#").concat(suitePrefix).concat(titleMetadata.cleanTitle);
1135
+ var locationFullName = "".concat(relativeFile, ":").concat(test.location.line, ":").concat(test.location.column);
1136
+ var fullName = this.testFullNames.get(test);
1100
1137
  var staticAllureId = (_titleMetadata$labels = titleMetadata.labels.find(function (label) {
1101
1138
  return label.name === _allureJsCommons.LabelName.ALLURE_ID;
1102
1139
  })) === null || _titleMetadata$labels === void 0 ? void 0 : _titleMetadata$labels.value;
1140
+ if (!fullName) {
1141
+ var testFile = _nodePath["default"].relative(this.config.rootDir, test.location.file).split(_nodePath["default"].sep).join("/");
1142
+ fullName = [testFile].concat(_toConsumableArray(test.titlePath().slice(3))).join(" › ");
1143
+ this.testFullNames.set(test, fullName);
1144
+ }
1103
1145
 
1104
1146
  // Test-plan matching happens during discovery, so runtime API labels are intentionally excluded here.
1105
1147
  if (!staticAllureId && "annotations" in test) {
1106
- var _iterator7 = _createForOfIteratorHelper(test.annotations),
1107
- _step7;
1148
+ var _iterator0 = _createForOfIteratorHelper(test.annotations),
1149
+ _step0;
1108
1150
  try {
1109
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1110
- var annotation = _step7.value;
1151
+ for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
1152
+ var annotation = _step0.value;
1111
1153
  var label = (0, _sdk.getMetadataLabel)(annotation.type, annotation.description);
1112
1154
  if ((label === null || label === void 0 ? void 0 : label.name) === _allureJsCommons.LabelName.ALLURE_ID) {
1113
1155
  staticAllureId = label.value;
@@ -1115,9 +1157,9 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1115
1157
  }
1116
1158
  }
1117
1159
  } catch (err) {
1118
- _iterator7.e(err);
1160
+ _iterator0.e(err);
1119
1161
  } finally {
1120
- _iterator7.f();
1162
+ _iterator0.f();
1121
1163
  }
1122
1164
  }
1123
1165
  return {
@@ -1130,81 +1172,32 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1130
1172
  testCaseIdBase: projectName ? "".concat(projectName, ":").concat(testCaseIdBase) : testCaseIdBase,
1131
1173
  legacyTestCaseIdBase: testCaseIdBase,
1132
1174
  titleMetadata: titleMetadata,
1133
- fullName: "".concat(relativeFile, ":").concat(test.location.line, ":").concat(test.location.column),
1175
+ fullName: fullName,
1176
+ locationFullName: locationFullName,
1134
1177
  legacyFullName: legacyFullName,
1135
1178
  staticAllureId: staticAllureId
1136
1179
  };
1137
1180
  }
1138
1181
  }, {
1139
1182
  key: "isInTestPlan",
1140
- value: function isInTestPlan(test, parentSuite) {
1183
+ value: function isInTestPlan(test) {
1184
+ var metadata = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getStaticTestMetadata(test);
1141
1185
  if (!this.testPlan) {
1142
1186
  return true;
1143
1187
  }
1144
- var _this$getStaticTestMe = this.getStaticTestMetadata(test, parentSuite),
1145
- fullName = _this$getStaticTestMe.fullName,
1146
- legacyFullName = _this$getStaticTestMe.legacyFullName,
1147
- staticAllureId = _this$getStaticTestMe.staticAllureId;
1188
+ var fullName = metadata.fullName,
1189
+ locationFullName = metadata.locationFullName,
1190
+ legacyFullName = metadata.legacyFullName,
1191
+ staticAllureId = metadata.staticAllureId;
1148
1192
  return (0, _reporter.includedInTestPlan)(this.testPlan, {
1149
- fullName: fullName,
1193
+ fullName: locationFullName,
1194
+ nativeSelector: fullName,
1150
1195
  id: staticAllureId
1151
1196
  }) || (0, _reporter.includedInTestPlan)(this.testPlan, {
1152
1197
  fullName: legacyFullName,
1153
1198
  id: staticAllureId
1154
1199
  });
1155
1200
  }
1156
- }, {
1157
- key: "installTestPlanExecutionFilter",
1158
- value: function installTestPlanExecutionFilter() {
1159
- var _this7 = this;
1160
- var suitePrototype = this.getPlaywrightSuitePrototype();
1161
- if (!(suitePrototype !== null && suitePrototype !== void 0 && suitePrototype._addTest)) {
1162
- // eslint-disable-next-line no-console
1163
- console.warn("[allure-playwright] Could not install the test plan execution filter because Playwright " + "Suite.prototype._addTest was not found. Tests outside ALLURE_TESTPLAN_PATH may still run. " + "Please report this compatibility issue to https://github.com/allure-framework/allure-js/issues.");
1164
- return;
1165
- }
1166
- var patchedSuitePrototype = suitePrototype;
1167
- patchedSuitePrototype[testPlanFilterSymbol] = function (test, parentSuite) {
1168
- return _this7.isInTestPlan(test, parentSuite);
1169
- };
1170
- if (patchedSuitePrototype[testPlanFilterPatchSymbol]) {
1171
- return;
1172
- }
1173
- var addTest = suitePrototype._addTest;
1174
-
1175
- // Dear Pavel: break us all day long you may; find the way back, my Codex and I always will.
1176
- suitePrototype._addTest = function (test) {
1177
- var testPlanFilter = patchedSuitePrototype[testPlanFilterSymbol];
1178
- if (testPlanFilter && !testPlanFilter(test, this)) {
1179
- return;
1180
- }
1181
- return addTest.call(this, test);
1182
- };
1183
- patchedSuitePrototype[testPlanFilterPatchSymbol] = true;
1184
- }
1185
- }, {
1186
- key: "getPlaywrightSuitePrototype",
1187
- value: function getPlaywrightSuitePrototype() {
1188
- var playwrightTestRequire = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _nodeModule.createRequire)(localRequire.resolve("@playwright/test"));
1189
- try {
1190
- var _playwrightCommon$tes;
1191
- var playwrightCommon = playwrightTestRequire("playwright/lib/common");
1192
- var suitePrototype = (_playwrightCommon$tes = playwrightCommon.test) === null || _playwrightCommon$tes === void 0 || (_playwrightCommon$tes = _playwrightCommon$tes.Suite) === null || _playwrightCommon$tes === void 0 ? void 0 : _playwrightCommon$tes.prototype;
1193
- if (suitePrototype) {
1194
- return suitePrototype;
1195
- }
1196
- } catch (_unused) {
1197
- // Playwright 1.53-1.59 didn't export playwright/lib/common, but the Suite lived in lib/common/test.js.
1198
- }
1199
- try {
1200
- var _playwrightCommonTest;
1201
- var playwrightPackagePath = playwrightTestRequire.resolve("playwright/package.json");
1202
- var playwrightCommonTest = playwrightTestRequire(_nodePath["default"].join(_nodePath["default"].dirname(playwrightPackagePath), "lib/common/test.js"));
1203
- return (_playwrightCommonTest = playwrightCommonTest.Suite) === null || _playwrightCommonTest === void 0 ? void 0 : _playwrightCommonTest.prototype;
1204
- } catch (_unused2) {
1205
- return undefined;
1206
- }
1207
- }
1208
1201
  }, {
1209
1202
  key: "processStepMetadataMessage",
1210
1203
  value: function processStepMetadataMessage(attachmentStepUuid, message) {
@@ -1240,32 +1233,32 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1240
1233
  }, {
1241
1234
  key: "processAttachment",
1242
1235
  value: function () {
1243
- var _processAttachment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(testUuid, attachmentStepUuid, attachment) {
1236
+ var _processAttachment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(testUuid, attachmentStepUuid, attachment) {
1244
1237
  var _replace;
1245
1238
  var allureRuntimeMessage, message, parentUuid, contentType, pathWithoutEndFromSnapshotDir, pathWithoutEnd, fileExists, readImageFromDirs, actualBase64, expectedBase64, diffBase64, diffName;
1246
- return _regenerator().w(function (_context7) {
1247
- while (1) switch (_context7.n) {
1239
+ return _regenerator().w(function (_context8) {
1240
+ while (1) switch (_context8.n) {
1248
1241
  case 0:
1249
1242
  if (!(!attachment.body && !attachment.path)) {
1250
- _context7.n = 1;
1243
+ _context8.n = 1;
1251
1244
  break;
1252
1245
  }
1253
- return _context7.a(2);
1246
+ return _context8.a(2);
1254
1247
  case 1:
1255
1248
  allureRuntimeMessage = attachment.contentType === _reporter.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
1256
1249
  if (!(allureRuntimeMessage && !attachment.body)) {
1257
- _context7.n = 2;
1250
+ _context8.n = 2;
1258
1251
  break;
1259
1252
  }
1260
- return _context7.a(2);
1253
+ return _context8.a(2);
1261
1254
  case 2:
1262
1255
  if (!allureRuntimeMessage) {
1263
- _context7.n = 3;
1256
+ _context8.n = 3;
1264
1257
  break;
1265
1258
  }
1266
1259
  message = JSON.parse(attachment.body.toString());
1267
1260
  this.allureRuntime.applyRuntimeMessages(testUuid, [message]);
1268
- return _context7.a(2);
1261
+ return _context8.a(2);
1269
1262
  case 3:
1270
1263
  parentUuid = this.allureRuntime.startStep(testUuid, attachmentStepUuid, {
1271
1264
  name: attachment.name
@@ -1276,20 +1269,20 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1276
1269
  this.allureRuntime.stopStep(parentUuid, undefined);
1277
1270
  }
1278
1271
  if (!attachment.body) {
1279
- _context7.n = 4;
1272
+ _context8.n = 4;
1280
1273
  break;
1281
1274
  }
1282
1275
  this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.body, {
1283
1276
  contentType: attachment.contentType
1284
1277
  });
1285
- _context7.n = 6;
1278
+ _context8.n = 6;
1286
1279
  break;
1287
1280
  case 4:
1288
1281
  if ((0, _nodeFs.existsSync)(attachment.path)) {
1289
- _context7.n = 5;
1282
+ _context8.n = 5;
1290
1283
  break;
1291
1284
  }
1292
- return _context7.a(2);
1285
+ return _context8.a(2);
1293
1286
  case 5:
1294
1287
  contentType = attachment.name === "trace" && attachment.contentType === "application/zip" ? _allureJsCommons.ContentType.PLAYWRIGHT_TRACE : attachment.contentType;
1295
1288
  this.allureRuntime.writeAttachment(testUuid, parentUuid, attachment.name, attachment.path, {
@@ -1297,91 +1290,91 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1297
1290
  });
1298
1291
  case 6:
1299
1292
  if (attachment.name.match(_utils.diffEndRegexp)) {
1300
- _context7.n = 7;
1293
+ _context8.n = 7;
1301
1294
  break;
1302
1295
  }
1303
- return _context7.a(2);
1296
+ return _context8.a(2);
1304
1297
  case 7:
1305
1298
  pathWithoutEndFromSnapshotDir = (_replace = attachment.path.replace(this.outputDir, this.snapshotDir)) === null || _replace === void 0 ? void 0 : _replace.replace(_utils.diffEndRegexp, "").replace(/\.png/, "");
1306
1299
  pathWithoutEnd = attachment.path.replace(_utils.diffEndRegexp, "").replace(/\.png/, "");
1307
1300
  if (!(this.processedDiffs.includes(pathWithoutEnd) || this.processedDiffs.includes(pathWithoutEndFromSnapshotDir))) {
1308
- _context7.n = 8;
1301
+ _context8.n = 8;
1309
1302
  break;
1310
1303
  }
1311
- return _context7.a(2);
1304
+ return _context8.a(2);
1312
1305
  case 8:
1313
1306
  fileExists = /*#__PURE__*/function () {
1314
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(filePath) {
1315
- return _regenerator().w(function (_context5) {
1316
- while (1) switch (_context5.n) {
1307
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(filePath) {
1308
+ return _regenerator().w(function (_context6) {
1309
+ while (1) switch (_context6.n) {
1317
1310
  case 0:
1318
- _context5.n = 1;
1311
+ _context6.n = 1;
1319
1312
  return (0, _promises.access)(filePath).then(function () {
1320
1313
  return true;
1321
1314
  })["catch"](function () {
1322
1315
  return false;
1323
1316
  });
1324
1317
  case 1:
1325
- return _context5.a(2, _context5.v);
1318
+ return _context6.a(2, _context6.v);
1326
1319
  }
1327
- }, _callee5);
1320
+ }, _callee6);
1328
1321
  }));
1329
- return function fileExists(_x7) {
1330
- return _ref3.apply(this, arguments);
1322
+ return function fileExists(_x8) {
1323
+ return _ref4.apply(this, arguments);
1331
1324
  };
1332
1325
  }();
1333
1326
  readImageFromDirs = /*#__PURE__*/function () {
1334
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(modifier) {
1327
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(modifier) {
1335
1328
  var defaultPath, snapshotPath;
1336
- return _regenerator().w(function (_context6) {
1337
- while (1) switch (_context6.n) {
1329
+ return _regenerator().w(function (_context7) {
1330
+ while (1) switch (_context7.n) {
1338
1331
  case 0:
1339
1332
  defaultPath = "".concat(pathWithoutEnd, "-").concat(modifier, ".png");
1340
1333
  snapshotPath = "".concat(pathWithoutEndFromSnapshotDir, "-").concat(modifier, ".png");
1341
- _context6.n = 1;
1334
+ _context7.n = 1;
1342
1335
  return fileExists(defaultPath);
1343
1336
  case 1:
1344
- if (!_context6.v) {
1345
- _context6.n = 3;
1337
+ if (!_context7.v) {
1338
+ _context7.n = 3;
1346
1339
  break;
1347
1340
  }
1348
- _context6.n = 2;
1341
+ _context7.n = 2;
1349
1342
  return (0, _reporter.readImageAsBase64)(defaultPath);
1350
1343
  case 2:
1351
- return _context6.a(2, _context6.v);
1344
+ return _context7.a(2, _context7.v);
1352
1345
  case 3:
1353
- _context6.n = 4;
1346
+ _context7.n = 4;
1354
1347
  return fileExists(snapshotPath);
1355
1348
  case 4:
1356
- if (!_context6.v) {
1357
- _context6.n = 6;
1349
+ if (!_context7.v) {
1350
+ _context7.n = 6;
1358
1351
  break;
1359
1352
  }
1360
- _context6.n = 5;
1353
+ _context7.n = 5;
1361
1354
  return (0, _reporter.readImageAsBase64)(snapshotPath);
1362
1355
  case 5:
1363
- return _context6.a(2, _context6.v);
1356
+ return _context7.a(2, _context7.v);
1364
1357
  case 6:
1365
- return _context6.a(2, undefined);
1358
+ return _context7.a(2, undefined);
1366
1359
  }
1367
- }, _callee6);
1360
+ }, _callee7);
1368
1361
  }));
1369
- return function readImageFromDirs(_x8) {
1370
- return _ref4.apply(this, arguments);
1362
+ return function readImageFromDirs(_x9) {
1363
+ return _ref5.apply(this, arguments);
1371
1364
  };
1372
1365
  }();
1373
- _context7.n = 9;
1366
+ _context8.n = 9;
1374
1367
  return readImageFromDirs("actual");
1375
1368
  case 9:
1376
- actualBase64 = _context7.v;
1377
- _context7.n = 10;
1369
+ actualBase64 = _context8.v;
1370
+ _context8.n = 10;
1378
1371
  return readImageFromDirs("expected");
1379
1372
  case 10:
1380
- expectedBase64 = _context7.v;
1381
- _context7.n = 11;
1373
+ expectedBase64 = _context8.v;
1374
+ _context8.n = 11;
1382
1375
  return readImageFromDirs("diff");
1383
1376
  case 11:
1384
- diffBase64 = _context7.v;
1377
+ diffBase64 = _context8.v;
1385
1378
  diffName = attachment.name.replace(_utils.diffEndRegexp, "");
1386
1379
  this.allureRuntime.writeAttachment(testUuid, undefined, diffName, Buffer.from(JSON.stringify({
1387
1380
  expected: expectedBase64,
@@ -1394,11 +1387,11 @@ var AllureReporter = exports.AllureReporter = /*#__PURE__*/function () {
1394
1387
  });
1395
1388
  this.processedDiffs.push(pathWithoutEnd);
1396
1389
  case 12:
1397
- return _context7.a(2);
1390
+ return _context8.a(2);
1398
1391
  }
1399
- }, _callee7, this);
1392
+ }, _callee8, this);
1400
1393
  }));
1401
- function processAttachment(_x4, _x5, _x6) {
1394
+ function processAttachment(_x5, _x6, _x7) {
1402
1395
  return _processAttachment.apply(this, arguments);
1403
1396
  }
1404
1397
  return processAttachment;