allure-js-commons 3.2.1 → 3.3.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/model.js.map +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +34 -0
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils.js +16 -0
- package/dist/cjs/sdk/reporter/utils.js.map +1 -1
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +33 -0
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/utils.js +16 -0
- package/dist/esm/sdk/reporter/utils.js.map +1 -1
- package/dist/types/model.d.ts +4 -0
- package/dist/types/sdk/reporter/ReporterRuntime.d.ts +3 -0
- package/dist/types/sdk/reporter/utils.d.ts +12 -1
- package/package.json +3 -3
package/dist/cjs/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":["Status","exports","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n actual?: string;\n expected?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":";;;;;;AAyCA;
|
|
1
|
+
{"version":3,"file":"model.js","names":["Status","exports","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n path?: string;\n body?: Buffer;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n actual?: string;\n expected?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {\n uuid?: string;\n}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n titlePath?: string[];\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":";;;;;;AA2CA;AAyCA;AAAA,IACYA,MAAM,GAAAC,OAAA,CAAAD,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAOX,IAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,CAACF,MAAM,CAACG,MAAM,EAAEH,MAAM,CAACI,MAAM,EAAEJ,MAAM,CAACK,MAAM,EAAEL,MAAM,CAACM,OAAO,CAAC;;AAE7F;AAAA,IACYC,KAAK,GAAAN,OAAA,CAAAM,KAAA,0BAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA;AAQjB;AAAA,IACYC,SAAS,GAAAP,OAAA,CAAAO,SAAA,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AA0BrB;AAAA,IACYC,QAAQ,GAAAR,OAAA,CAAAQ,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAQpB;AAAA,IACYC,WAAW,GAAAT,OAAA,CAAAS,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAkBvB;AAAA,IACYC,QAAQ,GAAAV,OAAA,CAAAU,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ShallowStepsStack = exports.ReporterRuntime = exports.DefaultStepStack = void 0;
|
|
7
|
+
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
7
8
|
var _path = require("path");
|
|
8
9
|
var _model = require("../../model.js");
|
|
9
10
|
var _LifecycleState = require("./LifecycleState.js");
|
|
@@ -13,6 +14,7 @@ var _testplan = require("./testplan.js");
|
|
|
13
14
|
var _utils = require("./utils.js");
|
|
14
15
|
var _attachments = require("./utils/attachments.js");
|
|
15
16
|
var _loader = require("./writer/loader.js");
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
18
|
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; }
|
|
17
19
|
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; }
|
|
18
20
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
@@ -46,6 +48,9 @@ class ShallowStepsStack {
|
|
|
46
48
|
_defineProperty(this, "steps", []);
|
|
47
49
|
_classPrivateFieldInitSpec(this, _runningSteps, []);
|
|
48
50
|
}
|
|
51
|
+
currentStep() {
|
|
52
|
+
return _classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep);
|
|
53
|
+
}
|
|
49
54
|
startStep(step) {
|
|
50
55
|
var stepResult = _objectSpread(_objectSpread({}, (0, _factory.createStepResult)()), step);
|
|
51
56
|
if (_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
|
|
@@ -78,6 +83,35 @@ class ShallowStepsStack {
|
|
|
78
83
|
});
|
|
79
84
|
_classPrivateFieldGet(_runningSteps, this).pop();
|
|
80
85
|
}
|
|
86
|
+
findStepByUuid(uuid) {
|
|
87
|
+
var findRecursively = steps => {
|
|
88
|
+
for (var s of steps) {
|
|
89
|
+
if (s.uuid === uuid) {
|
|
90
|
+
return s;
|
|
91
|
+
}
|
|
92
|
+
var found = findRecursively(s.steps);
|
|
93
|
+
if (found) {
|
|
94
|
+
return found;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
};
|
|
99
|
+
return findRecursively(this.steps);
|
|
100
|
+
}
|
|
101
|
+
addAttachment(attachment, writer) {
|
|
102
|
+
var isPath = !!attachment.path;
|
|
103
|
+
var fileExt = attachment.path ? _nodePath.default.extname(attachment.path) : undefined;
|
|
104
|
+
var fileName = (0, _attachments.buildAttachmentFileName)({
|
|
105
|
+
contentType: attachment.contentType,
|
|
106
|
+
fileExtension: fileExt
|
|
107
|
+
});
|
|
108
|
+
if (isPath) {
|
|
109
|
+
writer.writeAttachmentFromPath(fileName, attachment.path);
|
|
110
|
+
} else if (attachment.body) {
|
|
111
|
+
writer.writeAttachment(fileName, attachment.body);
|
|
112
|
+
}
|
|
113
|
+
return fileName;
|
|
114
|
+
}
|
|
81
115
|
}
|
|
82
116
|
exports.ShallowStepsStack = ShallowStepsStack;
|
|
83
117
|
function _get_currentStep(_this) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["_path","require","_model","_LifecycleState","_Notifier","_factory","_testplan","_utils","_attachments","_loader","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","set","has","TypeError","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","_classPrivateGetter","s","_assertClassBrand","_classPrivateFieldGet","get","n","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","startStep","step","stepResult","createStepResult","_get_currentStep","steps","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","exports","_this","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","writer","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","uuid","randomUuid","state","setScope","scope","getScope","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","Stage","FINISHED","scopeUuids","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","extname","attachmentFileName","buildAttachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","status","statusDetails","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","deleteFixtureResult","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","Array","isArray","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = stop ?? result.start ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAoBA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AASA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAmD,SAAAS,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAA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;EACF;AA6jBF;AAACwC,OAAA,CAAAuB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReporterRuntime.js","names":["_nodePath","_interopRequireDefault","require","_path","_model","_LifecycleState","_Notifier","_factory","_testplan","_utils","_attachments","_loader","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","set","has","TypeError","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","_classPrivateGetter","s","_assertClassBrand","_classPrivateFieldGet","get","n","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","currentStep","_get_currentStep","startStep","step","stepResult","createStepResult","steps","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","found","addAttachment","attachment","writer","isPath","path","fileExt","extname","fileName","buildAttachmentFileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","exports","_this","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","randomUuid","state","setScope","scope","getScope","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","Stage","FINISHED","scopeUuids","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","status","statusDetails","Buffer","from","content","encoding","root","getExecutionItem","_ref2","writtenFixtures","Set","deleteFixtureResult","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","Array","isArray","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = stop ?? result.start ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAoBA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AASA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAAmD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAA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O,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACjD,IAAI,EAAEjK,KAAK,CAAC,GAAAkN,KAAA;QACrE,IAAIJ,KAAK,CAACC,OAAO,CAAC/M,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAACwK,GAAG,CAAE2C,CAAC,KAAM;YAAElD,IAAI;YAAEjK,KAAK,EAAEmN;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLlD,IAAI;UACJjK;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF;AAAC2D,OAAA,CAAAuB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -154,12 +154,28 @@ var getSuiteLabels = suites => {
|
|
|
154
154
|
};
|
|
155
155
|
exports.getSuiteLabels = getSuiteLabels;
|
|
156
156
|
var suiteLabelNames = [_model.LabelName.PARENT_SUITE, _model.LabelName.SUITE, _model.LabelName.SUB_SUITE];
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Resolves suite labels for the given test results and add default lables if there is no any suite label.
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* ensureSuiteLabels({ labels: [{ name: "suite", value: "foo" }] }, ["bar"]) // => [{ name: "suite", value: "foo" }]
|
|
163
|
+
* ensureSuiteLabels({ labels: [] }, ["bar"]) // => [{ name: "parentSuite", value: "bar" }]
|
|
164
|
+
* ```
|
|
165
|
+
* @param test - Test result to resolve suite labels for
|
|
166
|
+
* @param defaultSuites - Default suites to add if there is no any suite label
|
|
167
|
+
* @returns Actual suite labels
|
|
168
|
+
*/
|
|
157
169
|
var ensureSuiteLabels = (test, defaultSuites) => {
|
|
158
170
|
var _test$labels;
|
|
159
171
|
if (!((_test$labels = test.labels) !== null && _test$labels !== void 0 && _test$labels.find(l => suiteLabelNames.includes(l.name)))) {
|
|
160
172
|
var _test$labels2;
|
|
161
173
|
test.labels = [...((_test$labels2 = test.labels) !== null && _test$labels2 !== void 0 ? _test$labels2 : []), ...getSuiteLabels(defaultSuites)];
|
|
162
174
|
}
|
|
175
|
+
return suiteLabelNames.map(name => {
|
|
176
|
+
var _test$labels3;
|
|
177
|
+
return (_test$labels3 = test.labels) === null || _test$labels3 === void 0 ? void 0 : _test$labels3.find(l => l.name === name);
|
|
178
|
+
}).filter(Boolean);
|
|
163
179
|
};
|
|
164
180
|
exports.ensureSuiteLabels = ensureSuiteLabels;
|
|
165
181
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_nodeCrypto","require","_nodeFs","_interopRequireDefault","_promises","_nodePath","_nodeProcess","_model","_FileSystemWriter","_MessageWriter","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","asyncGeneratorStep","n","a","c","u","done","Promise","resolve","then","_asyncToGenerator","_next","_throw","randomUuid","randomUUID","exports","md5","str","createHash","update","digest","getTestResultHistoryId","result","_result$testCaseId","historyId","tcId","testCaseId","fullName","paramsString","parameters","p","excluded","sort","b","_a$name","_a$value","name","localeCompare","map","_p$name","_p$value","concat","join","paramsHash","getTestResultTestCaseId","undefined","statusToPriority","status","StatusByPriority","indexOf","getWorstTestStepResult","steps","readImageAsBase64","_ref","filePath","file","readFile","encoding","console","error","_x","getProjectRoot","cachedProjectRoot","resolveProjectRootByPath","cwd","process","nextDir","dir","fs","accessSync","path","constants","F_OK","_unused","dirname","getRelativePath","filepath","isAbsolute","projectRoot","relative","getPosixPath","platform","replaceAll","deepClone","obj","JSON","parse","stringify","getSuiteLabels","suites","parentSuite","suite","subSuites","labels","LabelName","PARENT_SUITE","SUITE","SUB_SUITE","suiteLabelNames","ensureSuiteLabels","test","defaultSuites","_test$labels","find","l","includes","_test$labels2","reRegExpChar","reHasRegExpChar","RegExp","source","escapeRegExp","replace","isUrl","potentialUrl","URL","applyLinkTemplate","template","formatLink","templates","link","url","originalUrl","type","_templates","formattedLink","urlTemplate","nameTemplate","LinkType","DEFAULT","formatLinks","links","createDefaultWriter","config","env","ALLURE_TEST_MODE","MessageWriter","emitter","FileSystemWriter","resultsDir"],"sources":["../../../../src/sdk/reporter/utils.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\nimport type { EventEmitter } from \"node:events\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport type { Label, Link, Status, StepResult, TestResult } from \"../../model.js\";\nimport { LabelName, LinkType, StatusByPriority } from \"../../model.js\";\nimport type { LinkConfig, LinkTemplate } from \"./types.js\";\nimport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nimport { MessageWriter } from \"./writer/MessageWriter.js\";\n\nexport const randomUuid = () => {\n return randomUUID();\n};\n\nexport const md5 = (str: string) => {\n return createHash(\"md5\").update(str).digest(\"hex\");\n};\n\nexport const getTestResultHistoryId = (result: TestResult) => {\n if (result.historyId) {\n return result.historyId;\n }\n\n const tcId = result.testCaseId ?? (result.fullName ? md5(result.fullName) : null);\n\n if (!tcId) {\n return \"\";\n }\n\n const paramsString = result.parameters\n .filter((p) => !p?.excluded)\n .sort((a, b) => a.name?.localeCompare(b?.name) || a.value?.localeCompare(b?.value))\n .map((p) => `${p.name ?? \"null\"}:${p.value ?? \"null\"}`)\n .join(\",\");\n const paramsHash = md5(paramsString);\n\n return `${tcId}:${paramsHash}`;\n};\n\nexport const getTestResultTestCaseId = (result: TestResult) => {\n return result.fullName ? md5(result.fullName) : undefined;\n};\n\nconst statusToPriority = (status: Status | undefined) => {\n if (!status) {\n return -1;\n }\n return StatusByPriority.indexOf(status);\n};\n\nexport const getWorstTestStepResult = (steps: StepResult[]): StepResult | undefined => {\n if (steps.length === 0) {\n return;\n }\n\n return [...steps].sort((a, b) => statusToPriority(a.status) - statusToPriority(b.status))[0];\n};\n\nexport const readImageAsBase64 = async (filePath: string): Promise<string | undefined> => {\n try {\n const file = await readFile(filePath, { encoding: \"base64\" });\n\n return file ? `data:image/png;base64,${file}` : undefined;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not read file ${filePath}`, e);\n return undefined;\n }\n};\n\nexport const getProjectRoot = (() => {\n let cachedProjectRoot: string | null = null;\n\n const resolveProjectRootByPath = () => {\n const cwd = process.cwd();\n let nextDir = cwd;\n let dir;\n\n do {\n dir = nextDir;\n try {\n fs.accessSync(path.join(dir, \"package.json\"), fs.constants.F_OK);\n\n // package.json exists; use the directory as the project root\n return dir;\n } catch {}\n\n nextDir = path.dirname(dir);\n } while (nextDir.length < dir.length);\n\n // package.json doesn't exist in any parent; fall back to CWD\n return cwd;\n };\n\n return () => {\n if (!cachedProjectRoot) {\n cachedProjectRoot = resolveProjectRootByPath();\n }\n return cachedProjectRoot;\n };\n})();\n\nexport const getRelativePath = (filepath: string) => {\n if (path.isAbsolute(filepath)) {\n const projectRoot = getProjectRoot();\n filepath = path.relative(projectRoot, filepath);\n }\n return filepath;\n};\n\nexport const getPosixPath = (filepath: string) => {\n if (process.platform === \"win32\") {\n return filepath.replaceAll(\"\\\\\", \"/\");\n }\n return filepath;\n};\n\nexport const deepClone = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));\n\nexport const getSuiteLabels = (suites: readonly string[]): Label[] => {\n if (suites.length === 0) {\n return [];\n }\n\n const [parentSuite, suite, ...subSuites] = suites;\n const labels: Label[] = [];\n\n if (parentSuite) {\n labels.push({\n name: LabelName.PARENT_SUITE,\n value: parentSuite,\n });\n }\n\n if (suite) {\n labels.push({\n name: LabelName.SUITE,\n value: suite,\n });\n }\n\n if (subSuites.length > 0) {\n labels.push({\n name: LabelName.SUB_SUITE,\n value: subSuites.join(\" > \"),\n });\n }\n\n return labels;\n};\n\nconst suiteLabelNames: readonly string[] = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE];\n\nexport const ensureSuiteLabels = (test: Partial<TestResult>, defaultSuites: readonly string[]) => {\n if (!test.labels?.find((l) => suiteLabelNames.includes(l.name))) {\n test.labels = [...(test.labels ?? []), ...getSuiteLabels(defaultSuites)];\n }\n};\n\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport const escapeRegExp = (value: string): string => {\n return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, \"\\\\$&\") : value;\n};\n\n// TODO: may also use URL.canParse instead (requires node.js v18.17, v19.9, or higher)\nconst isUrl = (potentialUrl: string) => {\n // Short-circuits the check for many short URL cases, bypassing the try-catch logic.\n if (potentialUrl.indexOf(\":\") === -1) {\n return false;\n }\n\n // There is ':' in the string: a potential scheme separator.\n // The string might be a proper URL already.\n try {\n new URL(potentialUrl);\n return true;\n } catch (e) {\n return false;\n }\n};\n\nexport const applyLinkTemplate = (template: LinkTemplate, value: string) =>\n typeof template === \"string\" ? template.replace(\"%s\", value) : template(value);\n\nexport const formatLink = (templates: LinkConfig, link: Link) => {\n const { url: originalUrl, name, type } = link;\n if (isUrl(originalUrl)) {\n return link;\n } else {\n const formattedLink = { ...link };\n const { urlTemplate, nameTemplate } = templates[type ?? LinkType.DEFAULT] ?? {};\n if (urlTemplate !== undefined) {\n formattedLink.url = applyLinkTemplate(urlTemplate, originalUrl);\n }\n if (name === undefined && nameTemplate !== undefined) {\n formattedLink.name = applyLinkTemplate(nameTemplate, originalUrl);\n }\n return formattedLink;\n }\n};\n\nexport const formatLinks = (templates: LinkConfig, links: readonly Link[]) =>\n links.map((link) => formatLink(templates, link));\n\nexport const createDefaultWriter = (config: { resultsDir?: string; emitter?: EventEmitter }) => {\n return process.env.ALLURE_TEST_MODE\n ? new MessageWriter(config.emitter)\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n });\n};\n"],"mappings":";;;;;;AAAA,IA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I,UAAA;IACL,IAAMC,aAAa,GAAAhJ,aAAA,KAAQ2I,IAAI,CAAE;IACjC,IAAM;MAAEM,WAAW;MAAEC;IAAa,CAAC,IAAAH,UAAA,GAAGL,SAAS,CAACI,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIK,eAAQ,CAACC,OAAO,CAAC,cAAAL,UAAA,cAAAA,UAAA,GAAI,CAAC,CAAC;IAC/E,IAAIE,WAAW,KAAKjF,SAAS,EAAE;MAC7BgF,aAAa,CAACJ,GAAG,GAAGL,iBAAiB,CAACU,WAAW,EAAEJ,WAAW,CAAC;IACjE;IACA,IAAItF,IAAI,KAAKS,SAAS,IAAIkF,YAAY,KAAKlF,SAAS,EAAE;MACpDgF,aAAa,CAACzF,IAAI,GAAGgF,iBAAiB,CAACW,YAAY,EAAEL,WAAW,CAAC;IACnE;IACA,OAAOG,aAAa;EACtB;AACF,CAAC;AAAC9G,OAAA,CAAAuG,UAAA,GAAAA,UAAA;AAEK,IAAMY,WAAW,GAAGA,CAACX,SAAqB,EAAEY,KAAsB,KACvEA,KAAK,CAAC7F,GAAG,CAAEkF,IAAI,IAAKF,UAAU,CAACC,SAAS,EAAEC,IAAI,CAAC,CAAC;AAACzG,OAAA,CAAAmH,WAAA,GAAAA,WAAA;AAE5C,IAAME,mBAAmB,GAAIC,MAAuD,IAAK;EAC9F,OAAOpE,oBAAO,CAACqE,GAAG,CAACC,gBAAgB,GAC/B,IAAIC,4BAAa,CAACH,MAAM,CAACI,OAAO,CAAC,GACjC,IAAIC,kCAAgB,CAAC;IACnBC,UAAU,EAAEN,MAAM,CAACM,UAAU,IAAI;EACnC,CAAC,CAAC;AACR,CAAC;AAAC5H,OAAA,CAAAqH,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_nodeCrypto","require","_nodeFs","_interopRequireDefault","_promises","_nodePath","_nodeProcess","_model","_FileSystemWriter","_MessageWriter","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","asyncGeneratorStep","n","a","c","u","done","Promise","resolve","then","_asyncToGenerator","_next","_throw","randomUuid","randomUUID","exports","md5","str","createHash","update","digest","getTestResultHistoryId","result","_result$testCaseId","historyId","tcId","testCaseId","fullName","paramsString","parameters","p","excluded","sort","b","_a$name","_a$value","name","localeCompare","map","_p$name","_p$value","concat","join","paramsHash","getTestResultTestCaseId","undefined","statusToPriority","status","StatusByPriority","indexOf","getWorstTestStepResult","steps","readImageAsBase64","_ref","filePath","file","readFile","encoding","console","error","_x","getProjectRoot","cachedProjectRoot","resolveProjectRootByPath","cwd","process","nextDir","dir","fs","accessSync","path","constants","F_OK","_unused","dirname","getRelativePath","filepath","isAbsolute","projectRoot","relative","getPosixPath","platform","replaceAll","deepClone","obj","JSON","parse","stringify","getSuiteLabels","suites","parentSuite","suite","subSuites","labels","LabelName","PARENT_SUITE","SUITE","SUB_SUITE","suiteLabelNames","ensureSuiteLabels","test","defaultSuites","_test$labels","find","l","includes","_test$labels2","_test$labels3","Boolean","reRegExpChar","reHasRegExpChar","RegExp","source","escapeRegExp","replace","isUrl","potentialUrl","URL","applyLinkTemplate","template","formatLink","templates","link","url","originalUrl","type","_templates","formattedLink","urlTemplate","nameTemplate","LinkType","DEFAULT","formatLinks","links","createDefaultWriter","config","env","ALLURE_TEST_MODE","MessageWriter","emitter","FileSystemWriter","resultsDir"],"sources":["../../../../src/sdk/reporter/utils.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\nimport type { EventEmitter } from \"node:events\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport type { Label, Link, Status, StepResult, TestResult } from \"../../model.js\";\nimport { LabelName, LinkType, StatusByPriority } from \"../../model.js\";\nimport type { LinkConfig, LinkTemplate } from \"./types.js\";\nimport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nimport { MessageWriter } from \"./writer/MessageWriter.js\";\n\nexport const randomUuid = () => {\n return randomUUID();\n};\n\nexport const md5 = (str: string) => {\n return createHash(\"md5\").update(str).digest(\"hex\");\n};\n\nexport const getTestResultHistoryId = (result: TestResult) => {\n if (result.historyId) {\n return result.historyId;\n }\n\n const tcId = result.testCaseId ?? (result.fullName ? md5(result.fullName) : null);\n\n if (!tcId) {\n return \"\";\n }\n\n const paramsString = result.parameters\n .filter((p) => !p?.excluded)\n .sort((a, b) => a.name?.localeCompare(b?.name) || a.value?.localeCompare(b?.value))\n .map((p) => `${p.name ?? \"null\"}:${p.value ?? \"null\"}`)\n .join(\",\");\n const paramsHash = md5(paramsString);\n\n return `${tcId}:${paramsHash}`;\n};\n\nexport const getTestResultTestCaseId = (result: TestResult) => {\n return result.fullName ? md5(result.fullName) : undefined;\n};\n\nconst statusToPriority = (status: Status | undefined) => {\n if (!status) {\n return -1;\n }\n return StatusByPriority.indexOf(status);\n};\n\nexport const getWorstTestStepResult = (steps: StepResult[]): StepResult | undefined => {\n if (steps.length === 0) {\n return;\n }\n\n return [...steps].sort((a, b) => statusToPriority(a.status) - statusToPriority(b.status))[0];\n};\n\nexport const readImageAsBase64 = async (filePath: string): Promise<string | undefined> => {\n try {\n const file = await readFile(filePath, { encoding: \"base64\" });\n\n return file ? `data:image/png;base64,${file}` : undefined;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not read file ${filePath}`, e);\n return undefined;\n }\n};\n\nexport const getProjectRoot = (() => {\n let cachedProjectRoot: string | null = null;\n\n const resolveProjectRootByPath = () => {\n const cwd = process.cwd();\n let nextDir = cwd;\n let dir;\n\n do {\n dir = nextDir;\n try {\n fs.accessSync(path.join(dir, \"package.json\"), fs.constants.F_OK);\n\n // package.json exists; use the directory as the project root\n return dir;\n } catch {}\n\n nextDir = path.dirname(dir);\n } while (nextDir.length < dir.length);\n\n // package.json doesn't exist in any parent; fall back to CWD\n return cwd;\n };\n\n return () => {\n if (!cachedProjectRoot) {\n cachedProjectRoot = resolveProjectRootByPath();\n }\n return cachedProjectRoot;\n };\n})();\n\nexport const getRelativePath = (filepath: string) => {\n if (path.isAbsolute(filepath)) {\n const projectRoot = getProjectRoot();\n filepath = path.relative(projectRoot, filepath);\n }\n return filepath;\n};\n\nexport const getPosixPath = (filepath: string) => {\n if (process.platform === \"win32\") {\n return filepath.replaceAll(\"\\\\\", \"/\");\n }\n return filepath;\n};\n\nexport const deepClone = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));\n\nexport const getSuiteLabels = (suites: readonly string[]): Label[] => {\n if (suites.length === 0) {\n return [];\n }\n\n const [parentSuite, suite, ...subSuites] = suites;\n const labels: Label[] = [];\n\n if (parentSuite) {\n labels.push({\n name: LabelName.PARENT_SUITE,\n value: parentSuite,\n });\n }\n\n if (suite) {\n labels.push({\n name: LabelName.SUITE,\n value: suite,\n });\n }\n\n if (subSuites.length > 0) {\n labels.push({\n name: LabelName.SUB_SUITE,\n value: subSuites.join(\" > \"),\n });\n }\n\n return labels;\n};\n\nconst suiteLabelNames: readonly string[] = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE];\n\n/**\n * Resolves suite labels for the given test results and add default lables if there is no any suite label.\n * @example\n * ```ts\n * ensureSuiteLabels({ labels: [{ name: \"suite\", value: \"foo\" }] }, [\"bar\"]) // => [{ name: \"suite\", value: \"foo\" }]\n * ensureSuiteLabels({ labels: [] }, [\"bar\"]) // => [{ name: \"parentSuite\", value: \"bar\" }]\n * ```\n * @param test - Test result to resolve suite labels for\n * @param defaultSuites - Default suites to add if there is no any suite label\n * @returns Actual suite labels\n */\nexport const ensureSuiteLabels = (test: Partial<TestResult>, defaultSuites: readonly string[]) => {\n if (!test.labels?.find((l) => suiteLabelNames.includes(l.name))) {\n test.labels = [...(test.labels ?? []), ...getSuiteLabels(defaultSuites)];\n }\n\n return suiteLabelNames.map((name) => test.labels?.find((l) => l.name === name)).filter(Boolean) as Label[];\n};\n\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport const escapeRegExp = (value: string): string => {\n return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, \"\\\\$&\") : value;\n};\n\n// TODO: may also use URL.canParse instead (requires node.js v18.17, v19.9, or higher)\nconst isUrl = (potentialUrl: string) => {\n // Short-circuits the check for many short URL cases, bypassing the try-catch logic.\n if (potentialUrl.indexOf(\":\") === -1) {\n return false;\n }\n\n // There is ':' in the string: a potential scheme separator.\n // The string might be a proper URL already.\n try {\n new URL(potentialUrl);\n return true;\n } catch (e) {\n return false;\n }\n};\n\nexport const applyLinkTemplate = (template: LinkTemplate, value: string) =>\n typeof template === \"string\" ? template.replace(\"%s\", value) : template(value);\n\nexport const formatLink = (templates: LinkConfig, link: Link) => {\n const { url: originalUrl, name, type } = link;\n if (isUrl(originalUrl)) {\n return link;\n } else {\n const formattedLink = { ...link };\n const { urlTemplate, nameTemplate } = templates[type ?? LinkType.DEFAULT] ?? {};\n if (urlTemplate !== undefined) {\n formattedLink.url = applyLinkTemplate(urlTemplate, originalUrl);\n }\n if (name === undefined && nameTemplate !== undefined) {\n formattedLink.name = applyLinkTemplate(nameTemplate, originalUrl);\n }\n return formattedLink;\n }\n};\n\nexport const formatLinks = (templates: LinkConfig, links: readonly Link[]) =>\n links.map((link) => formatLink(templates, link));\n\nexport const createDefaultWriter = (config: { resultsDir?: string; emitter?: EventEmitter }) => {\n return process.env.ALLURE_TEST_MODE\n ? new MessageWriter(config.emitter)\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,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C,CAAC;AACR,CAAC;AAAC9H,OAAA,CAAAuH,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
package/dist/esm/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":["Status","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n actual?: string;\n expected?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":"AAyCA
|
|
1
|
+
{"version":3,"file":"model.js","names":["Status","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n path?: string;\n body?: Buffer;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n actual?: string;\n expected?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {\n uuid?: string;\n}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n titlePath?: string[];\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":"AA2CA;;AAyCA;AACA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAOlB,OAAO,IAAMC,gBAAgB,GAAG,CAACD,MAAM,CAACE,MAAM,EAAEF,MAAM,CAACG,MAAM,EAAEH,MAAM,CAACI,MAAM,EAAEJ,MAAM,CAACK,OAAO,CAAC;;AAE7F;AACA,WAAYC,KAAK,0BAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA;;AAQjB;AACA,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AA0BrB;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;;AAQpB;AACA,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAkBvB;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ function _classPrivateGetter(s, r, a) { return a(_assertClassBrand(s, r)); }
|
|
|
10
10
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
11
11
|
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"); }
|
|
12
12
|
/* eslint max-lines: 0 */
|
|
13
|
+
import path from "node:path";
|
|
13
14
|
import { extname } from "path";
|
|
14
15
|
import { Stage } from "../../model.js";
|
|
15
16
|
import { LifecycleState } from "./LifecycleState.js";
|
|
@@ -41,6 +42,9 @@ export class ShallowStepsStack {
|
|
|
41
42
|
_defineProperty(this, "steps", []);
|
|
42
43
|
_classPrivateFieldInitSpec(this, _runningSteps, []);
|
|
43
44
|
}
|
|
45
|
+
currentStep() {
|
|
46
|
+
return _classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep);
|
|
47
|
+
}
|
|
44
48
|
startStep(step) {
|
|
45
49
|
var stepResult = _objectSpread(_objectSpread({}, createStepResult()), step);
|
|
46
50
|
if (_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
|
|
@@ -73,6 +77,35 @@ export class ShallowStepsStack {
|
|
|
73
77
|
});
|
|
74
78
|
_classPrivateFieldGet(_runningSteps, this).pop();
|
|
75
79
|
}
|
|
80
|
+
findStepByUuid(uuid) {
|
|
81
|
+
var findRecursively = steps => {
|
|
82
|
+
for (var s of steps) {
|
|
83
|
+
if (s.uuid === uuid) {
|
|
84
|
+
return s;
|
|
85
|
+
}
|
|
86
|
+
var found = findRecursively(s.steps);
|
|
87
|
+
if (found) {
|
|
88
|
+
return found;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return undefined;
|
|
92
|
+
};
|
|
93
|
+
return findRecursively(this.steps);
|
|
94
|
+
}
|
|
95
|
+
addAttachment(attachment, writer) {
|
|
96
|
+
var isPath = !!attachment.path;
|
|
97
|
+
var fileExt = attachment.path ? path.extname(attachment.path) : undefined;
|
|
98
|
+
var fileName = buildAttachmentFileName({
|
|
99
|
+
contentType: attachment.contentType,
|
|
100
|
+
fileExtension: fileExt
|
|
101
|
+
});
|
|
102
|
+
if (isPath) {
|
|
103
|
+
writer.writeAttachmentFromPath(fileName, attachment.path);
|
|
104
|
+
} else if (attachment.body) {
|
|
105
|
+
writer.writeAttachment(fileName, attachment.body);
|
|
106
|
+
}
|
|
107
|
+
return fileName;
|
|
108
|
+
}
|
|
76
109
|
}
|
|
77
110
|
function _get_currentStep(_this) {
|
|
78
111
|
return _classPrivateFieldGet(_runningSteps, _this)[_classPrivateFieldGet(_runningSteps, _this).length - 1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","_classPrivateMethodInitSpec","_defineProperty","_classPrivateFieldInitSpec","startStep","step","stepResult","_objectSpread","_classPrivateGetter","_get_currentStep","steps","push","_classPrivateFieldGet","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","_this","length","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","set","removeStep","newValue","filter","value","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","writer","listeners","environmentInfo","categories","links","globalLabels","uuid","state","setScope","scope","getScope","concat","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","FINISHED","scopeUuids","arguments","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","historyId","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","attachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","status","statusDetails","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","Array","isArray","Object","keys","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = stop ?? result.start ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA,S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;MAAE0E;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACgG,UAAU,GAAG9F,MAAK;IAEvB,IAAIuH,KAAK,CAACC,OAAO,CAACvH,YAAY,CAAC,EAAE;MAC/B,IAAI,CAACA,YAAY,GAAGA,YAAY;IAClC,CAAC,MAAM,IAAIwH,MAAM,CAACC,IAAI,CAACzH,YAAY,CAAC,CAACnC,MAAM,EAAE;MAC3C,IAAI,CAACmC,YAAY,GAAGwH,MAAM,CAACE,OAAO,CAAC1H,YAAY,CAAC,CAAC2H,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACnD,IAAI,EAAE5F,KAAK,CAAC,GAAA+I,KAAA;QACrE,IAAIN,KAAK,CAACC,OAAO,CAAC1I,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAACmG,GAAG,CAAE6C,CAAC,KAAM;YAAEpD,IAAI;YAAE5F,KAAK,EAAEgJ;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLpD,IAAI;UACJ5F;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReporterRuntime.js","names":["path","extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","_classPrivateMethodInitSpec","_defineProperty","_classPrivateFieldInitSpec","currentStep","_classPrivateGetter","_get_currentStep","startStep","step","stepResult","_objectSpread","steps","push","_classPrivateFieldGet","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","s","found","addAttachment","attachment","writer","isPath","fileExt","fileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","_this","length","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","set","removeStep","newValue","filter","value","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","state","setScope","scope","getScope","concat","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","FINISHED","scopeUuids","arguments","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","historyId","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","status","statusDetails","Buffer","from","content","encoding","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","Array","isArray","Object","keys","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = stop ?? result.start ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,OAAO,QAAQ,MAAM;AAC9B,SAKEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,YAAY,QAAQ,eAAe;AAS5C,SAASC,SAAS,EAAEC,WAAW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;MAC3C,IAAI,CAACkC,YAAY,GAAG+G,MAAM,CAACE,OAAO,CAACjH,YAAY,CAAC,CAACkH,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAAClD,IAAI,EAAEnF,KAAK,CAAC,GAAAqI,KAAA;QACrE,IAAIN,KAAK,CAACC,OAAO,CAAChI,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAAC0F,GAAG,CAAE4C,CAAC,KAAM;YAAEnD,IAAI;YAAEnF,KAAK,EAAEsI;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLnD,IAAI;UACJnF;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF","ignoreList":[]}
|
|
@@ -138,12 +138,28 @@ export var getSuiteLabels = suites => {
|
|
|
138
138
|
return labels;
|
|
139
139
|
};
|
|
140
140
|
var suiteLabelNames = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE];
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Resolves suite labels for the given test results and add default lables if there is no any suite label.
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* ensureSuiteLabels({ labels: [{ name: "suite", value: "foo" }] }, ["bar"]) // => [{ name: "suite", value: "foo" }]
|
|
147
|
+
* ensureSuiteLabels({ labels: [] }, ["bar"]) // => [{ name: "parentSuite", value: "bar" }]
|
|
148
|
+
* ```
|
|
149
|
+
* @param test - Test result to resolve suite labels for
|
|
150
|
+
* @param defaultSuites - Default suites to add if there is no any suite label
|
|
151
|
+
* @returns Actual suite labels
|
|
152
|
+
*/
|
|
141
153
|
export var ensureSuiteLabels = (test, defaultSuites) => {
|
|
142
154
|
var _test$labels;
|
|
143
155
|
if (!((_test$labels = test.labels) !== null && _test$labels !== void 0 && _test$labels.find(l => suiteLabelNames.includes(l.name)))) {
|
|
144
156
|
var _test$labels2;
|
|
145
157
|
test.labels = [...((_test$labels2 = test.labels) !== null && _test$labels2 !== void 0 ? _test$labels2 : []), ...getSuiteLabels(defaultSuites)];
|
|
146
158
|
}
|
|
159
|
+
return suiteLabelNames.map(name => {
|
|
160
|
+
var _test$labels3;
|
|
161
|
+
return (_test$labels3 = test.labels) === null || _test$labels3 === void 0 ? void 0 : _test$labels3.find(l => l.name === name);
|
|
162
|
+
}).filter(Boolean);
|
|
147
163
|
};
|
|
148
164
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
|
149
165
|
reHasRegExpChar = RegExp(reRegExpChar.source);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["createHash","randomUUID","fs","readFile","path","process","LabelName","LinkType","StatusByPriority","FileSystemWriter","MessageWriter","randomUuid","md5","str","update","digest","getTestResultHistoryId","result","_result$testCaseId","historyId","tcId","testCaseId","fullName","paramsString","parameters","filter","p","excluded","sort","a","b","_a$name","_a$value","name","localeCompare","value","map","_p$name","_p$value","concat","join","paramsHash","getTestResultTestCaseId","undefined","statusToPriority","status","indexOf","getWorstTestStepResult","steps","length","readImageAsBase64","_ref","_asyncToGenerator","filePath","file","encoding","e","console","error","_x","apply","arguments","getProjectRoot","cachedProjectRoot","resolveProjectRootByPath","cwd","nextDir","dir","accessSync","constants","F_OK","_unused","dirname","getRelativePath","filepath","isAbsolute","projectRoot","relative","getPosixPath","platform","replaceAll","deepClone","obj","JSON","parse","stringify","getSuiteLabels","suites","parentSuite","suite","subSuites","labels","push","PARENT_SUITE","SUITE","SUB_SUITE","suiteLabelNames","ensureSuiteLabels","test","defaultSuites","_test$labels","find","l","includes","_test$labels2","reRegExpChar","reHasRegExpChar","RegExp","source","escapeRegExp","replace","isUrl","potentialUrl","URL","applyLinkTemplate","template","formatLink","templates","link","url","originalUrl","type","_templates","formattedLink","_objectSpread","urlTemplate","nameTemplate","DEFAULT","formatLinks","links","createDefaultWriter","config","env","ALLURE_TEST_MODE","emitter","resultsDir"],"sources":["../../../../src/sdk/reporter/utils.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\nimport type { EventEmitter } from \"node:events\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport type { Label, Link, Status, StepResult, TestResult } from \"../../model.js\";\nimport { LabelName, LinkType, StatusByPriority } from \"../../model.js\";\nimport type { LinkConfig, LinkTemplate } from \"./types.js\";\nimport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nimport { MessageWriter } from \"./writer/MessageWriter.js\";\n\nexport const randomUuid = () => {\n return randomUUID();\n};\n\nexport const md5 = (str: string) => {\n return createHash(\"md5\").update(str).digest(\"hex\");\n};\n\nexport const getTestResultHistoryId = (result: TestResult) => {\n if (result.historyId) {\n return result.historyId;\n }\n\n const tcId = result.testCaseId ?? (result.fullName ? md5(result.fullName) : null);\n\n if (!tcId) {\n return \"\";\n }\n\n const paramsString = result.parameters\n .filter((p) => !p?.excluded)\n .sort((a, b) => a.name?.localeCompare(b?.name) || a.value?.localeCompare(b?.value))\n .map((p) => `${p.name ?? \"null\"}:${p.value ?? \"null\"}`)\n .join(\",\");\n const paramsHash = md5(paramsString);\n\n return `${tcId}:${paramsHash}`;\n};\n\nexport const getTestResultTestCaseId = (result: TestResult) => {\n return result.fullName ? md5(result.fullName) : undefined;\n};\n\nconst statusToPriority = (status: Status | undefined) => {\n if (!status) {\n return -1;\n }\n return StatusByPriority.indexOf(status);\n};\n\nexport const getWorstTestStepResult = (steps: StepResult[]): StepResult | undefined => {\n if (steps.length === 0) {\n return;\n }\n\n return [...steps].sort((a, b) => statusToPriority(a.status) - statusToPriority(b.status))[0];\n};\n\nexport const readImageAsBase64 = async (filePath: string): Promise<string | undefined> => {\n try {\n const file = await readFile(filePath, { encoding: \"base64\" });\n\n return file ? `data:image/png;base64,${file}` : undefined;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not read file ${filePath}`, e);\n return undefined;\n }\n};\n\nexport const getProjectRoot = (() => {\n let cachedProjectRoot: string | null = null;\n\n const resolveProjectRootByPath = () => {\n const cwd = process.cwd();\n let nextDir = cwd;\n let dir;\n\n do {\n dir = nextDir;\n try {\n fs.accessSync(path.join(dir, \"package.json\"), fs.constants.F_OK);\n\n // package.json exists; use the directory as the project root\n return dir;\n } catch {}\n\n nextDir = path.dirname(dir);\n } while (nextDir.length < dir.length);\n\n // package.json doesn't exist in any parent; fall back to CWD\n return cwd;\n };\n\n return () => {\n if (!cachedProjectRoot) {\n cachedProjectRoot = resolveProjectRootByPath();\n }\n return cachedProjectRoot;\n };\n})();\n\nexport const getRelativePath = (filepath: string) => {\n if (path.isAbsolute(filepath)) {\n const projectRoot = getProjectRoot();\n filepath = path.relative(projectRoot, filepath);\n }\n return filepath;\n};\n\nexport const getPosixPath = (filepath: string) => {\n if (process.platform === \"win32\") {\n return filepath.replaceAll(\"\\\\\", \"/\");\n }\n return filepath;\n};\n\nexport const deepClone = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));\n\nexport const getSuiteLabels = (suites: readonly string[]): Label[] => {\n if (suites.length === 0) {\n return [];\n }\n\n const [parentSuite, suite, ...subSuites] = suites;\n const labels: Label[] = [];\n\n if (parentSuite) {\n labels.push({\n name: LabelName.PARENT_SUITE,\n value: parentSuite,\n });\n }\n\n if (suite) {\n labels.push({\n name: LabelName.SUITE,\n value: suite,\n });\n }\n\n if (subSuites.length > 0) {\n labels.push({\n name: LabelName.SUB_SUITE,\n value: subSuites.join(\" > \"),\n });\n }\n\n return labels;\n};\n\nconst suiteLabelNames: readonly string[] = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE];\n\nexport const ensureSuiteLabels = (test: Partial<TestResult>, defaultSuites: readonly string[]) => {\n if (!test.labels?.find((l) => suiteLabelNames.includes(l.name))) {\n test.labels = [...(test.labels ?? []), ...getSuiteLabels(defaultSuites)];\n }\n};\n\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport const escapeRegExp = (value: string): string => {\n return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, \"\\\\$&\") : value;\n};\n\n// TODO: may also use URL.canParse instead (requires node.js v18.17, v19.9, or higher)\nconst isUrl = (potentialUrl: string) => {\n // Short-circuits the check for many short URL cases, bypassing the try-catch logic.\n if (potentialUrl.indexOf(\":\") === -1) {\n return false;\n }\n\n // There is ':' in the string: a potential scheme separator.\n // The string might be a proper URL already.\n try {\n new URL(potentialUrl);\n return true;\n } catch (e) {\n return false;\n }\n};\n\nexport const applyLinkTemplate = (template: LinkTemplate, value: string) =>\n typeof template === \"string\" ? template.replace(\"%s\", value) : template(value);\n\nexport const formatLink = (templates: LinkConfig, link: Link) => {\n const { url: originalUrl, name, type } = link;\n if (isUrl(originalUrl)) {\n return link;\n } else {\n const formattedLink = { ...link };\n const { urlTemplate, nameTemplate } = templates[type ?? LinkType.DEFAULT] ?? {};\n if (urlTemplate !== undefined) {\n formattedLink.url = applyLinkTemplate(urlTemplate, originalUrl);\n }\n if (name === undefined && nameTemplate !== undefined) {\n formattedLink.name = applyLinkTemplate(nameTemplate, originalUrl);\n }\n return formattedLink;\n }\n};\n\nexport const formatLinks = (templates: LinkConfig, links: readonly Link[]) =>\n links.map((link) => formatLink(templates, link));\n\nexport const createDefaultWriter = (config: { resultsDir?: string; emitter?: EventEmitter }) => {\n return process.env.ALLURE_TEST_MODE\n ? new MessageWriter(config.emitter)\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n });\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,aAAa;AAEpD,OAAOC,EAAE,MAAM,SAAS;AACxB,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,OAAOC,IAAI,MAAM,WAAW;AAC5B,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,gBAAgB,QAAQ,gBAAgB;AAEtE,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,aA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|
+
{"version":3,"file":"utils.js","names":["createHash","randomUUID","fs","readFile","path","process","LabelName","LinkType","StatusByPriority","FileSystemWriter","MessageWriter","randomUuid","md5","str","update","digest","getTestResultHistoryId","result","_result$testCaseId","historyId","tcId","testCaseId","fullName","paramsString","parameters","filter","p","excluded","sort","a","b","_a$name","_a$value","name","localeCompare","value","map","_p$name","_p$value","concat","join","paramsHash","getTestResultTestCaseId","undefined","statusToPriority","status","indexOf","getWorstTestStepResult","steps","length","readImageAsBase64","_ref","_asyncToGenerator","filePath","file","encoding","e","console","error","_x","apply","arguments","getProjectRoot","cachedProjectRoot","resolveProjectRootByPath","cwd","nextDir","dir","accessSync","constants","F_OK","_unused","dirname","getRelativePath","filepath","isAbsolute","projectRoot","relative","getPosixPath","platform","replaceAll","deepClone","obj","JSON","parse","stringify","getSuiteLabels","suites","parentSuite","suite","subSuites","labels","push","PARENT_SUITE","SUITE","SUB_SUITE","suiteLabelNames","ensureSuiteLabels","test","defaultSuites","_test$labels","find","l","includes","_test$labels2","_test$labels3","Boolean","reRegExpChar","reHasRegExpChar","RegExp","source","escapeRegExp","replace","isUrl","potentialUrl","URL","applyLinkTemplate","template","formatLink","templates","link","url","originalUrl","type","_templates","formattedLink","_objectSpread","urlTemplate","nameTemplate","DEFAULT","formatLinks","links","createDefaultWriter","config","env","ALLURE_TEST_MODE","emitter","resultsDir"],"sources":["../../../../src/sdk/reporter/utils.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\nimport type { EventEmitter } from \"node:events\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport type { Label, Link, Status, StepResult, TestResult } from \"../../model.js\";\nimport { LabelName, LinkType, StatusByPriority } from \"../../model.js\";\nimport type { LinkConfig, LinkTemplate } from \"./types.js\";\nimport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nimport { MessageWriter } from \"./writer/MessageWriter.js\";\n\nexport const randomUuid = () => {\n return randomUUID();\n};\n\nexport const md5 = (str: string) => {\n return createHash(\"md5\").update(str).digest(\"hex\");\n};\n\nexport const getTestResultHistoryId = (result: TestResult) => {\n if (result.historyId) {\n return result.historyId;\n }\n\n const tcId = result.testCaseId ?? (result.fullName ? md5(result.fullName) : null);\n\n if (!tcId) {\n return \"\";\n }\n\n const paramsString = result.parameters\n .filter((p) => !p?.excluded)\n .sort((a, b) => a.name?.localeCompare(b?.name) || a.value?.localeCompare(b?.value))\n .map((p) => `${p.name ?? \"null\"}:${p.value ?? \"null\"}`)\n .join(\",\");\n const paramsHash = md5(paramsString);\n\n return `${tcId}:${paramsHash}`;\n};\n\nexport const getTestResultTestCaseId = (result: TestResult) => {\n return result.fullName ? md5(result.fullName) : undefined;\n};\n\nconst statusToPriority = (status: Status | undefined) => {\n if (!status) {\n return -1;\n }\n return StatusByPriority.indexOf(status);\n};\n\nexport const getWorstTestStepResult = (steps: StepResult[]): StepResult | undefined => {\n if (steps.length === 0) {\n return;\n }\n\n return [...steps].sort((a, b) => statusToPriority(a.status) - statusToPriority(b.status))[0];\n};\n\nexport const readImageAsBase64 = async (filePath: string): Promise<string | undefined> => {\n try {\n const file = await readFile(filePath, { encoding: \"base64\" });\n\n return file ? `data:image/png;base64,${file}` : undefined;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not read file ${filePath}`, e);\n return undefined;\n }\n};\n\nexport const getProjectRoot = (() => {\n let cachedProjectRoot: string | null = null;\n\n const resolveProjectRootByPath = () => {\n const cwd = process.cwd();\n let nextDir = cwd;\n let dir;\n\n do {\n dir = nextDir;\n try {\n fs.accessSync(path.join(dir, \"package.json\"), fs.constants.F_OK);\n\n // package.json exists; use the directory as the project root\n return dir;\n } catch {}\n\n nextDir = path.dirname(dir);\n } while (nextDir.length < dir.length);\n\n // package.json doesn't exist in any parent; fall back to CWD\n return cwd;\n };\n\n return () => {\n if (!cachedProjectRoot) {\n cachedProjectRoot = resolveProjectRootByPath();\n }\n return cachedProjectRoot;\n };\n})();\n\nexport const getRelativePath = (filepath: string) => {\n if (path.isAbsolute(filepath)) {\n const projectRoot = getProjectRoot();\n filepath = path.relative(projectRoot, filepath);\n }\n return filepath;\n};\n\nexport const getPosixPath = (filepath: string) => {\n if (process.platform === \"win32\") {\n return filepath.replaceAll(\"\\\\\", \"/\");\n }\n return filepath;\n};\n\nexport const deepClone = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));\n\nexport const getSuiteLabels = (suites: readonly string[]): Label[] => {\n if (suites.length === 0) {\n return [];\n }\n\n const [parentSuite, suite, ...subSuites] = suites;\n const labels: Label[] = [];\n\n if (parentSuite) {\n labels.push({\n name: LabelName.PARENT_SUITE,\n value: parentSuite,\n });\n }\n\n if (suite) {\n labels.push({\n name: LabelName.SUITE,\n value: suite,\n });\n }\n\n if (subSuites.length > 0) {\n labels.push({\n name: LabelName.SUB_SUITE,\n value: subSuites.join(\" > \"),\n });\n }\n\n return labels;\n};\n\nconst suiteLabelNames: readonly string[] = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE];\n\n/**\n * Resolves suite labels for the given test results and add default lables if there is no any suite label.\n * @example\n * ```ts\n * ensureSuiteLabels({ labels: [{ name: \"suite\", value: \"foo\" }] }, [\"bar\"]) // => [{ name: \"suite\", value: \"foo\" }]\n * ensureSuiteLabels({ labels: [] }, [\"bar\"]) // => [{ name: \"parentSuite\", value: \"bar\" }]\n * ```\n * @param test - Test result to resolve suite labels for\n * @param defaultSuites - Default suites to add if there is no any suite label\n * @returns Actual suite labels\n */\nexport const ensureSuiteLabels = (test: Partial<TestResult>, defaultSuites: readonly string[]) => {\n if (!test.labels?.find((l) => suiteLabelNames.includes(l.name))) {\n test.labels = [...(test.labels ?? []), ...getSuiteLabels(defaultSuites)];\n }\n\n return suiteLabelNames.map((name) => test.labels?.find((l) => l.name === name)).filter(Boolean) as Label[];\n};\n\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport const escapeRegExp = (value: string): string => {\n return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, \"\\\\$&\") : value;\n};\n\n// TODO: may also use URL.canParse instead (requires node.js v18.17, v19.9, or higher)\nconst isUrl = (potentialUrl: string) => {\n // Short-circuits the check for many short URL cases, bypassing the try-catch logic.\n if (potentialUrl.indexOf(\":\") === -1) {\n return false;\n }\n\n // There is ':' in the string: a potential scheme separator.\n // The string might be a proper URL already.\n try {\n new URL(potentialUrl);\n return true;\n } catch (e) {\n return false;\n }\n};\n\nexport const applyLinkTemplate = (template: LinkTemplate, value: string) =>\n typeof template === \"string\" ? template.replace(\"%s\", value) : template(value);\n\nexport const formatLink = (templates: LinkConfig, link: Link) => {\n const { url: originalUrl, name, type } = link;\n if (isUrl(originalUrl)) {\n return link;\n } else {\n const formattedLink = { ...link };\n const { urlTemplate, nameTemplate } = templates[type ?? LinkType.DEFAULT] ?? {};\n if (urlTemplate !== undefined) {\n formattedLink.url = applyLinkTemplate(urlTemplate, originalUrl);\n }\n if (name === undefined && nameTemplate !== undefined) {\n formattedLink.name = applyLinkTemplate(nameTemplate, originalUrl);\n }\n return formattedLink;\n }\n};\n\nexport const formatLinks = (templates: LinkConfig, links: readonly Link[]) =>\n links.map((link) => formatLink(templates, link));\n\nexport const createDefaultWriter = (config: { resultsDir?: string; emitter?: EventEmitter }) => {\n return process.env.ALLURE_TEST_MODE\n ? new MessageWriter(config.emitter)\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n });\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,aAAa;AAEpD,OAAOC,EAAE,MAAM,SAAS;AACxB,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,OAAOC,IAAI,MAAM,WAAW;AAC5B,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,gBAAgB,QAAQ,gBAAgB;AAEtE,SAASC,gBAAgB,QAAQ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CAAEoF,IAAI,IAAKF,UAAU,CAACC,SAAS,EAAEC,IAAI,CAAC,CAAC;AAElD,OAAO,IAAMY,mBAAmB,GAAIC,MAAuD,IAAK;EAC9F,OAAOhI,OAAO,CAACiI,GAAG,CAACC,gBAAgB,GAC/B,IAAI7H,aAAa,CAAC2H,MAAM,CAACG,OAAO,CAAC,GACjC,IAAI/H,gBAAgB,CAAC;IACnBgI,UAAU,EAAEJ,MAAM,CAACI,UAAU,IAAI;EACnC,CAAC,CAAC;AACR,CAAC","ignoreList":[]}
|
package/dist/types/model.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface AttachmentOptions {
|
|
|
8
8
|
contentType: ContentType | string;
|
|
9
9
|
encoding?: BufferEncoding;
|
|
10
10
|
fileExtension?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
body?: Buffer;
|
|
11
13
|
}
|
|
12
14
|
export interface Label {
|
|
13
15
|
name: LabelName | string;
|
|
@@ -48,12 +50,14 @@ interface Executable {
|
|
|
48
50
|
export interface FixtureResult extends Executable {
|
|
49
51
|
}
|
|
50
52
|
export interface StepResult extends Executable {
|
|
53
|
+
uuid?: string;
|
|
51
54
|
}
|
|
52
55
|
export interface TestResult extends Executable {
|
|
53
56
|
uuid: string;
|
|
54
57
|
historyId?: string;
|
|
55
58
|
fullName?: string;
|
|
56
59
|
testCaseId?: string;
|
|
60
|
+
titlePath?: string[];
|
|
57
61
|
labels: Label[];
|
|
58
62
|
links: Link[];
|
|
59
63
|
}
|
|
@@ -26,12 +26,15 @@ export interface StepStack {
|
|
|
26
26
|
export declare class ShallowStepsStack {
|
|
27
27
|
#private;
|
|
28
28
|
steps: StepResult[];
|
|
29
|
+
currentStep(): StepResult;
|
|
29
30
|
startStep(step: Partial<StepResult>): void;
|
|
30
31
|
updateStep(updateFunc: (result: StepResult) => void): void;
|
|
31
32
|
stopStep(opts?: {
|
|
32
33
|
stop?: number;
|
|
33
34
|
duration?: number;
|
|
34
35
|
}): void;
|
|
36
|
+
findStepByUuid(uuid: string): StepResult | undefined;
|
|
37
|
+
addAttachment(attachment: AttachmentOptions, writer: Writer): string;
|
|
35
38
|
}
|
|
36
39
|
export declare class DefaultStepStack implements StepStack {
|
|
37
40
|
private stepsByRoot;
|
|
@@ -15,7 +15,18 @@ export declare const getRelativePath: (filepath: string) => string;
|
|
|
15
15
|
export declare const getPosixPath: (filepath: string) => string;
|
|
16
16
|
export declare const deepClone: <T>(obj: T) => T;
|
|
17
17
|
export declare const getSuiteLabels: (suites: readonly string[]) => Label[];
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Resolves suite labels for the given test results and add default lables if there is no any suite label.
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* ensureSuiteLabels({ labels: [{ name: "suite", value: "foo" }] }, ["bar"]) // => [{ name: "suite", value: "foo" }]
|
|
23
|
+
* ensureSuiteLabels({ labels: [] }, ["bar"]) // => [{ name: "parentSuite", value: "bar" }]
|
|
24
|
+
* ```
|
|
25
|
+
* @param test - Test result to resolve suite labels for
|
|
26
|
+
* @param defaultSuites - Default suites to add if there is no any suite label
|
|
27
|
+
* @returns Actual suite labels
|
|
28
|
+
*/
|
|
29
|
+
export declare const ensureSuiteLabels: (test: Partial<TestResult>, defaultSuites: readonly string[]) => Label[];
|
|
19
30
|
export declare const escapeRegExp: (value: string) => string;
|
|
20
31
|
export declare const applyLinkTemplate: (template: LinkTemplate, value: string) => string;
|
|
21
32
|
export declare const formatLink: (templates: LinkConfig, link: Link) => Link;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure-js-commons",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Allure JS Commons",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
"eslint-plugin-n": "^17.10.1",
|
|
100
100
|
"eslint-plugin-no-null": "^1.0.2",
|
|
101
101
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
102
|
-
"npm-run-all2": "^
|
|
102
|
+
"npm-run-all2": "^8.0.0",
|
|
103
103
|
"rimraf": "^6.0.0",
|
|
104
104
|
"typescript": "^5.2.2",
|
|
105
105
|
"vitest": "^3.0.5"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
|
-
"allure-playwright": "3.
|
|
108
|
+
"allure-playwright": "3.3.0"
|
|
109
109
|
},
|
|
110
110
|
"peerDependenciesMeta": {
|
|
111
111
|
"allure-playwright": {
|