allure-js-commons 3.14.0 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +15 -2
  2. package/dist/cjs/facade.js +37 -1
  3. package/dist/cjs/facade.js.map +1 -1
  4. package/dist/cjs/index.js +36 -0
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/model.js +6 -2
  7. package/dist/cjs/model.js.map +1 -1
  8. package/dist/cjs/sdk/index.js.map +1 -1
  9. package/dist/cjs/sdk/reporter/Notifier.js +1 -3
  10. package/dist/cjs/sdk/reporter/Notifier.js.map +1 -1
  11. package/dist/cjs/sdk/reporter/ReporterRuntime.js +113 -54
  12. package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
  13. package/dist/cjs/sdk/reporter/index.js.map +1 -1
  14. package/dist/cjs/sdk/reporter/testplan.js +24 -18
  15. package/dist/cjs/sdk/reporter/testplan.js.map +1 -1
  16. package/dist/cjs/sdk/reporter/types.js.map +1 -1
  17. package/dist/cjs/sdk/reporter/utils/envInfo.js +10 -1
  18. package/dist/cjs/sdk/reporter/utils/envInfo.js.map +1 -1
  19. package/dist/cjs/sdk/reporter/utils.js +26 -11
  20. package/dist/cjs/sdk/reporter/utils.js.map +1 -1
  21. package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js +1 -1
  22. package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
  23. package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js +4 -5
  24. package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
  25. package/dist/cjs/sdk/reporter/writer/MessageReader.js +24 -13
  26. package/dist/cjs/sdk/reporter/writer/MessageReader.js.map +1 -1
  27. package/dist/cjs/sdk/reporter/writer/MessageWriter.js +2 -2
  28. package/dist/cjs/sdk/reporter/writer/MessageWriter.js.map +1 -1
  29. package/dist/cjs/sdk/runtime/MessageTestRuntime.js +98 -30
  30. package/dist/cjs/sdk/runtime/MessageTestRuntime.js.map +1 -1
  31. package/dist/cjs/sdk/runtime/NoopTestRuntime.js +48 -12
  32. package/dist/cjs/sdk/runtime/NoopTestRuntime.js.map +1 -1
  33. package/dist/cjs/sdk/runtime/types.js.map +1 -1
  34. package/dist/cjs/sdk/types.js.map +1 -1
  35. package/dist/cjs/sdk/utils.js +49 -34
  36. package/dist/cjs/sdk/utils.js.map +1 -1
  37. package/dist/cjs/sync.js +24 -0
  38. package/dist/cjs/sync.js.map +1 -1
  39. package/dist/cjs/syncFacade.js +17 -1
  40. package/dist/cjs/syncFacade.js.map +1 -1
  41. package/dist/esm/facade.js +31 -0
  42. package/dist/esm/facade.js.map +1 -1
  43. package/dist/esm/index.js +2 -2
  44. package/dist/esm/index.js.map +1 -1
  45. package/dist/esm/model.js +6 -0
  46. package/dist/esm/model.js.map +1 -1
  47. package/dist/esm/sdk/index.js.map +1 -1
  48. package/dist/esm/sdk/reporter/Notifier.js +1 -3
  49. package/dist/esm/sdk/reporter/Notifier.js.map +1 -1
  50. package/dist/esm/sdk/reporter/ReporterRuntime.js +113 -54
  51. package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
  52. package/dist/esm/sdk/reporter/index.js.map +1 -1
  53. package/dist/esm/sdk/reporter/testplan.js +24 -16
  54. package/dist/esm/sdk/reporter/testplan.js.map +1 -1
  55. package/dist/esm/sdk/reporter/types.js.map +1 -1
  56. package/dist/esm/sdk/reporter/utils/envInfo.js +10 -1
  57. package/dist/esm/sdk/reporter/utils/envInfo.js.map +1 -1
  58. package/dist/esm/sdk/reporter/utils.js +24 -11
  59. package/dist/esm/sdk/reporter/utils.js.map +1 -1
  60. package/dist/esm/sdk/reporter/writer/FileSystemWriter.js +1 -1
  61. package/dist/esm/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
  62. package/dist/esm/sdk/reporter/writer/InMemoryWriter.js +4 -5
  63. package/dist/esm/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
  64. package/dist/esm/sdk/reporter/writer/MessageReader.js +24 -13
  65. package/dist/esm/sdk/reporter/writer/MessageReader.js.map +1 -1
  66. package/dist/esm/sdk/reporter/writer/MessageWriter.js +2 -2
  67. package/dist/esm/sdk/reporter/writer/MessageWriter.js.map +1 -1
  68. package/dist/esm/sdk/runtime/MessageTestRuntime.js +98 -30
  69. package/dist/esm/sdk/runtime/MessageTestRuntime.js.map +1 -1
  70. package/dist/esm/sdk/runtime/NoopTestRuntime.js +48 -12
  71. package/dist/esm/sdk/runtime/NoopTestRuntime.js.map +1 -1
  72. package/dist/esm/sdk/runtime/types.js.map +1 -1
  73. package/dist/esm/sdk/types.js.map +1 -1
  74. package/dist/esm/sdk/utils.js +49 -33
  75. package/dist/esm/sdk/utils.js.map +1 -1
  76. package/dist/esm/sync.js +1 -1
  77. package/dist/esm/sync.js.map +1 -1
  78. package/dist/esm/syncFacade.js +12 -0
  79. package/dist/esm/syncFacade.js.map +1 -1
  80. package/dist/types/facade.d.ts +6 -0
  81. package/dist/types/index.d.ts +3 -3
  82. package/dist/types/model.d.ts +9 -1
  83. package/dist/types/sdk/index.d.ts +1 -1
  84. package/dist/types/sdk/reporter/ReporterRuntime.d.ts +11 -1
  85. package/dist/types/sdk/reporter/index.d.ts +1 -1
  86. package/dist/types/sdk/reporter/testplan.d.ts +5 -1
  87. package/dist/types/sdk/reporter/types.d.ts +6 -2
  88. package/dist/types/sdk/reporter/utils.d.ts +3 -0
  89. package/dist/types/sdk/reporter/writer/FileSystemWriter.d.ts +2 -2
  90. package/dist/types/sdk/reporter/writer/InMemoryWriter.d.ts +3 -3
  91. package/dist/types/sdk/reporter/writer/MessageWriter.d.ts +2 -2
  92. package/dist/types/sdk/runtime/MessageTestRuntime.d.ts +6 -2
  93. package/dist/types/sdk/runtime/NoopTestRuntime.d.ts +9 -1
  94. package/dist/types/sdk/runtime/types.d.ts +10 -2
  95. package/dist/types/sdk/types.d.ts +10 -5
  96. package/dist/types/sdk/utils.d.ts +4 -3
  97. package/dist/types/sync.d.ts +1 -1
  98. package/dist/types/syncFacade.d.ts +4 -0
  99. package/package.json +12 -11
