allure-js-commons 3.1.0 → 3.2.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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ReporterRuntime = void 0;
6
+ exports.ShallowStepsStack = exports.ReporterRuntime = exports.DefaultStepStack = void 0;
7
7
  var _path = require("path");
8
8
  var _model = require("../../model.js");
9
9
  var _LifecycleState = require("./LifecycleState.js");
@@ -15,13 +15,74 @@ var _attachments = require("./utils/attachments.js");
15
15
  var _loader = require("./writer/loader.js");
16
16
  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
17
  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
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
18
19
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
19
20
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
20
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
21
- 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"); }
22
21
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23
22
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
24
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint max-lines: 0 */
23
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
+ function _classPrivateGetter(s, r, a) { return a(_assertClassBrand(s, r)); }
25
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
26
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /* eslint max-lines: 0 */
27
+ var _runningSteps = /*#__PURE__*/new WeakMap();
28
+ var _ShallowStepsStack_brand = /*#__PURE__*/new WeakSet();
29
+ /**
30
+ * Simpler steps stack implementation that contains only the current steps without root nodes
31
+ * Useful, when you need to create steps without binding them to a specific test or fixture
32
+ * @example
33
+ * ```js
34
+ * const stack = new ShallowStepsStack();
35
+ *
36
+ * stack.startStep({ name: "step 1" });
37
+ * stack.startStep({ name: "step 1.1" });
38
+ * stack.stopStep({ status: Status.FAILED });
39
+ * stack.stopStep({ status: Status.PASSED });
40
+ * stack.steps // => [{ name: "step 1", status: Status.PASSED, steps: [{ name: "step 1.1", status: Status.FAILED }] }]
41
+ * ```
42
+ */
43
+ class ShallowStepsStack {
44
+ constructor() {
45
+ _classPrivateMethodInitSpec(this, _ShallowStepsStack_brand);
46
+ _defineProperty(this, "steps", []);
47
+ _classPrivateFieldInitSpec(this, _runningSteps, []);
48
+ }
49
+ startStep(step) {
50
+ var stepResult = _objectSpread(_objectSpread({}, (0, _factory.createStepResult)()), step);
51
+ if (_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
52
+ _classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep).steps.push(stepResult);
53
+ } else {
54
+ this.steps.push(stepResult);
55
+ }
56
+ _classPrivateFieldGet(_runningSteps, this).push(stepResult);
57
+ }
58
+ updateStep(updateFunc) {
59
+ if (!_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
60
+ // eslint-disable-next-line no-console
61
+ console.error("There is no running step in the stack to update!");
62
+ return;
63
+ }
64
+ updateFunc(_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep));
65
+ }
66
+ stopStep(opts) {
67
+ if (!_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
68
+ // eslint-disable-next-line no-console
69
+ console.error("There is no running step in the stack to stop!");
70
+ return;
71
+ }
72
+ var {
73
+ stop,
74
+ duration = 0
75
+ } = opts !== null && opts !== void 0 ? opts : {};
76
+ this.updateStep(result => {
77
+ result.stop = (stop !== null && stop !== void 0 ? stop : result.start) ? result.start + duration : undefined;
78
+ });
79
+ _classPrivateFieldGet(_runningSteps, this).pop();
80
+ }
81
+ }
82
+ exports.ShallowStepsStack = ShallowStepsStack;
83
+ function _get_currentStep(_this) {
84
+ return _classPrivateFieldGet(_runningSteps, _this)[_classPrivateFieldGet(_runningSteps, _this).length - 1];
85
+ }
25
86
  class DefaultStepStack {
26
87
  constructor() {
27
88
  _defineProperty(this, "stepsByRoot", new Map());
@@ -67,6 +128,7 @@ class DefaultStepStack {
67
128
  this.stepsByRoot.set(rootUuid, newValue);
68
129
  }
69
130
  }
131
+ exports.DefaultStepStack = DefaultStepStack;
70
132
  var _handleMetadataMessage = /*#__PURE__*/new WeakMap();
71
133
  var _handleStepMetadataMessage = /*#__PURE__*/new WeakMap();
72
134
  var _handleStartStepMessage = /*#__PURE__*/new WeakMap();
@@ -79,7 +141,7 @@ var _writeContainer = /*#__PURE__*/new WeakMap();
79
141
  var _calculateTimings = /*#__PURE__*/new WeakMap();
80
142
  class ReporterRuntime {
81
143
  constructor(_ref) {
82
- var _this = this;
144
+ var _this2 = this;
83
145
  var {
84
146
  writer,
85
147
  listeners = [],
@@ -161,9 +223,9 @@ class ReporterRuntime {
161
223
  var testResult = _objectSpread(_objectSpread({}, (0, _factory.createTestResult)(uuid)), {}, {
162
224
  start: Date.now()
163
225
  }, (0, _utils.deepClone)(result));
164
- _this.notifier.beforeTestResultStart(testResult);
226
+ _this2.notifier.beforeTestResultStart(testResult);
165
227
  scopeUuids.forEach(scopeUuid => {
166
- var scope = _this.state.getScope(scopeUuid);
228
+ var scope = _this2.state.getScope(scopeUuid);
167
229
  if (!scope) {
168
230
  // eslint-disable-next-line no-console
169
231
  console.error("count not link test to the scope: no scope with uuid ".concat(uuid, " is found"));
@@ -171,8 +233,8 @@ class ReporterRuntime {
171
233
  }
172
234
  scope.tests.push(uuid);
173
235
  });
174
- _this.state.setTestResult(uuid, testResult, scopeUuids);
175
- _this.notifier.afterTestResultStart(testResult);
236
+ _this2.state.setTestResult(uuid, testResult, scopeUuids);
237
+ _this2.notifier.afterTestResultStart(testResult);
176
238
  return uuid;
177
239
  });
178
240
  _defineProperty(this, "updateTest", (uuid, updateFunc) => {
@@ -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","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","set","has","TypeError","_classPrivateFieldGet","s","get","_assertClassBrand","n","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","DefaultStepStack","constructor","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","uuid","randomUuid","state","setScope","updateFunc","scope","getScope","console","error","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","Stage","FINISHED","result","scopeUuids","undefined","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","stepResult","createStepResult","steps","setStepResult","addStep","step","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","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","Array","isArray","entries","flatMap","_ref3","v","exports"],"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\ninterface 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\nclass 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;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P,IAAI,EAAEK,MAAM,CAACL,IAAI,GAAGiH,IAAI,CAACE,KAAK,CAAC9G,MAAM,CAACL,IAAI,CAAC,GAAGO;MAChD,CAAC;IACH,CAAC;IAhlBC,IAAI,CAACvC,MAAM,GAAG,IAAAoJ,qBAAa,EAACpJ,MAAM,CAAC;IACnC,IAAI,CAAC2C,QAAQ,GAAG,IAAI0G,kBAAQ,CAAC;MAAEpJ;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACsH,UAAU,GAAGpH,MAAK;IAEvB,IAAIkJ,KAAK,CAACC,OAAO,CAAClJ,YAAY,CAAC,EAAE;MAC/B,IAAI,CAACA,YAAY,GAAGA,YAAY;IAClC,CAAC,MAAM,IAAItE,MAAM,CAACC,IAAI,CAACqE,YAAY,CAAC,CAAC3D,MAAM,EAAE;MAC3C,IAAI,CAAC2D,YAAY,GAAGtE,MAAM,CAACyN,OAAO,CAACnJ,YAAY,CAAC,CAACoJ,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACtD,IAAI,EAAExI,KAAK,CAAC,GAAA8L,KAAA;QACrE,IAAIJ,KAAK,CAACC,OAAO,CAAC3L,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAAC+I,GAAG,CAAEgD,CAAC,KAAM;YAAEvD,IAAI;YAAExI,KAAK,EAAE+L;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLvD,IAAI;UACJxI;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF;AAACgM,OAAA,CAAA/J,eAAA,GAAAA,eAAA","ignoreList":[]}
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,QA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I,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACyG,UAAU,GAAGvG,MAAK;IAEvB,IAAIiI,KAAK,CAACC,OAAO,CAACjI,YAAY,CAAC,EAAE;MAC/B,IAAI,CAACA,YAAY,GAAGA,YAAY;IAClC,CAAC,MAAM,IAAIjG,MAAM,CAACC,IAAI,CAACgG,YAAY,CAAC,CAACtF,MAAM,EAAE;MAC3C,IAAI,CAACsF,YAAY,GAAGjG,MAAM,CAACmO,OAAO,CAAClI,YAAY,CAAC,CAACmI,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAAClD,IAAI,EAAEzJ,KAAK,CAAC,GAAA2M,KAAA;QACrE,IAAIJ,KAAK,CAACC,OAAO,CAACxM,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAACgK,GAAG,CAAE4C,CAAC,KAAM;YAAEnD,IAAI;YAAEzJ,KAAK,EAAE4M;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLnD,IAAI;UACJzJ;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF;AAACwC,OAAA,CAAAuB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -7,7 +7,9 @@ var _exportNames = {
7
7
  ALLURE_METADATA_CONTENT_TYPE: true,
8
8
  ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE: true,
9
9
  LifecycleState: true,
10
+ DefaultStepStack: true,
10
11
  ReporterRuntime: true,
12
+ ShallowStepsStack: true,
11
13
  InMemoryWriter: true,
12
14
  FileSystemWriter: true,
13
15
  MessageWriter: true,
@@ -33,6 +35,12 @@ Object.defineProperty(exports, "ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE", {
33
35
  return _types.ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE;
34
36
  }
35
37
  });
38
+ Object.defineProperty(exports, "DefaultStepStack", {
39
+ enumerable: true,
40
+ get: function get() {
41
+ return _ReporterRuntime.DefaultStepStack;
42
+ }
43
+ });
36
44
  Object.defineProperty(exports, "FileSystemWriter", {
37
45
  enumerable: true,
38
46
  get: function get() {
@@ -69,6 +77,12 @@ Object.defineProperty(exports, "ReporterRuntime", {
69
77
  return _ReporterRuntime.ReporterRuntime;
70
78
  }
71
79
  });
80
+ Object.defineProperty(exports, "ShallowStepsStack", {
81
+ enumerable: true,
82
+ get: function get() {
83
+ return _ReporterRuntime.ShallowStepsStack;
84
+ }
85
+ });
72
86
  Object.defineProperty(exports, "getEnvironmentLabels", {
73
87
  enumerable: true,
74
88
  get: function get() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_types","require","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_testplan","_factory","_LifecycleState","_ReporterRuntime","_InMemoryWriter","_FileSystemWriter","_MessageWriter","_MessageReader","_labels","_envInfo"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { ReporterRuntime } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {\n getEnvironmentLabels,\n getHostLabel,\n getThreadLabel,\n getPackageLabel,\n getLanguageLabel,\n getFrameworkLabel,\n} from \"./utils/labels.js\";\nexport { parseEnvInfo, stringifyEnvInfo } from \"./utils/envInfo.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,QAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,eAAA,GAAAhB,OAAA;AACA,IAAAiB,gBAAA,GAAAjB,OAAA;AACA,IAAAkB,eAAA,GAAAlB,OAAA;AACA,IAAAmB,iBAAA,GAAAnB,OAAA;AACA,IAAAoB,cAAA,GAAApB,OAAA;AACA,IAAAqB,cAAA,GAAArB,OAAA;AACA,IAAAsB,OAAA,GAAAtB,OAAA;AAQA,IAAAuB,QAAA,GAAAvB,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_types","require","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_testplan","_factory","_LifecycleState","_ReporterRuntime","_InMemoryWriter","_FileSystemWriter","_MessageWriter","_MessageReader","_labels","_envInfo"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { type StepStack, DefaultStepStack, ReporterRuntime, ShallowStepsStack } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {\n getEnvironmentLabels,\n getHostLabel,\n getThreadLabel,\n getPackageLabel,\n getLanguageLabel,\n getFrameworkLabel,\n} from \"./utils/labels.js\";\nexport { parseEnvInfo, stringifyEnvInfo } from \"./utils/envInfo.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;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AC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,QAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,QAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,eAAA,GAAAhB,OAAA;AACA,IAAAiB,gBAAA,GAAAjB,OAAA;AACA,IAAAkB,eAAA,GAAAlB,OAAA;AACA,IAAAmB,iBAAA,GAAAnB,OAAA;AACA,IAAAoB,cAAA,GAAApB,OAAA;AACA,IAAAqB,cAAA,GAAArB,OAAA;AACA,IAAAsB,OAAA,GAAAtB,OAAA;AAQA,IAAAuB,QAAA,GAAAvB,OAAA","ignoreList":[]}
@@ -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 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,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,YAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AAEA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAA0D,SAAAE,uBAAAO,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,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAD,OAAA,CAAAG,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ACM,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","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,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,YAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA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,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,12 +1,14 @@
1
1
  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; }
2
2
  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; }
3
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
3
4
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
4
5
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
5
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
6
- 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"); }
7
6
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
8
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _classPrivateGetter(s, r, a) { return a(_assertClassBrand(s, r)); }
10
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
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"); }
10
12
  /* eslint max-lines: 0 */
11
13
  import { extname } from "path";
12
14
  import { Stage } from "../../model.js";
@@ -17,7 +19,65 @@ import { hasSkipLabel } from "./testplan.js";
17
19
  import { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from "./utils.js";
18
20
  import { buildAttachmentFileName } from "./utils/attachments.js";
19
21
  import { resolveWriter } from "./writer/loader.js";
20
- class DefaultStepStack {
22
+ var _runningSteps = /*#__PURE__*/new WeakMap();
23
+ var _ShallowStepsStack_brand = /*#__PURE__*/new WeakSet();
24
+ /**
25
+ * Simpler steps stack implementation that contains only the current steps without root nodes
26
+ * Useful, when you need to create steps without binding them to a specific test or fixture
27
+ * @example
28
+ * ```js
29
+ * const stack = new ShallowStepsStack();
30
+ *
31
+ * stack.startStep({ name: "step 1" });
32
+ * stack.startStep({ name: "step 1.1" });
33
+ * stack.stopStep({ status: Status.FAILED });
34
+ * stack.stopStep({ status: Status.PASSED });
35
+ * stack.steps // => [{ name: "step 1", status: Status.PASSED, steps: [{ name: "step 1.1", status: Status.FAILED }] }]
36
+ * ```
37
+ */
38
+ export class ShallowStepsStack {
39
+ constructor() {
40
+ _classPrivateMethodInitSpec(this, _ShallowStepsStack_brand);
41
+ _defineProperty(this, "steps", []);
42
+ _classPrivateFieldInitSpec(this, _runningSteps, []);
43
+ }
44
+ startStep(step) {
45
+ var stepResult = _objectSpread(_objectSpread({}, createStepResult()), step);
46
+ if (_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
47
+ _classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep).steps.push(stepResult);
48
+ } else {
49
+ this.steps.push(stepResult);
50
+ }
51
+ _classPrivateFieldGet(_runningSteps, this).push(stepResult);
52
+ }
53
+ updateStep(updateFunc) {
54
+ if (!_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
55
+ // eslint-disable-next-line no-console
56
+ console.error("There is no running step in the stack to update!");
57
+ return;
58
+ }
59
+ updateFunc(_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep));
60
+ }
61
+ stopStep(opts) {
62
+ if (!_classPrivateGetter(_ShallowStepsStack_brand, this, _get_currentStep)) {
63
+ // eslint-disable-next-line no-console
64
+ console.error("There is no running step in the stack to stop!");
65
+ return;
66
+ }
67
+ var {
68
+ stop,
69
+ duration = 0
70
+ } = opts !== null && opts !== void 0 ? opts : {};
71
+ this.updateStep(result => {
72
+ result.stop = (stop !== null && stop !== void 0 ? stop : result.start) ? result.start + duration : undefined;
73
+ });
74
+ _classPrivateFieldGet(_runningSteps, this).pop();
75
+ }
76
+ }
77
+ function _get_currentStep(_this) {
78
+ return _classPrivateFieldGet(_runningSteps, _this)[_classPrivateFieldGet(_runningSteps, _this).length - 1];
79
+ }
80
+ export class DefaultStepStack {
21
81
  constructor() {
22
82
  _defineProperty(this, "stepsByRoot", new Map());
23
83
  _defineProperty(this, "rootsByStep", new Map());
@@ -74,7 +134,7 @@ var _writeContainer = /*#__PURE__*/new WeakMap();
74
134
  var _calculateTimings = /*#__PURE__*/new WeakMap();
75
135
  export class ReporterRuntime {
76
136
  constructor(_ref) {
77
- var _this = this;
137
+ var _this2 = this;
78
138
  var {
79
139
  writer,
80
140
  listeners = [],
@@ -156,9 +216,9 @@ export class ReporterRuntime {
156
216
  var testResult = _objectSpread(_objectSpread({}, createTestResult(uuid)), {}, {
157
217
  start: Date.now()
158
218
  }, deepClone(result));
159
- _this.notifier.beforeTestResultStart(testResult);
219
+ _this2.notifier.beforeTestResultStart(testResult);
160
220
  scopeUuids.forEach(scopeUuid => {
161
- var scope = _this.state.getScope(scopeUuid);
221
+ var scope = _this2.state.getScope(scopeUuid);
162
222
  if (!scope) {
163
223
  // eslint-disable-next-line no-console
164
224
  console.error("count not link test to the scope: no scope with uuid ".concat(uuid, " is found"));
@@ -166,8 +226,8 @@ export class ReporterRuntime {
166
226
  }
167
227
  scope.tests.push(uuid);
168
228
  });
169
- _this.state.setTestResult(uuid, testResult, scopeUuids);
170
- _this.notifier.afterTestResultStart(testResult);
229
+ _this2.state.setTestResult(uuid, testResult, scopeUuids);
230
+ _this2.notifier.afterTestResultStart(testResult);
171
231
  return uuid;
172
232
  });
173
233
  _defineProperty(this, "updateTest", (uuid, updateFunc) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","DefaultStepStack","constructor","_defineProperty","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","length","set","push","removeStep","newValue","filter","value","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","globalLabels","uuid","state","setScope","updateFunc","scope","getScope","console","error","concat","_classPrivateFieldGet","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","_objectSpread","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","FINISHED","result","scopeUuids","arguments","undefined","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","stepResult","steps","setStepResult","addStep","step","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","_classPrivateFieldInitSpec","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","updateStep","startStep","status","statusDetails","stopStep","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\ninterface 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\nclass 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,SAASA,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;AA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J,IAAI;QAC5B;MACF;MACA,OAAO;QACLR,KAAK,EAAEY,MAAM,CAACZ,KAAK,GAAGkH,IAAI,CAACE,KAAK,CAACxG,MAAM,CAACZ,KAAK,CAAC,GAAGe,SAAS;QAC1DP,IAAI,EAAEI,MAAM,CAACJ,IAAI,GAAG0G,IAAI,CAACE,KAAK,CAACxG,MAAM,CAACJ,IAAI,CAAC,GAAGO;MAChD,CAAC;IACH,CAAC;IAhlBC,IAAI,CAACvC,MAAM,GAAGnC,aAAa,CAACmC,MAAM,CAAC;IACnC,IAAI,CAACyC,QAAQ,GAAG,IAAIvF,QAAQ,CAAC;MAAE+C;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAAC+G,UAAU,GAAG7G,MAAK;IAEvB,IAAIyI,KAAK,CAACC,OAAO,CAACzI,YAAY,CAAC,EAAE;MAC/B,IAAI,CAACA,YAAY,GAAGA,YAAY;IAClC,CAAC,MAAM,IAAI0I,MAAM,CAACC,IAAI,CAAC3I,YAAY,CAAC,CAAC1B,MAAM,EAAE;MAC3C,IAAI,CAAC0B,YAAY,GAAG0I,MAAM,CAACE,OAAO,CAAC5I,YAAY,CAAC,CAAC6I,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACvD,IAAI,EAAE3G,KAAK,CAAC,GAAAkK,KAAA;QACrE,IAAIN,KAAK,CAACC,OAAO,CAAC7J,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAACkH,GAAG,CAAEiD,CAAC,KAAM;YAAExD,IAAI;YAAE3G,KAAK,EAAEmK;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLxD,IAAI;UACJ3G;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF","ignoreList":[]}
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,SAASA,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,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAChH,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAAC,IAAAC,aAAA,oBAAAC,OAAA;AAAA,IAAA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AmB;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":[]}
@@ -3,7 +3,7 @@ export * from "./utils.js";
3
3
  export * from "./testplan.js";
4
4
  export * from "./factory.js";
5
5
  export { LifecycleState } from "./LifecycleState.js";
6
- export { ReporterRuntime } from "./ReporterRuntime.js";
6
+ export { DefaultStepStack, ReporterRuntime, ShallowStepsStack } from "./ReporterRuntime.js";
7
7
  export { InMemoryWriter } from "./writer/InMemoryWriter.js";
8
8
  export { FileSystemWriter } from "./writer/FileSystemWriter.js";
9
9
  export { MessageWriter } from "./writer/MessageWriter.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE","LifecycleState","ReporterRuntime","InMemoryWriter","FileSystemWriter","MessageWriter","MessageReader","getEnvironmentLabels","getHostLabel","getThreadLabel","getPackageLabel","getLanguageLabel","getFrameworkLabel","parseEnvInfo","stringifyEnvInfo"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { ReporterRuntime } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {\n getEnvironmentLabels,\n getHostLabel,\n getThreadLabel,\n getPackageLabel,\n getLanguageLabel,\n getFrameworkLabel,\n} from \"./utils/labels.js\";\nexport { parseEnvInfo, stringifyEnvInfo } from \"./utils/envInfo.js\";\n"],"mappings":"AACA,SAASA,4BAA4B,EAAEC,mCAAmC,QAAQ,YAAY;AAC9F,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SACEC,oBAAoB,EACpBC,YAAY,EACZC,cAAc,EACdC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,mBAAmB;AAC1B,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE","LifecycleState","DefaultStepStack","ReporterRuntime","ShallowStepsStack","InMemoryWriter","FileSystemWriter","MessageWriter","MessageReader","getEnvironmentLabels","getHostLabel","getThreadLabel","getPackageLabel","getLanguageLabel","getFrameworkLabel","parseEnvInfo","stringifyEnvInfo"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { type StepStack, DefaultStepStack, ReporterRuntime, ShallowStepsStack } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {\n getEnvironmentLabels,\n getHostLabel,\n getThreadLabel,\n getPackageLabel,\n getLanguageLabel,\n getFrameworkLabel,\n} from \"./utils/labels.js\";\nexport { parseEnvInfo, stringifyEnvInfo } from \"./utils/envInfo.js\";\n"],"mappings":"AACA,SAASA,4BAA4B,EAAEC,mCAAmC,QAAQ,YAAY;AAC9F,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAAyBC,gBAAgB,EAAEC,eAAe,EAAEC,iBAAiB,QAAQ,sBAAsB;AAC3G,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SACEC,oBAAoB,EACpBC,YAAY,EACZC,cAAc,EACdC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,mBAAmB;AAC1B,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,oBAAoB","ignoreList":[]}
@@ -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 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,aAAa,QAAQ,2BAA2B;AAEzD,OAAO,IAAMC,UAAU,GAAGA,CAAA,KAAM;EAC9B,OAAOV,UAAU,CAAC,CAAC;AACrB,CAAC;AAED,OAAO,IAAMW,GAAG,GAAIC,GAAW,IAAK;EAClC,OAAOb,UAAU,CAAC,KAAK,CAAC,CAACc,MAAM,CAACD,GAAG,CAAC,CAACE,MAAM,CAAC,KAAK,CAAC;AACpD,CAAC;AAED,OAAO,IAAMC,sBAAsB,GAAIC,MAAkB,IAAK;EAAA,IAAAC,kBAAA;EAC5D,IAAID,MAAM,CAACE,SAAS,EAAE;IACpB,OAAOF,MAAM,CAACE,SAAS;EACzB;EAEA,IAAMC,IAAI,IAAAF,kBAAA,GAAGD,MAAM,CAACI,UAAU,cAAAH,kBAAA,cAAAA,kBAAA,GAAKD,MAAM,CAACK,QAAQ,GAAGV,GAAG,CAACK,MAAM,CAACK,QAAQ,CAAC,GAAG,IAAK;EAEjF,IAAI,CAACF,IAAI,EAAE;IACT,OAAO,EAAE;EACX;EAEA,IAAMG,YAAY,GAAGN,MAAM,CAACO,UAAU,CACnCC,MAAM,CAAEC,CAAC,IAA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AC1F,IAAI,GAAGiF,iBAAiB,CAACY,YAAY,EAAEN,WAAW,CAAC;IACnE;IACA,OAAOG,aAAa;EACtB;AACF,CAAC;AAED,OAAO,IAAMK,WAAW,GAAGA,CAACX,SAAqB,EAAEY,KAAsB,KACvEA,KAAK,CAAC7F,GAAG,CAAEkF,IAAI,IAAKF,UAAU,CAACC,SAAS,EAAEC,IAAI,CAAC,CAAC;AAElD,OAAO,IAAMY,mBAAmB,GAAIC,MAAuD,IAAK;EAC9F,OAAO9H,OAAO,CAAC+H,GAAG,CAACC,gBAAgB,GAC/B,IAAI3H,aAAa,CAACyH,MAAM,CAACG,OAAO,CAAC,GACjC,IAAI7H,gBAAgB,CAAC;IACnB8H,UAAU,EAAEJ,MAAM,CAACI,UAAU,IAAI;EACnC,CAAC,CAAC;AACR,CAAC","ignoreList":[]}
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;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AgB,GAC/B,IAAI3H,aAAa,CAACyH,MAAM,CAACG,OAAO,CAAC,GACjC,IAAI7H,gBAAgB,CAAC;IACnB8H,UAAU,EAAEJ,MAAM,CAACI,UAAU,IAAI;EACnC,CAAC,CAAC;AACR,CAAC","ignoreList":[]}
@@ -2,6 +2,46 @@
2
2
  import { type AttachmentOptions, type FixtureResult, type Label, type StepResult, type TestResult } from "../../model.js";
3
3
  import type { Category, EnvironmentInfo, RuntimeMessage } from "../types.js";
4
4
  import type { FixtureType, LinkConfig, ReporterRuntimeConfig, TestScope, Writer } from "./types.js";
5
+ export interface StepStack {
6
+ clear(): void;
7
+ removeRoot(rootUuid: string): void;
8
+ currentStep(rootUuid: string): string | undefined;
9
+ addStep(rootUuid: string, stepUuid: string): void;
10
+ removeStep(stepUuid: string): void;
11
+ }
12
+ /**
13
+ * Simpler steps stack implementation that contains only the current steps without root nodes
14
+ * Useful, when you need to create steps without binding them to a specific test or fixture
15
+ * @example
16
+ * ```js
17
+ * const stack = new ShallowStepsStack();
18
+ *
19
+ * stack.startStep({ name: "step 1" });
20
+ * stack.startStep({ name: "step 1.1" });
21
+ * stack.stopStep({ status: Status.FAILED });
22
+ * stack.stopStep({ status: Status.PASSED });
23
+ * stack.steps // => [{ name: "step 1", status: Status.PASSED, steps: [{ name: "step 1.1", status: Status.FAILED }] }]
24
+ * ```
25
+ */
26
+ export declare class ShallowStepsStack {
27
+ #private;
28
+ steps: StepResult[];
29
+ startStep(step: Partial<StepResult>): void;
30
+ updateStep(updateFunc: (result: StepResult) => void): void;
31
+ stopStep(opts?: {
32
+ stop?: number;
33
+ duration?: number;
34
+ }): void;
35
+ }
36
+ export declare class DefaultStepStack implements StepStack {
37
+ private stepsByRoot;
38
+ private rootsByStep;
39
+ clear: () => void;
40
+ removeRoot: (rootUuid: string) => void;
41
+ currentStep: (rootUuid: string) => string | undefined;
42
+ addStep: (rootUuid: string, stepUuid: string) => void;
43
+ removeStep(stepUuid: string): void;
44
+ }
5
45
  export declare class ReporterRuntime {
6
46
  #private;
7
47
  private readonly state;
@@ -4,7 +4,7 @@ export * from "./utils.js";
4
4
  export * from "./testplan.js";
5
5
  export * from "./factory.js";
6
6
  export { LifecycleState } from "./LifecycleState.js";
7
- export { ReporterRuntime } from "./ReporterRuntime.js";
7
+ export { type StepStack, DefaultStepStack, ReporterRuntime, ShallowStepsStack } from "./ReporterRuntime.js";
8
8
  export { InMemoryWriter } from "./writer/InMemoryWriter.js";
9
9
  export { FileSystemWriter } from "./writer/FileSystemWriter.js";
10
10
  export { MessageWriter } from "./writer/MessageWriter.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure-js-commons",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Allure JS Commons",
5
5
  "keywords": [
6
6
  "allure",
@@ -102,10 +102,10 @@
102
102
  "npm-run-all2": "^7.0.0",
103
103
  "rimraf": "^6.0.0",
104
104
  "typescript": "^5.2.2",
105
- "vitest": "^2.1.8"
105
+ "vitest": "^3.0.5"
106
106
  },
107
107
  "peerDependencies": {
108
- "allure-playwright": "3.1.0"
108
+ "allure-playwright": "3.2.0"
109
109
  },
110
110
  "peerDependenciesMeta": {
111
111
  "allure-playwright": {