allure-playwright 3.15.0 → 3.16.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/README.md +2 -2
- package/dist/cjs/index.js +21 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/testplan.js +23 -2
- package/dist/cjs/testplan.js.map +1 -1
- package/dist/esm/index.js +21 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/testplan.js +23 -2
- package/dist/esm/testplan.js.map +1 -1
- package/dist/types/testplan.d.ts +1 -1
- package/package.json +13 -10
package/dist/cjs/testplan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testplan.js","names":["_reporter","require","testPlanFilter","exports","testPlan","parseTestPlan","
|
|
1
|
+
{"version":3,"file":"testplan.js","names":["_reporter","require","testPlanFilter","exports","_testPlan$excludedTes","enableExcludedTests","arguments","length","undefined","testPlan","parseTestPlan","filters","tests","flatMap","testInfo","selector","map","pattern","replace","RegExp","concat","escapeRegExp","excludedPatterns","excludedTests","_ref","exclusionPrefix","join","filter","source"],"sources":["../../src/testplan.ts"],"sourcesContent":["import { escapeRegExp, parseTestPlan } from \"allure-js-commons/sdk/reporter\";\n\nexport const testPlanFilter = (enableExcludedTests = false) => {\n const testPlan = parseTestPlan({ enableExcludedTests });\n if (!testPlan) {\n return undefined;\n }\n\n const filters = testPlan.tests\n .flatMap((testInfo) => (testInfo.selector ? [testInfo.selector] : []))\n .map((selector) => {\n const pattern = selector.replace(\"#\", \" \");\n return new RegExp(`\\\\s${escapeRegExp(pattern)}$`);\n });\n\n if (!enableExcludedTests) {\n return filters;\n }\n\n const excludedPatterns = (testPlan.excludedTests ?? []).flatMap(({ selector }) =>\n selector ? [escapeRegExp(selector.replace(\"#\", \" \"))] : [],\n );\n if (excludedPatterns.length === 0) {\n return testPlan.tests.length === 0 ? undefined : filters;\n }\n\n const exclusionPrefix = `^(?![\\\\s\\\\S]*\\\\s(?:${excludedPatterns.join(\"|\")})$)`;\n if (testPlan.tests.length === 0) {\n return [new RegExp(`${exclusionPrefix}[\\\\s\\\\S]*$`)];\n }\n\n return filters.map((filter) => new RegExp(`${exclusionPrefix}[\\\\s\\\\S]*${filter.source}`));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEO,IAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAA,EAAoC;EAAA,IAAAE,qBAAA;EAAA,IAAhCC,mBAAmB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EACxD,IAAMG,QAAQ,GAAG,IAAAC,uBAAa,EAAC;IAAEL,mBAAmB,EAAnBA;EAAoB,CAAC,CAAC;EACvD,IAAI,CAACI,QAAQ,EAAE;IACb,OAAOD,SAAS;EAClB;EAEA,IAAMG,OAAO,GAAGF,QAAQ,CAACG,KAAK,CAC3BC,OAAO,CAAC,UAACC,QAAQ;IAAA,OAAMA,QAAQ,CAACC,QAAQ,GAAG,CAACD,QAAQ,CAACC,QAAQ,CAAC,GAAG,EAAE;EAAA,CAAC,CAAC,CACrEC,GAAG,CAAC,UAACD,QAAQ,EAAK;IACjB,IAAME,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;IAC1C,OAAO,IAAIC,MAAM,OAAAC,MAAA,CAAO,IAAAC,sBAAY,EAACJ,OAAO,CAAC,MAAG,CAAC;EACnD,CAAC,CAAC;EAEJ,IAAI,CAACZ,mBAAmB,EAAE;IACxB,OAAOM,OAAO;EAChB;EAEA,IAAMW,gBAAgB,GAAG,EAAAlB,qBAAA,GAACK,QAAQ,CAACc,aAAa,cAAAnB,qBAAA,cAAAA,qBAAA,GAAI,EAAE,EAAES,OAAO,CAAC,UAAAW,IAAA;IAAA,IAAGT,QAAQ,GAAAS,IAAA,CAART,QAAQ;IAAA,OACzEA,QAAQ,GAAG,CAAC,IAAAM,sBAAY,EAACN,QAAQ,CAACG,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE;EAAA,CAC5D,CAAC;EACD,IAAII,gBAAgB,CAACf,MAAM,KAAK,CAAC,EAAE;IACjC,OAAOE,QAAQ,CAACG,KAAK,CAACL,MAAM,KAAK,CAAC,GAAGC,SAAS,GAAGG,OAAO;EAC1D;EAEA,IAAMc,eAAe,yBAAAL,MAAA,CAAyBE,gBAAgB,CAACI,IAAI,CAAC,GAAG,CAAC,QAAK;EAC7E,IAAIjB,QAAQ,CAACG,KAAK,CAACL,MAAM,KAAK,CAAC,EAAE;IAC/B,OAAO,CAAC,IAAIY,MAAM,IAAAC,MAAA,CAAIK,eAAe,eAAY,CAAC,CAAC;EACrD;EAEA,OAAOd,OAAO,CAACK,GAAG,CAAC,UAACW,MAAM;IAAA,OAAK,IAAIR,MAAM,IAAAC,MAAA,CAAIK,eAAe,eAAAL,MAAA,CAAYO,MAAM,CAACC,MAAM,CAAE,CAAC;EAAA,EAAC;AAC3F,CAAC","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
|
@@ -59,7 +59,9 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
59
59
|
_defineProperty(this, "pwStepUuid", new WeakMap());
|
|
60
60
|
_defineProperty(this, "testFullNames", new WeakMap());
|
|
61
61
|
_defineProperty(this, "emittedHookGlobalErrorKeys", new Set());
|
|
62
|
-
_defineProperty(this, "testPlan", parseTestPlan(
|
|
62
|
+
_defineProperty(this, "testPlan", parseTestPlan({
|
|
63
|
+
enableExcludedTests: true
|
|
64
|
+
}));
|
|
63
65
|
_defineProperty(this, "replayedBlobCount", 0);
|
|
64
66
|
_defineProperty(this, "activeBlobIndex", void 0);
|
|
65
67
|
this.options = _objectSpread({
|
|
@@ -73,7 +75,7 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
73
75
|
var _preprocess = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
74
76
|
var suite, testRun, readonlyProjectNames, _iterator, _step, projectSuite, project, _iterator2, _step2, _projectSuite, _project, readonlyProject, _iterator3, _step3, test, metadata, _t, _t2;
|
|
75
77
|
return _regenerator().w(function (_context) {
|
|
76
|
-
while (1) switch (_context.n) {
|
|
78
|
+
while (1) switch (_context.p = _context.n) {
|
|
77
79
|
case 0:
|
|
78
80
|
suite = _ref.suite, testRun = _ref.testRun;
|
|
79
81
|
if (this.testPlan) {
|
|
@@ -734,7 +736,7 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
734
736
|
_this$attachmentTarge2;
|
|
735
737
|
var testUuid, threadId, blob, thread, _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;
|
|
736
738
|
return _regenerator().w(function (_context3) {
|
|
737
|
-
while (1) switch (_context3.n) {
|
|
739
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
738
740
|
case 0:
|
|
739
741
|
testUuid = this.allureResultsUuids.get(test.id);
|
|
740
742
|
if (testUuid) {
|
|
@@ -749,7 +751,7 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
749
751
|
threadId = result.parallelIndex !== undefined ? result.parallelIndex : result.workerIndex;
|
|
750
752
|
blob = this.activeBlobIndex === undefined ? "" : "-blob-".concat(this.activeBlobIndex);
|
|
751
753
|
thread = "pid-".concat(process.pid).concat(blob, "-worker-").concat(threadId); // only apply default suites if not set by user
|
|
752
|
-
_test$parent$titlePat = test.parent.titlePath(), _test$parent$titlePat2 = _toArray(_test$parent$titlePat), projectSuiteTitle = _test$parent$titlePat2[1], fileSuiteTitle = _test$parent$titlePat2[2], suiteTitles = _test$parent$titlePat2.slice(3);
|
|
754
|
+
_test$parent$titlePat = test.parent.titlePath(), _test$parent$titlePat2 = _toArray(_test$parent$titlePat), projectSuiteTitle = _test$parent$titlePat2[1], fileSuiteTitle = _test$parent$titlePat2[2], suiteTitles = _arrayLikeToArray(_test$parent$titlePat2).slice(3);
|
|
753
755
|
beforeHooksStack = this.beforeHooksStepsStack.get(test.id);
|
|
754
756
|
afterHooksStack = this.afterHooksStepsStack.get(test.id);
|
|
755
757
|
this.allureRuntime.updateTest(testUuid, function (testResult) {
|
|
@@ -1004,7 +1006,7 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
1004
1006
|
var _this3 = this;
|
|
1005
1007
|
var unprocessedCases, _iterator9, _step9, testCase, result, _t4;
|
|
1006
1008
|
return _regenerator().w(function (_context4) {
|
|
1007
|
-
while (1) switch (_context4.n) {
|
|
1009
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
1008
1010
|
case 0:
|
|
1009
1011
|
unprocessedCases = this.suite.allTests().filter(function (testCase) {
|
|
1010
1012
|
var title = testCase.title;
|
|
@@ -1195,20 +1197,31 @@ export var AllureReporter = /*#__PURE__*/function () {
|
|
|
1195
1197
|
key: "isInTestPlan",
|
|
1196
1198
|
value: function isInTestPlan(test) {
|
|
1197
1199
|
var metadata = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getStaticTestMetadata(test);
|
|
1198
|
-
|
|
1200
|
+
var testPlan = this.testPlan;
|
|
1201
|
+
if (!testPlan) {
|
|
1199
1202
|
return true;
|
|
1200
1203
|
}
|
|
1201
1204
|
var fullName = metadata.fullName,
|
|
1202
1205
|
locationFullName = metadata.locationFullName,
|
|
1203
1206
|
legacyFullName = metadata.legacyFullName,
|
|
1204
1207
|
staticAllureId = metadata.staticAllureId;
|
|
1205
|
-
|
|
1208
|
+
var subjects = [{
|
|
1206
1209
|
fullName: locationFullName,
|
|
1207
1210
|
nativeSelector: fullName,
|
|
1208
1211
|
id: staticAllureId
|
|
1209
|
-
}
|
|
1212
|
+
}, {
|
|
1210
1213
|
fullName: legacyFullName,
|
|
1211
1214
|
id: staticAllureId
|
|
1215
|
+
}];
|
|
1216
|
+
var exclusionPlan = _objectSpread(_objectSpread({}, testPlan), {}, {
|
|
1217
|
+
tests: []
|
|
1218
|
+
});
|
|
1219
|
+
return subjects.some(function (subject) {
|
|
1220
|
+
return includedInTestPlan(testPlan, subject);
|
|
1221
|
+
}) && subjects.every(function (subject) {
|
|
1222
|
+
return includedInTestPlan(exclusionPlan, subject, {
|
|
1223
|
+
enableExcludedTests: true
|
|
1224
|
+
});
|
|
1212
1225
|
});
|
|
1213
1226
|
}
|
|
1214
1227
|
}, {
|