@@ -1 +1 @@
1
- {"version":3,"file":"ReporterRuntime.js","names":["path","extname","Stage","createFixtureResult","createStepResult","createTestResult","LifecycleState","Notifier","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","_classPrivateMethodInitSpec","_defineProperty","_classPrivateFieldInitSpec","currentStep","_classPrivateGetter","_get_currentStep","startStep","step","stepResult","_objectSpread","steps","push","_classPrivateFieldGet","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","s","found","addAttachment","attachment","writer","isPath","fileExt","fileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","_this","length","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","set","removeStep","newValue","filter","value","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_handleGlobalAttachmentContentMessage","_handleGlobalAttachmentPathMessage","_handleGlobalErrorMessage","_handlePerformanceResultMessage","_findParent","_writeAttachmentFile","_createAttachment","_createGlobalAttachment","_writeGlobals","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","state","setScope","scope","getScope","concat","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","FINISHED","scopeUuids","arguments","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","historyId","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","wrapInStep","timestamp","name","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","source","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","status","statusDetails","Buffer","from","content","encoding","attachmentContent","attachmentSource","errors","_message$fileExtensio","results","_this$writer$writePer","_this$writer","writePerformanceResults","root","getExecutionItem","globals","writeGlobals","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","Array","isArray","Object","keys","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\n\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Globals,\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 RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimePerformanceResultMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = (stop ?? result.start) ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = this.#writeAttachmentFile(attachmentContentOrPath, {\n ...options,\n fileExtension: options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined),\n });\n const attachment = this.#createAttachment(attachmentName, options.contentType, attachmentFileName);\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 case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n return;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n return;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n return;\n case \"performance_result\":\n this.#handlePerformanceResultMessage(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 applyGlobalRuntimeMessages = (messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n break;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n break;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n break;\n case \"performance_result\":\n this.#handlePerformanceResultMessage(message.data);\n break;\n default:\n break;\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 #handleGlobalAttachmentContentMessage = (message: RuntimeGlobalAttachmentContentMessage[\"data\"]) => {\n const attachmentContent = Buffer.from(message.content, message.encoding);\n const attachmentSource = this.#writeAttachmentFile(attachmentContent, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalAttachmentPathMessage = (message: RuntimeGlobalAttachmentPathMessage[\"data\"]) => {\n const attachmentSource = this.#writeAttachmentFile(message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension ?? extname(message.path),\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalErrorMessage = (message: RuntimeGlobalErrorMessage[\"data\"]) => {\n this.#writeGlobals({\n attachments: [],\n errors: [{ ...message, timestamp: Date.now() }],\n });\n };\n\n #handlePerformanceResultMessage = (results: RuntimePerformanceResultMessage[\"data\"]) => {\n this.writer.writePerformanceResults?.(`${randomUuid()}-perf.json`, results);\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 #writeAttachmentFile = (\n attachmentContentOrPath: Buffer | string,\n options: Pick<AttachmentOptions, \"contentType\" | \"fileExtension\">,\n ) => {\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n return attachmentFileName;\n };\n\n #createAttachment = (name: string, contentType: string, source: string): Attachment => ({\n name,\n source,\n type: contentType,\n });\n\n #createGlobalAttachment = (name: string, contentType: string, source: string): Globals[\"attachments\"][number] => ({\n ...this.#createAttachment(name, contentType, source),\n timestamp: Date.now(),\n });\n\n #writeGlobals = (globals: Globals): void => {\n this.writer.writeGlobals(`${randomUuid()}-globals.json`, globals);\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,OAAO,QAAQ,MAAM;AAE9B,SAMEC,KAAK,QAGA,gBAAgB;AAgBvB,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,YAAY,QAAQ,eAAe;AAS5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAA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AC,CAAC;IACJ;EACF;AAwpBF","ignoreList":[]}
1
+ {"version":3,"file":"ReporterRuntime.js","names":["path","extname","Stage","createFixtureResult","createStepResult","createTestResult","LifecycleState","Notifier","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","attachmentReferenceBrand","Symbol","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","_classPrivateMethodInitSpec","_defineProperty","_classPrivateFieldInitSpec","currentStep","_classPrivateGetter","_get_currentStep","startStep","step","stepResult","_objectSpread","steps","push","_classPrivateFieldGet","updateStep","updateFunc","console","error","stopStep","opts","_ref","stop","_ref$duration","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","s","found","addAttachment","attachment","writer","isPath","fileExt","fileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","_this","length","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","set","removeStep","newValue","filter","value","_emittedAttachments","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_handleGlobalAttachmentContentMessage","_handleGlobalAttachmentPathMessage","_handleGlobalErrorMessage","_handleMetricResultMessage","_findParent","_writeAttachmentFile","_createAttachment","_createGlobalAttachment","_writeGlobals","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref2","_this2","_ref2$listeners","listeners","environmentInfo","categories","links","_ref2$globalLabels","globalLabels","state","setScope","scope","getScope","concat","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","FINISHED","scopeUuids","arguments","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","precondition","_testResult$precondit","preconditionHtml","_testResult$precondit2","expectedResult","_testResult$expectedR","expectedResultHtml","_testResult$expectedR2","testCaseId","historyId","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentContentOrPath","options","source","reference","attachmentName","attachmentFileName","Buffer","isBuffer","Error","wrapInStep","_options$timestamp","timestamp","name","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","status","statusDetails","from","content","encoding","attachmentContent","attachmentSource","errors","results","_this$writer$writeMet","_this$writer","writeMetricResults","root","getExecutionItem","_options$fileExtensio","globals","writeGlobals","_ref3","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","Array","isArray","Object","keys","entries","flatMap","_ref4","_ref5","_slicedToArray","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\n\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Globals,\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 RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeMetricResultMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.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\nconst attachmentReferenceBrand = Symbol(\"AttachmentReference\");\n\nexport type AttachmentReference = { readonly [attachmentReferenceBrand]: true };\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = (stop ?? result.start) ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n readonly #emittedAttachments = new WeakMap<AttachmentReference, string>();\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 if (scope?.precondition) {\n testResult.precondition = testResult.precondition ?? scope.precondition;\n }\n\n if (scope?.preconditionHtml) {\n testResult.preconditionHtml = testResult.preconditionHtml ?? scope.preconditionHtml;\n }\n\n if (scope?.expectedResult) {\n testResult.expectedResult = testResult.expectedResult ?? scope.expectedResult;\n }\n\n if (scope?.expectedResultHtml) {\n testResult.expectedResultHtml = testResult.expectedResultHtml ?? scope.expectedResultHtml;\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 /**\n * Writes attachment bytes or copies a source file without linking it to a result.\n * Pass the returned reference to this runtime's writeAttachment to link it later.\n */\n emitAttachment = (\n attachmentContentOrPath: Buffer | string,\n options: Pick<AttachmentOptions, \"contentType\" | \"fileExtension\">,\n ): AttachmentReference => {\n const source = this.#writeAttachmentFile(attachmentContentOrPath, options);\n const reference: AttachmentReference = { [attachmentReferenceBrand]: true };\n this.#emittedAttachments.set(reference, source);\n return reference;\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string | AttachmentReference,\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 attachmentFileName =\n typeof attachmentContentOrPath === \"string\" || Buffer.isBuffer(attachmentContentOrPath)\n ? this.#writeAttachmentFile(attachmentContentOrPath, options)\n : this.#emittedAttachments.get(attachmentContentOrPath);\n if (!attachmentFileName) {\n throw new Error(\"Invalid attachment reference for this reporter runtime\");\n }\n const attachment = this.#createAttachment(attachmentName, options.contentType, attachmentFileName);\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 case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n return;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n return;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n return;\n case \"metric_result\":\n this.#handleMetricResultMessage(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 applyGlobalRuntimeMessages = (messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n break;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n break;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n break;\n case \"metric_result\":\n this.#handleMetricResultMessage(message.data);\n break;\n default:\n break;\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 {\n links,\n labels,\n parameters,\n displayName,\n testCaseId,\n historyId,\n description,\n descriptionHtml,\n precondition,\n preconditionHtml,\n expectedResult,\n expectedResultHtml,\n } = 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 (\n links ||\n labels ||\n parameters ||\n description ||\n descriptionHtml ||\n precondition ||\n preconditionHtml ||\n expectedResult ||\n expectedResultHtml\n ) {\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 if (precondition) {\n scope.precondition = precondition;\n }\n if (preconditionHtml) {\n scope.preconditionHtml = preconditionHtml;\n }\n if (expectedResult) {\n scope.expectedResult = expectedResult;\n }\n if (expectedResultHtml) {\n scope.expectedResultHtml = expectedResultHtml;\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 if (precondition) {\n result.precondition = precondition;\n }\n if (preconditionHtml) {\n result.preconditionHtml = preconditionHtml;\n }\n if (expectedResult) {\n result.expectedResult = expectedResult;\n }\n if (expectedResultHtml) {\n result.expectedResultHtml = expectedResultHtml;\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 #handleGlobalAttachmentContentMessage = (message: RuntimeGlobalAttachmentContentMessage[\"data\"]) => {\n const attachmentContent = Buffer.from(message.content, message.encoding);\n const attachmentSource = this.#writeAttachmentFile(attachmentContent, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalAttachmentPathMessage = (message: RuntimeGlobalAttachmentPathMessage[\"data\"]) => {\n const attachmentSource = this.#writeAttachmentFile(message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalErrorMessage = (message: RuntimeGlobalErrorMessage[\"data\"]) => {\n this.#writeGlobals({\n attachments: [],\n errors: [{ ...message, timestamp: Date.now() }],\n });\n };\n\n #handleMetricResultMessage = (results: RuntimeMetricResultMessage[\"data\"]) => {\n this.writer.writeMetricResults?.(`${randomUuid()}-metric.json`, results);\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 #writeAttachmentFile = (\n attachmentContentOrPath: Buffer | string,\n options: Pick<AttachmentOptions, \"contentType\" | \"fileExtension\">,\n ) => {\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension: options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined),\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n return attachmentFileName;\n };\n\n #createAttachment = (name: string, contentType: string, source: string): Attachment => ({\n name,\n source,\n type: contentType,\n });\n\n #createGlobalAttachment = (name: string, contentType: string, source: string): Globals[\"attachments\"][number] => ({\n ...this.#createAttachment(name, contentType, source),\n timestamp: Date.now(),\n });\n\n #writeGlobals = (globals: Globals): void => {\n this.writer.writeGlobals(`${randomUuid()}-globals.json`, globals);\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,OAAO,QAAQ,MAAM;AAE9B,SAMEC,KAAK,QAGA,gBAAgB;AAgBvB,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAA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CAACnI,YAAY,CAAC,EAAE;MAC/B,IAAI,CAACA,YAAY,GAAGA,YAAY;IAClC,CAAC,MAAM,IAAIoI,MAAM,CAACC,IAAI,CAACrI,YAAY,CAAC,CAAC7C,MAAM,EAAE;MAC3C,IAAI,CAAC6C,YAAY,GAAGoI,MAAM,CAACE,OAAO,CAACtI,YAAY,CAAC,CAACuI,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA;UAAjBxD,IAAI,GAAAyD,KAAA;UAAEtK,KAAK,GAAAsK,KAAA;QACpE,IAAIP,KAAK,CAACC,OAAO,CAAChK,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAACiH,GAAG,CAAEuD,CAAC,KAAM;YAAE3D,IAAI;YAAE7G,KAAK,EAAEwK;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACL3D,IAAI;UACJ7G;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AAuuBF","ignoreList":[]}
@@ -1 +1 @@
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
+ {"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 {\n type AttachmentReference,\n type StepStack,\n DefaultStepStack,\n ReporterRuntime,\n ShallowStepsStack,\n} 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,SAGEC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,QACZ,sBAAsB;AAC7B,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,6 +1,7 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { allureIdRegexp } from "../utils.js";
3
- export var parseTestPlan = () => {
3
+ export var parseTestPlan = function parseTestPlan() {
4
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4
5
  var testPlanPath = process.env.ALLURE_TESTPLAN_PATH;
5
6
  if (!testPlanPath) {
6
7
  return undefined;
@@ -18,9 +19,14 @@ export var parseTestPlan = () => {
18
19
  console.error("Test plan version is unsupported. Skipping test plan usage:", testPlan.version);
19
20
  return undefined;
20
21
  }
22
+ var hasExcludedTests = options.enableExcludedTests && Array.isArray(testPlan.excludedTests) && testPlan.excludedTests.length > 0;
23
+ if (hasExcludedTests) {
24
+ var _testPlan$tests;
25
+ (_testPlan$tests = testPlan.tests) !== null && _testPlan$tests !== void 0 ? _testPlan$tests : testPlan.tests = [];
26
+ }
21
27
 
22
28
  // Execute all tests if test plan is empty
23
- if (!Array.isArray(testPlan.tests) || testPlan.tests.length === 0) {
29
+ if (!Array.isArray(testPlan.tests) || testPlan.tests.length === 0 && !hasExcludedTests) {
24
30
  return undefined;
25
31
  }
26
32
  return testPlan;
@@ -30,25 +36,29 @@ export var parseTestPlan = () => {
30
36
  return undefined;
31
37
  }
32
38
  };
33
- export var includedInTestPlan = (testPlan, subject) => {
34
- var _ref;
35
- var {
36
- allureId,
37
- id,
38
- fullName,
39
- nativeSelector,
40
- tags = []
41
- } = subject;
39
+ export var includedInTestPlan = function includedInTestPlan(testPlan, subject) {
40
+ var _ref, _testPlan$excludedTes, _testPlan$excludedTes2;
41
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
42
+ var allureId = subject.allureId,
43
+ id = subject.id,
44
+ fullName = subject.fullName,
45
+ nativeSelector = subject.nativeSelector,
46
+ _subject$tags = subject.tags,
47
+ tags = _subject$tags === void 0 ? [] : _subject$tags;
42
48
  var effectiveId = (_ref = allureId !== null && allureId !== void 0 ? allureId : id) !== null && _ref !== void 0 ? _ref : tags.map(tag => {
43
49
  var _tag$match;
44
50
  return tag === null || tag === void 0 || (_tag$match = tag.match(allureIdRegexp)) === null || _tag$match === void 0 || (_tag$match = _tag$match.groups) === null || _tag$match === void 0 ? void 0 : _tag$match.id;
45
51
  }).find(maybeId => maybeId !== undefined);
46
- return testPlan.tests.some(test => {
52
+ var matchesTest = test => {
47
53
  var idMatched = effectiveId !== undefined && test.id !== undefined && String(test.id) === effectiveId;
48
54
  var selectorMatched = fullName !== undefined && test.selector === fullName;
49
55
  var nativeSelectorMatched = nativeSelector !== undefined && test.selector === nativeSelector;
50
56
  return idMatched || selectorMatched || nativeSelectorMatched;
51
- });
57
+ };
58
+ if (testPlan.tests.length === 0 && ((_testPlan$excludedTes = testPlan.excludedTests) === null || _testPlan$excludedTes === void 0 ? void 0 : _testPlan$excludedTes.length) === 0) return true;
59
+ var selected = testPlan.tests.length === 0 || testPlan.tests.some(matchesTest);
60
+ if (!options.enableExcludedTests) return selected;
61
+ return selected && !((_testPlan$excludedTes2 = testPlan.excludedTests) !== null && _testPlan$excludedTes2 !== void 0 && _testPlan$excludedTes2.some(matchesTest));
52
62
  };
53
63
  export var addSkipLabel = labels => {
54
64
  labels.push({
@@ -60,9 +70,7 @@ export var addSkipLabelAsMeta = name => {
60
70
  return "".concat(name, " @allure.label.ALLURE_TESTPLAN_SKIP:true");
61
71
  };
62
72
  export var hasSkipLabel = labels => labels.some(_ref2 => {
63
- var {
64
- name
65
- } = _ref2;
73
+ var name = _ref2.name;
66
74
  return name === "ALLURE_TESTPLAN_SKIP";
67
75
  });
68
76
  //# sourceMappingURL=testplan.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testplan.js","names":["existsSync","readFileSync","allureIdRegexp","parseTestPlan","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","undefined","console","error","file","testPlan","JSON","parse","version","Array","isArray","tests","length","e","concat","includedInTestPlan","subject","_ref","allureId","id","fullName","nativeSelector","tags","effectiveId","map","tag","_tag$match","match","groups","find","maybeId","some","test","idMatched","String","selectorMatched","selector","nativeSelectorMatched","addSkipLabel","labels","push","name","value","addSkipLabelAsMeta","hasSkipLabel","_ref2"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\n\nimport type { Label } from \"../../model.js\";\nimport type { TestPlanV1 } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n if (!existsSync(testPlanPath)) {\n // eslint-disable-next-line no-console\n console.error(\"Test plan file is missing. Skipping test plan usage:\", testPlanPath);\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as Partial<TestPlanV1> & { version?: string };\n\n if (testPlan.version !== \"1.0\") {\n // eslint-disable-next-line no-console\n console.error(\"Test plan version is unsupported. Skipping test plan usage:\", testPlan.version);\n return undefined;\n }\n\n // Execute all tests if test plan is empty\n if (!Array.isArray(testPlan.tests) || testPlan.tests.length === 0) {\n return undefined;\n }\n\n return testPlan as TestPlanV1;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not parse test plan ${testPlanPath}`, e);\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { allureId?: string; id?: string; fullName?: string; nativeSelector?: string; tags?: string[] },\n): boolean => {\n const { allureId, id, fullName, nativeSelector, tags = [] } = subject;\n const effectiveId =\n allureId ??\n id ??\n tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n return testPlan.tests.some((test) => {\n const idMatched = effectiveId !== undefined && test.id !== undefined && String(test.id) === effectiveId;\n const selectorMatched = fullName !== undefined && test.selector === fullName;\n const nativeSelectorMatched = nativeSelector !== undefined && test.selector === nativeSelector;\n\n return idMatched || selectorMatched || nativeSelectorMatched;\n });\n};\n\nexport const addSkipLabel = (labels: Label[]) => {\n labels.push({ name: \"ALLURE_TESTPLAN_SKIP\", value: \"true\" });\n};\n\nexport const addSkipLabelAsMeta = (name: string) => {\n return `${name} @allure.label.ALLURE_TESTPLAN_SKIP:true`;\n};\n\nexport const hasSkipLabel = (labels: readonly Label[]) => labels.some(({ name }) => name === \"ALLURE_TESTPLAN_SKIP\");\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YA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OAAKJ,IAAI,KAAK,sBAAsB;AAAA,EAAC","ignoreList":[]}
1
+ {"version":3,"file":"testplan.js","names":["existsSync","readFileSync","allureIdRegexp","parseTestPlan","options","arguments","length","undefined","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","console","error","file","testPlan","JSON","parse","version","hasExcludedTests","enableExcludedTests","Array","isArray","excludedTests","_testPlan$tests","tests","e","concat","includedInTestPlan","subject","_ref","_testPlan$excludedTes","_testPlan$excludedTes2","allureId","id","fullName","nativeSelector","_subject$tags","tags","effectiveId","map","tag","_tag$match","match","groups","find","maybeId","matchesTest","test","idMatched","String","selectorMatched","selector","nativeSelectorMatched","selected","some","addSkipLabel","labels","push","name","value","addSkipLabelAsMeta","hasSkipLabel","_ref2"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\n\nimport type { Label } from \"../../model.js\";\nimport type { TestPlanV1, TestPlanV1Test } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (options: { enableExcludedTests?: boolean } = {}): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n if (!existsSync(testPlanPath)) {\n // eslint-disable-next-line no-console\n console.error(\"Test plan file is missing. Skipping test plan usage:\", testPlanPath);\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as Partial<TestPlanV1> & { version?: string };\n\n if (testPlan.version !== \"1.0\") {\n // eslint-disable-next-line no-console\n console.error(\"Test plan version is unsupported. Skipping test plan usage:\", testPlan.version);\n return undefined;\n }\n\n const hasExcludedTests =\n options.enableExcludedTests && Array.isArray(testPlan.excludedTests) && testPlan.excludedTests.length > 0;\n\n if (hasExcludedTests) {\n testPlan.tests ??= [];\n }\n\n // Execute all tests if test plan is empty\n if (!Array.isArray(testPlan.tests) || (testPlan.tests.length === 0 && !hasExcludedTests)) {\n return undefined;\n }\n\n return testPlan as TestPlanV1;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not parse test plan ${testPlanPath}`, e);\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { allureId?: string; id?: string; fullName?: string; nativeSelector?: string; tags?: string[] },\n options: { enableExcludedTests?: boolean } = {},\n): boolean => {\n const { allureId, id, fullName, nativeSelector, tags = [] } = subject;\n const effectiveId =\n allureId ??\n id ??\n tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n const matchesTest = (test: TestPlanV1Test) => {\n const idMatched = effectiveId !== undefined && test.id !== undefined && String(test.id) === effectiveId;\n const selectorMatched = fullName !== undefined && test.selector === fullName;\n const nativeSelectorMatched = nativeSelector !== undefined && test.selector === nativeSelector;\n\n return idMatched || selectorMatched || nativeSelectorMatched;\n };\n\n if (testPlan.tests.length === 0 && testPlan.excludedTests?.length === 0) return true;\n\n const selected = testPlan.tests.length === 0 || testPlan.tests.some(matchesTest);\n if (!options.enableExcludedTests) return selected;\n\n return selected && !testPlan.excludedTests?.some(matchesTest);\n};\n\nexport const addSkipLabel = (labels: Label[]) => {\n labels.push({ name: \"ALLURE_TESTPLAN_SKIP\", value: \"true\" });\n};\n\nexport const addSkipLabelAsMeta = (name: string) => {\n return `${name} @allure.label.ALLURE_TESTPLAN_SKIP:true`;\n};\n\nexport const hasSkipLabel = (labels: readonly Label[]) => labels.some(({ name }) => name === \"ALLURE_TESTPLAN_SKIP\");\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,SAAS;AAIlD,SAASC,cAAc,QAAQ,aAAa;AAE5C,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAA,EAAgF;EAAA,IAA5EC,OAA0C,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC3E,IAAMG,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/types.ts"],"sourcesContent":["import type {\n AllurePerformanceResult,\n FixtureResult,\n Globals,\n Label,\n LabelName,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport type GlobalLabelsConfig = Partial<Record<LabelName, string | string[]>> & Record<string, string | string[]>;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly globalLabels?: Label[] | GlobalLabelsConfig;\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n\n writeGlobals(distFileName: string, info: Globals): void;\n\n writePerformanceResults?(distFileName: string, results: AllurePerformanceResult[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":"AAeA,OAAO,IAAMA,4BAA4B,GAAG,sCAAsC;AAClF,OAAO,IAAMC,mCAAmC,GAAG,qCAAqC","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n AllureMetricResult,\n FixtureResult,\n Globals,\n Label,\n LabelName,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport type GlobalLabelsConfig = Partial<Record<LabelName, string | string[]>> & Record<string, string | string[]>;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly globalLabels?: Label[] | GlobalLabelsConfig;\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n\n writeGlobals(distFileName: string, info: Globals): void;\n\n writeMetricResults?(distFileName: string, results: AllureMetricResult[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n precondition?: string;\n preconditionHtml?: string;\n expectedResult?: string;\n expectedResultHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":"AAeA,OAAO,IAAMA,4BAA4B,GAAG,sCAAsC;AAClF,OAAO,IAAMC,mCAAmC,GAAG,qCAAqC","ignoreList":[]}
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  import { platform } from "node:process";
2
8
 
3
9
  /**
@@ -7,7 +13,10 @@ import { platform } from "node:process";
7
13
  var EOL = platform === "win32" ? "\r\n" : "\n";
8
14
  export var stringifyEnvInfo = envInfo => {
9
15
  var lines = [];
10
- for (var [key, value] of Object.entries(envInfo)) {
16
+ for (var _ref3 of Object.entries(envInfo)) {
17
+ var _ref2 = _slicedToArray(_ref3, 2);
18
+ var key = _ref2[0];
19
+ var value = _ref2[1];
11
20
  if (value !== null && value !== undefined) {
12
21
  var escapedKey = escapeKey(key);
13
22
  var escapedValue = escapeValue(value !== null && value !== void 0 ? value : "");
@@ -1 +1 @@
1
- {"version":3,"file":"envInfo.js","names":["platform","EOL","stringifyEnvInfo","envInfo","lines","key","value","Object","entries","undefined","escapedKey","escapeKey","escapedValue","escapeValue","push","concat","join","parseEnvInfo","input","escape","skipSpace","isCommentLine","newLine","multiLine","isKey","unicode","unicodeRemaining","escapingUnicode","keySpace","sep","line","decodeString","output","char","hex","String","fromCharCode","isWhitespace","isComment","isSeparator","Error","mapcatChars","code","escapeCharacter","escapeWhitespace","fn","result","i","length","charCodeAt","isAsciiPrintable","escapeUnicode","toString","prefix","repeat"],"sources":["../../../../../src/sdk/reporter/utils/envInfo.ts"],"sourcesContent":["import { platform } from \"node:process\";\n\n/**\n * The implementation is based on https://github.com/gagle/node-properties.\n */\nimport type { EnvironmentInfo } from \"../../types.js\";\n\nconst EOL = platform === \"win32\" ? \"\\r\\n\" : \"\\n\";\n\nexport const stringifyEnvInfo = (envInfo: EnvironmentInfo) => {\n const lines: string[] = [];\n\n for (const [key, value] of Object.entries(envInfo)) {\n if (value !== null && value !== undefined) {\n const escapedKey = escapeKey(key);\n const escapedValue = escapeValue(value ?? \"\");\n lines.push(`${escapedKey}=${escapedValue}`);\n }\n }\n\n return lines.join(EOL);\n};\n\nexport const parseEnvInfo = (input: string): EnvironmentInfo => {\n if (!input) {\n return {};\n }\n\n const envInfo: EnvironmentInfo = {};\n let escape = false;\n let skipSpace = true;\n let isCommentLine = false;\n let newLine = true;\n let multiLine = false;\n let isKey = true;\n let key = \"\";\n let value = \"\";\n let unicode: number;\n let unicodeRemaining = 0;\n let escapingUnicode = false;\n let keySpace = false;\n let sep = false;\n\n const line = () => {\n if (key || value || sep) {\n envInfo[key] = value;\n key = \"\";\n value = \"\";\n sep = false;\n }\n };\n\n const decodeString = (output: string, char: string) => {\n if (escapingUnicode && unicodeRemaining) {\n // eslint-disable-next-line no-bitwise\n unicode = (unicode << 4) + hex(char);\n if (--unicodeRemaining) {\n return output;\n }\n escape = false;\n escapingUnicode = false;\n return output + String.fromCharCode(unicode);\n }\n\n if (char === \"u\") {\n unicode = 0;\n escapingUnicode = true;\n unicodeRemaining = 4;\n return output;\n }\n\n escape = false;\n\n switch (char) {\n case \"t\":\n return `${output}\\t`;\n case \"r\":\n return `${output}\\r`;\n case \"n\":\n return `${output}\\n`;\n case \"f\":\n return `${output}\\f`;\n }\n\n return output + char;\n };\n\n for (const char of input) {\n if (char === \"\\r\") {\n continue;\n }\n\n if (isCommentLine) {\n if (char === \"\\n\") {\n isCommentLine = false;\n newLine = true;\n skipSpace = true;\n }\n continue;\n }\n\n if (skipSpace) {\n if (isWhitespace(char)) {\n continue;\n }\n\n if (!multiLine && char === \"\\n\") {\n isKey = true;\n keySpace = false;\n newLine = true;\n line();\n continue;\n }\n skipSpace = false;\n multiLine = false;\n }\n\n if (newLine) {\n newLine = false;\n if (isComment(char)) {\n isCommentLine = true;\n continue;\n }\n }\n\n if (char !== \"\\n\") {\n if (!escape && isKey && isSeparator(char)) {\n sep = true;\n isKey = false;\n keySpace = false;\n skipSpace = true;\n continue;\n }\n\n if (char === \"\\\\\") {\n if (escape) {\n if (escapingUnicode) {\n continue;\n }\n\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n key += \"\\\\\";\n } else {\n value += \"\\\\\";\n }\n }\n escape = !escape;\n } else {\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n if (escape) {\n key = decodeString(key, char);\n } else {\n if (isWhitespace(char)) {\n keySpace = true;\n skipSpace = true;\n continue;\n }\n key += char;\n }\n } else {\n if (escape) {\n value = decodeString(value, char);\n } else {\n value += char;\n }\n }\n }\n } else {\n if (escape) {\n if (!escapingUnicode) {\n escape = false;\n }\n skipSpace = true;\n multiLine = true;\n } else {\n newLine = true;\n skipSpace = true;\n isKey = true;\n\n line();\n }\n }\n }\n\n line();\n\n return envInfo;\n};\n\nconst hex = (char: string) => {\n switch (char) {\n case \"0\":\n return 0;\n case \"1\":\n return 1;\n case \"2\":\n return 2;\n case \"3\":\n return 3;\n case \"4\":\n return 4;\n case \"5\":\n return 5;\n case \"6\":\n return 6;\n case \"7\":\n return 7;\n case \"8\":\n return 8;\n case \"9\":\n return 9;\n case \"a\":\n case \"A\":\n return 10;\n case \"b\":\n case \"B\":\n return 11;\n case \"c\":\n case \"C\":\n return 12;\n case \"d\":\n case \"D\":\n return 13;\n case \"e\":\n case \"E\":\n return 14;\n case \"f\":\n case \"F\":\n return 15;\n }\n throw new Error(`Non-hex char ${char}`);\n};\n\nconst escapeKey = (key: string) => {\n return mapcatChars(key, (char, code) => {\n if (isSeparator(char)) {\n return `\\\\${char}`;\n }\n return escapeCharacter(char, code, true);\n });\n};\n\nconst escapeValue = (value: string) => {\n let escapeWhitespace = true;\n return mapcatChars(value, (char, code) => {\n if (!isWhitespace(char)) {\n escapeWhitespace = false;\n }\n return escapeCharacter(char, code, escapeWhitespace);\n });\n};\n\nconst mapcatChars = (value: string, fn: (char: string, code: number) => string) => {\n let result = \"\";\n for (let i = 0; i < value.length; i++) {\n const char = value[i];\n const code = value.charCodeAt(i);\n\n result += fn(char, code);\n }\n return result;\n};\n\nconst escapeCharacter = (char: string, code: number, escapeWhitespace: boolean) => {\n if (isAsciiPrintable(code)) {\n if (char === \" \" && escapeWhitespace) {\n return \"\\\\ \";\n } else if (char === \"\\\\\") {\n return \"\\\\\\\\\";\n } else {\n return char;\n }\n } else if (char === \"\\t\") {\n return \"\\\\t\";\n } else if (char === \"\\n\") {\n return \"\\\\n\";\n } else if (char === \"\\f\") {\n return \"\\\\f\";\n } else if (char === \"\\r\") {\n return \"\\\\r\";\n } else if (code < 160 || code >= 256) {\n // Control sets 0 and 1 or non-ASCII characters\n return escapeUnicode(code);\n } else {\n return char;\n }\n};\n\nconst isWhitespace = (char: string) => {\n switch (char) {\n case \"\\t\":\n case \"\\f\":\n case \" \":\n return true;\n }\n return false;\n};\n\nconst isAsciiPrintable = (code: number) => code > 31 && code < 127;\n\nconst escapeUnicode = (code: number) => {\n const unicode = code.toString(16);\n const prefix = \"0\".repeat(4 - unicode.length);\n return `\\\\u${prefix}${unicode}`;\n};\n\nconst isSeparator = (char: string) => {\n switch (char) {\n case \"=\":\n case \":\":\n return true;\n }\n return false;\n};\n\nconst isComment = (char: string) => {\n switch (char) {\n case \"#\":\n case \"!\":\n return true;\n }\n return false;\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA;;AAGA,IAAMC,GAAG,GAAGD,QAAQ,KAAK,OAAO,GAAG,MAAM,GAAG,IAAI;AAEhD,OAAO,IAAME,gBAAgB,GAAIC,OAAwB,IAAK;EAC5D,IAAMC,KAAe,GAAG,EAAE;EAE1B,KAAK,IAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,OAAO,CAAC,EAAE;IAClD,IAAIG,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKG,SAAS,EAAE;MACzC,IAAMC,UAAU,GAAGC,SAAS,CAACN,GAAG,CAAC;MACjC,IAAMO,YAAY,GAAGC,WAAW,CAACP,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;MAC7CF,KAAK,CAACU,IAAI,IAAAC,MAAA,CAAIL,UAAU,OAAAK,MAAA,CAAIH,YAAY,CAAE,CAAC;IAC7C;EACF;EAEA,OAAOR,KAAK,CAACY,IAAI,CAACf,GAAG,CAAC;AACxB,CAAC;AAED,OAAO,IAAMgB,YAAY,GAAIC,KAAa,IAAsB;EAC9D,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,CAAC,CAAC;EACX;EAEA,IAAMf,OAAwB,GAAG,CAAC,CAAC;EACnC,IAAIgB,MAAM,GAAG,KAAK;EAClB,IAAIC,SAAS,GAAG,IAAI;EACpB,IAA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GAAG,EAAE,IAAIA,IAAI,GAAG,GAAG;AAElE,IAAMS,aAAa,GAAIT,IAAY,IAAK;EACtC,IAAMjB,OAAO,GAAGiB,IAAI,CAACU,QAAQ,CAAC,EAAE,CAAC;EACjC,IAAMC,MAAM,GAAG,GAAG,CAACC,MAAM,CAAC,CAAC,GAAG7B,OAAO,CAACuB,MAAM,CAAC;EAC7C,aAAAjC,MAAA,CAAasC,MAAM,EAAAtC,MAAA,CAAGU,OAAO;AAC/B,CAAC;AAED,IAAMc,WAAW,GAAIN,IAAY,IAAK;EACpC,QAAQA,IAAI;IACV,KAAK,GAAG;IACR,KAAK,GAAG;MACN,OAAO,IAAI;EACf;EACA,OAAO,KAAK;AACd,CAAC;AAED,IAAMK,SAAS,GAAIL,IAAY,IAAK;EAClC,QAAQA,IAAI;IACV,KAAK,GAAG;IACR,KAAK,GAAG;MACN,OAAO,IAAI;EACf;EACA,OAAO,KAAK;AACd,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"envInfo.js","names":["platform","EOL","stringifyEnvInfo","envInfo","lines","_ref3","Object","entries","_ref2","_slicedToArray","key","value","undefined","escapedKey","escapeKey","escapedValue","escapeValue","push","concat","join","parseEnvInfo","input","escape","skipSpace","isCommentLine","newLine","multiLine","isKey","unicode","unicodeRemaining","escapingUnicode","keySpace","sep","line","decodeString","output","char","hex","String","fromCharCode","isWhitespace","isComment","isSeparator","Error","mapcatChars","code","escapeCharacter","escapeWhitespace","fn","result","i","length","charCodeAt","isAsciiPrintable","escapeUnicode","toString","prefix","repeat"],"sources":["../../../../../src/sdk/reporter/utils/envInfo.ts"],"sourcesContent":["import { platform } from \"node:process\";\n\n/**\n * The implementation is based on https://github.com/gagle/node-properties.\n */\nimport type { EnvironmentInfo } from \"../../types.js\";\n\nconst EOL = platform === \"win32\" ? \"\\r\\n\" : \"\\n\";\n\nexport const stringifyEnvInfo = (envInfo: EnvironmentInfo) => {\n const lines: string[] = [];\n\n for (const [key, value] of Object.entries(envInfo)) {\n if (value !== null && value !== undefined) {\n const escapedKey = escapeKey(key);\n const escapedValue = escapeValue(value ?? \"\");\n lines.push(`${escapedKey}=${escapedValue}`);\n }\n }\n\n return lines.join(EOL);\n};\n\nexport const parseEnvInfo = (input: string): EnvironmentInfo => {\n if (!input) {\n return {};\n }\n\n const envInfo: EnvironmentInfo = {};\n let escape = false;\n let skipSpace = true;\n let isCommentLine = false;\n let newLine = true;\n let multiLine = false;\n let isKey = true;\n let key = \"\";\n let value = \"\";\n let unicode: number;\n let unicodeRemaining = 0;\n let escapingUnicode = false;\n let keySpace = false;\n let sep = false;\n\n const line = () => {\n if (key || value || sep) {\n envInfo[key] = value;\n key = \"\";\n value = \"\";\n sep = false;\n }\n };\n\n const decodeString = (output: string, char: string) => {\n if (escapingUnicode && unicodeRemaining) {\n // eslint-disable-next-line no-bitwise\n unicode = (unicode << 4) + hex(char);\n if (--unicodeRemaining) {\n return output;\n }\n escape = false;\n escapingUnicode = false;\n return output + String.fromCharCode(unicode);\n }\n\n if (char === \"u\") {\n unicode = 0;\n escapingUnicode = true;\n unicodeRemaining = 4;\n return output;\n }\n\n escape = false;\n\n switch (char) {\n case \"t\":\n return `${output}\\t`;\n case \"r\":\n return `${output}\\r`;\n case \"n\":\n return `${output}\\n`;\n case \"f\":\n return `${output}\\f`;\n }\n\n return output + char;\n };\n\n for (const char of input) {\n if (char === \"\\r\") {\n continue;\n }\n\n if (isCommentLine) {\n if (char === \"\\n\") {\n isCommentLine = false;\n newLine = true;\n skipSpace = true;\n }\n continue;\n }\n\n if (skipSpace) {\n if (isWhitespace(char)) {\n continue;\n }\n\n if (!multiLine && char === \"\\n\") {\n isKey = true;\n keySpace = false;\n newLine = true;\n line();\n continue;\n }\n skipSpace = false;\n multiLine = false;\n }\n\n if (newLine) {\n newLine = false;\n if (isComment(char)) {\n isCommentLine = true;\n continue;\n }\n }\n\n if (char !== \"\\n\") {\n if (!escape && isKey && isSeparator(char)) {\n sep = true;\n isKey = false;\n keySpace = false;\n skipSpace = true;\n continue;\n }\n\n if (char === \"\\\\\") {\n if (escape) {\n if (escapingUnicode) {\n continue;\n }\n\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n key += \"\\\\\";\n } else {\n value += \"\\\\\";\n }\n }\n escape = !escape;\n } else {\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n if (escape) {\n key = decodeString(key, char);\n } else {\n if (isWhitespace(char)) {\n keySpace = true;\n skipSpace = true;\n continue;\n }\n key += char;\n }\n } else {\n if (escape) {\n value = decodeString(value, char);\n } else {\n value += char;\n }\n }\n }\n } else {\n if (escape) {\n if (!escapingUnicode) {\n escape = false;\n }\n skipSpace = true;\n multiLine = true;\n } else {\n newLine = true;\n skipSpace = true;\n isKey = true;\n\n line();\n }\n }\n }\n\n line();\n\n return envInfo;\n};\n\nconst hex = (char: string) => {\n switch (char) {\n case \"0\":\n return 0;\n case \"1\":\n return 1;\n case \"2\":\n return 2;\n case \"3\":\n return 3;\n case \"4\":\n return 4;\n case \"5\":\n return 5;\n case \"6\":\n return 6;\n case \"7\":\n return 7;\n case \"8\":\n return 8;\n case \"9\":\n return 9;\n case \"a\":\n case \"A\":\n return 10;\n case \"b\":\n case \"B\":\n return 11;\n case \"c\":\n case \"C\":\n return 12;\n case \"d\":\n case \"D\":\n return 13;\n case \"e\":\n case \"E\":\n return 14;\n case \"f\":\n case \"F\":\n return 15;\n }\n throw new Error(`Non-hex char ${char}`);\n};\n\nconst escapeKey = (key: string) => {\n return mapcatChars(key, (char, code) => {\n if (isSeparator(char)) {\n return `\\\\${char}`;\n }\n return escapeCharacter(char, code, true);\n });\n};\n\nconst escapeValue = (value: string) => {\n let escapeWhitespace = true;\n return mapcatChars(value, (char, code) => {\n if (!isWhitespace(char)) {\n escapeWhitespace = false;\n }\n return escapeCharacter(char, code, escapeWhitespace);\n });\n};\n\nconst mapcatChars = (value: string, fn: (char: string, code: number) => string) => {\n let result = \"\";\n for (let i = 0; i < value.length; i++) {\n const char = value[i];\n const code = value.charCodeAt(i);\n\n result += fn(char, code);\n }\n return result;\n};\n\nconst escapeCharacter = (char: string, code: number, escapeWhitespace: boolean) => {\n if (isAsciiPrintable(code)) {\n if (char === \" \" && escapeWhitespace) {\n return \"\\\\ \";\n } else if (char === \"\\\\\") {\n return \"\\\\\\\\\";\n } else {\n return char;\n }\n } else if (char === \"\\t\") {\n return \"\\\\t\";\n } else if (char === \"\\n\") {\n return \"\\\\n\";\n } else if (char === \"\\f\") {\n return \"\\\\f\";\n } else if (char === \"\\r\") {\n return \"\\\\r\";\n } else if (code < 160 || code >= 256) {\n // Control sets 0 and 1 or non-ASCII characters\n return escapeUnicode(code);\n } else {\n return char;\n }\n};\n\nconst isWhitespace = (char: string) => {\n switch (char) {\n case \"\\t\":\n case \"\\f\":\n case \" \":\n return true;\n }\n return false;\n};\n\nconst isAsciiPrintable = (code: number) => code > 31 && code < 127;\n\nconst escapeUnicode = (code: number) => {\n const unicode = code.toString(16);\n const prefix = \"0\".repeat(4 - unicode.length);\n return `\\\\u${prefix}${unicode}`;\n};\n\nconst isSeparator = (char: string) => {\n switch (char) {\n case \"=\":\n case \":\":\n return true;\n }\n return false;\n};\n\nconst isComment = (char: string) => {\n switch (char) {\n case \"#\":\n case \"!\":\n return true;\n }\n return false;\n};\n"],"mappings":";;;;;;AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA;;AAGA,IAAMC,GAAG,GAAGD,QAAQ,KAAK,OAAO,GAAG,MAAM,GAAG,IAAI;AAEhD,OAAO,IAAME,gBAAgB,GAAIC,OAAwB,IAAK;EAC5D,IAAMC,KAAe,GAAG,EAAE;EAE1B,SAAAC,KAAA,IAA2BC,MAAM,CAACC,OAAO,CAACJ,OAAO,CAAC,EAAE;IAAA,IAAAK,KAAA,GAAAC,cAAA,CAAAJ,KAAA;IAAA,IAAxCK,GAAG,GAAAF,KAAA;IAAA,IAAEG,KAAK,GAAAH,KAAA;IACpB,IAAIG,KAAK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