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