allure-js-commons 3.0.9 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/sdk/index.js +6 -0
- package/dist/cjs/sdk/index.js.map +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +94 -16
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/index.js +14 -0
- package/dist/cjs/sdk/reporter/index.js.map +1 -1
- package/dist/cjs/sdk/reporter/types.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils.js.map +1 -1
- package/dist/cjs/sdk/utils.js +98 -33
- package/dist/cjs/sdk/utils.js.map +1 -1
- package/dist/esm/sdk/index.js +1 -1
- package/dist/esm/sdk/index.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +91 -15
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/index.js +1 -1
- package/dist/esm/sdk/reporter/index.js.map +1 -1
- package/dist/esm/sdk/reporter/types.js.map +1 -1
- package/dist/esm/sdk/reporter/utils.js.map +1 -1
- package/dist/esm/sdk/utils.js +94 -32
- package/dist/esm/sdk/utils.js.map +1 -1
- package/dist/types/sdk/index.d.ts +1 -1
- package/dist/types/sdk/reporter/ReporterRuntime.d.ts +41 -1
- package/dist/types/sdk/reporter/index.d.ts +1 -1
- package/dist/types/sdk/reporter/types.d.ts +3 -2
- package/dist/types/sdk/utils.d.ts +18 -3
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","DefaultStepStack","constructor","_defineProperty","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","length","set","push","removeStep","newValue","filter","value","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","globalLabels","uuid","state","setScope","updateFunc","scope","getScope","console","error","concat","_classPrivateFieldGet","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","_objectSpread","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","FINISHED","result","scopeUuids","arguments","undefined","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","testCaseId","historyId","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","attachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","_classPrivateFieldInitSpec","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\ninterface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\nclass DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({ writer, listeners = [], environmentInfo, categories, links, globalLabels }: 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 this.globalLabels = globalLabels ?? [];\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 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 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 this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,SAKEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,YAAY,QAAQ,eAAe;AAS5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAChH,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAclD,MAAMC,gBAAgB,CAAsB;EAAAC,YAAA;IAAAC,eAAA,sBACG,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,sBACX,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,gBAE5C,MAAY;MAClB,IAAI,CAACE,WAAW,CAACC,KAAK,CAAC,CAAC;MACx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,QAAQ,CAAC;MAAE+C;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAAC+G,UAAU,GAAG7G,MAAK;IACvB,IAAI,CAACC,YAAY,GAAGA,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAE;EACxC;AA6jBF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","_classPrivateMethodInitSpec","_defineProperty","_classPrivateFieldInitSpec","startStep","step","stepResult","_objectSpread","_classPrivateGetter","_get_currentStep","steps","push","_classPrivateFieldGet","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","_this","length","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","set","removeStep","newValue","filter","value","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","writer","listeners","environmentInfo","categories","links","globalLabels","uuid","state","setScope","scope","getScope","concat","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","FINISHED","scopeUuids","arguments","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","historyId","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","attachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","status","statusDetails","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","Array","isArray","Object","keys","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = stop ?? result.start ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,SAKEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ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D,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACgG,UAAU,GAAG9F,MAAK;IAEvB,IAAIuH,KAAK,CAACC,OAAO,CAACvH,YAAY,CAAC,EAAE;MAC/B,IAAI,CAACA,YAAY,GAAGA,YAAY;IAClC,CAAC,MAAM,IAAIwH,MAAM,CAACC,IAAI,CAACzH,YAAY,CAAC,CAACnC,MAAM,EAAE;MAC3C,IAAI,CAACmC,YAAY,GAAGwH,MAAM,CAACE,OAAO,CAAC1H,YAAY,CAAC,CAAC2H,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACnD,IAAI,EAAE5F,KAAK,CAAC,GAAA+I,KAAA;QACrE,IAAIN,KAAK,CAACC,OAAO,CAAC1I,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAACmG,GAAG,CAAE6C,CAAC,KAAM;YAAEpD,IAAI;YAAE5F,KAAK,EAAEgJ;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLpD,IAAI;UACJ5F;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ export * from "./utils.js";
|
|
|
3
3
|
export * from "./testplan.js";
|
|
4
4
|
export * from "./factory.js";
|
|
5
5
|
export { LifecycleState } from "./LifecycleState.js";
|
|
6
|
-
export { ReporterRuntime } from "./ReporterRuntime.js";
|
|
6
|
+
export { DefaultStepStack, ReporterRuntime, ShallowStepsStack } from "./ReporterRuntime.js";
|
|
7
7
|
export { InMemoryWriter } from "./writer/InMemoryWriter.js";
|
|
8
8
|
export { FileSystemWriter } from "./writer/FileSystemWriter.js";
|
|
9
9
|
export { MessageWriter } from "./writer/MessageWriter.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE","LifecycleState","ReporterRuntime","InMemoryWriter","FileSystemWriter","MessageWriter","MessageReader","getEnvironmentLabels","getHostLabel","getThreadLabel","getPackageLabel","getLanguageLabel","getFrameworkLabel","parseEnvInfo","stringifyEnvInfo"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { ReporterRuntime } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {\n getEnvironmentLabels,\n getHostLabel,\n getThreadLabel,\n getPackageLabel,\n getLanguageLabel,\n getFrameworkLabel,\n} from \"./utils/labels.js\";\nexport { parseEnvInfo, stringifyEnvInfo } from \"./utils/envInfo.js\";\n"],"mappings":"AACA,SAASA,4BAA4B,EAAEC,mCAAmC,QAAQ,YAAY;AAC9F,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,SAASC,cAAc,QAAQ,qBAAqB;AACpD,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE","LifecycleState","DefaultStepStack","ReporterRuntime","ShallowStepsStack","InMemoryWriter","FileSystemWriter","MessageWriter","MessageReader","getEnvironmentLabels","getHostLabel","getThreadLabel","getPackageLabel","getLanguageLabel","getFrameworkLabel","parseEnvInfo","stringifyEnvInfo"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { type StepStack, DefaultStepStack, ReporterRuntime, ShallowStepsStack } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {\n getEnvironmentLabels,\n getHostLabel,\n getThreadLabel,\n getPackageLabel,\n getLanguageLabel,\n getFrameworkLabel,\n} from \"./utils/labels.js\";\nexport { parseEnvInfo, stringifyEnvInfo } from \"./utils/envInfo.js\";\n"],"mappings":"AACA,SAASA,4BAA4B,EAAEC,mCAAmC,QAAQ,YAAY;AAC9F,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAAyBC,gBAAgB,EAAEC,eAAe,EAAEC,iBAAiB,QAAQ,sBAAsB;AAC3G,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SACEC,oBAAoB,EACpBC,YAAY,EACZC,cAAc,EACdC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,mBAAmB;AAC1B,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Label,\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 interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly globalLabels?: Label[];\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\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":"
|
|
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 FixtureResult,\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\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":"AAaA,OAAO,IAAMA,4BAA4B,GAAG,sCAAsC;AAClF,OAAO,IAAMC,mCAAmC,GAAG,qCAAqC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["createHash","randomUUID","fs","readFile","path","process","LabelName","LinkType","StatusByPriority","FileSystemWriter","MessageWriter","randomUuid","md5","str","update","digest","getTestResultHistoryId","result","_result$testCaseId","historyId","tcId","testCaseId","fullName","paramsString","parameters","filter","p","excluded","sort","a","b","_a$name","_a$value","name","localeCompare","value","map","_p$name","_p$value","concat","join","paramsHash","getTestResultTestCaseId","undefined","statusToPriority","status","indexOf","getWorstTestStepResult","steps","length","readImageAsBase64","_ref","_asyncToGenerator","filePath","file","encoding","e","console","error","_x","apply","arguments","getProjectRoot","cachedProjectRoot","resolveProjectRootByPath","cwd","nextDir","dir","accessSync","constants","F_OK","_unused","dirname","getRelativePath","filepath","isAbsolute","projectRoot","relative","getPosixPath","platform","replaceAll","deepClone","obj","JSON","parse","stringify","getSuiteLabels","suites","parentSuite","suite","subSuites","labels","push","PARENT_SUITE","SUITE","SUB_SUITE","suiteLabelNames","ensureSuiteLabels","test","defaultSuites","_test$labels","find","l","includes","_test$labels2","reRegExpChar","reHasRegExpChar","RegExp","source","escapeRegExp","replace","isUrl","potentialUrl","URL","applyLinkTemplate","template","formatLink","templates","link","url","originalUrl","type","_templates","formattedLink","_objectSpread","urlTemplate","nameTemplate","DEFAULT","formatLinks","links","createDefaultWriter","config","env","ALLURE_TEST_MODE","emitter","resultsDir"],"sources":["../../../../src/sdk/reporter/utils.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\nimport type { EventEmitter } from \"node:events\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport type { Label, Link, Status, StepResult, TestResult } from \"../../model.js\";\nimport { LabelName, LinkType, StatusByPriority } from \"../../model.js\";\nimport type { LinkConfig, LinkTemplate } from \"./types.js\";\nimport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nimport { MessageWriter } from \"./writer/MessageWriter.js\";\n\nexport const randomUuid = () => {\n return randomUUID();\n};\n\nexport const md5 = (str: string) => {\n return createHash(\"md5\").update(str).digest(\"hex\");\n};\n\nexport const getTestResultHistoryId = (result: TestResult) => {\n if (result.historyId) {\n return result.historyId;\n }\n\n const tcId = result.testCaseId ?? (result.fullName ? md5(result.fullName) : null);\n\n if (!tcId) {\n return \"\";\n }\n\n const paramsString = result.parameters\n .filter((p) => !p?.excluded)\n .sort((a, b) => a.name?.localeCompare(b?.name) || a.value?.localeCompare(b?.value))\n .map((p) => `${p.name ?? \"null\"}:${p.value ?? \"null\"}`)\n .join(\",\");\n const paramsHash = md5(paramsString);\n\n return `${tcId}:${paramsHash}`;\n};\n\nexport const getTestResultTestCaseId = (result: TestResult) => {\n return result.fullName ? md5(result.fullName) : undefined;\n};\n\nconst statusToPriority = (status: Status | undefined) => {\n if (!status) {\n return -1;\n }\n return StatusByPriority.indexOf(status);\n};\n\nexport const getWorstTestStepResult = (steps: StepResult[]): StepResult | undefined => {\n if (steps.length === 0) {\n return;\n }\n return [...steps].sort((a, b) => statusToPriority(a.status) - statusToPriority(b.status))[0];\n};\n\nexport const readImageAsBase64 = async (filePath: string): Promise<string | undefined> => {\n try {\n const file = await readFile(filePath, { encoding: \"base64\" });\n\n return file ? `data:image/png;base64,${file}` : undefined;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not read file ${filePath}`, e);\n return undefined;\n }\n};\n\nexport const getProjectRoot = (() => {\n let cachedProjectRoot: string | null = null;\n\n const resolveProjectRootByPath = () => {\n const cwd = process.cwd();\n let nextDir = cwd;\n let dir;\n\n do {\n dir = nextDir;\n try {\n fs.accessSync(path.join(dir, \"package.json\"), fs.constants.F_OK);\n\n // package.json exists; use the directory as the project root\n return dir;\n } catch {}\n\n nextDir = path.dirname(dir);\n } while (nextDir.length < dir.length);\n\n // package.json doesn't exist in any parent; fall back to CWD\n return cwd;\n };\n\n return () => {\n if (!cachedProjectRoot) {\n cachedProjectRoot = resolveProjectRootByPath();\n }\n return cachedProjectRoot;\n };\n})();\n\nexport const getRelativePath = (filepath: string) => {\n if (path.isAbsolute(filepath)) {\n const projectRoot = getProjectRoot();\n filepath = path.relative(projectRoot, filepath);\n }\n return filepath;\n};\n\nexport const getPosixPath = (filepath: string) => {\n if (process.platform === \"win32\") {\n return filepath.replaceAll(\"\\\\\", \"/\");\n }\n return filepath;\n};\n\nexport const deepClone = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));\n\nexport const getSuiteLabels = (suites: readonly string[]): Label[] => {\n if (suites.length === 0) {\n return [];\n }\n\n const [parentSuite, suite, ...subSuites] = suites;\n const labels: Label[] = [];\n\n if (parentSuite) {\n labels.push({\n name: LabelName.PARENT_SUITE,\n value: parentSuite,\n });\n }\n\n if (suite) {\n labels.push({\n name: LabelName.SUITE,\n value: suite,\n });\n }\n\n if (subSuites.length > 0) {\n labels.push({\n name: LabelName.SUB_SUITE,\n value: subSuites.join(\" > \"),\n });\n }\n\n return labels;\n};\n\nconst suiteLabelNames: readonly string[] = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE];\n\nexport const ensureSuiteLabels = (test: Partial<TestResult>, defaultSuites: readonly string[]) => {\n if (!test.labels?.find((l) => suiteLabelNames.includes(l.name))) {\n test.labels = [...(test.labels ?? []), ...getSuiteLabels(defaultSuites)];\n }\n};\n\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport const escapeRegExp = (value: string): string => {\n return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, \"\\\\$&\") : value;\n};\n\n// TODO: may also use URL.canParse instead (requires node.js v18.17, v19.9, or higher)\nconst isUrl = (potentialUrl: string) => {\n // Short-circuits the check for many short URL cases, bypassing the try-catch logic.\n if (potentialUrl.indexOf(\":\") === -1) {\n return false;\n }\n\n // There is ':' in the string: a potential scheme separator.\n // The string might be a proper URL already.\n try {\n new URL(potentialUrl);\n return true;\n } catch (e) {\n return false;\n }\n};\n\nexport const applyLinkTemplate = (template: LinkTemplate, value: string) =>\n typeof template === \"string\" ? template.replace(\"%s\", value) : template(value);\n\nexport const formatLink = (templates: LinkConfig, link: Link) => {\n const { url: originalUrl, name, type } = link;\n if (isUrl(originalUrl)) {\n return link;\n } else {\n const formattedLink = { ...link };\n const { urlTemplate, nameTemplate } = templates[type ?? LinkType.DEFAULT] ?? {};\n if (urlTemplate !== undefined) {\n formattedLink.url = applyLinkTemplate(urlTemplate, originalUrl);\n }\n if (name === undefined && nameTemplate !== undefined) {\n formattedLink.name = applyLinkTemplate(nameTemplate, originalUrl);\n }\n return formattedLink;\n }\n};\n\nexport const formatLinks = (templates: LinkConfig, links: readonly Link[]) =>\n links.map((link) => formatLink(templates, link));\n\nexport const createDefaultWriter = (config: { resultsDir?: string; emitter?: EventEmitter }) => {\n return process.env.ALLURE_TEST_MODE\n ? new MessageWriter(config.emitter)\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n });\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,aAAa;AAEpD,OAAOC,EAAE,MAAM,SAAS;AACxB,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,OAAOC,IAAI,MAAM,WAAW;AAC5B,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,gBAAgB,QAAQ,gBAAgB;AAEtE,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,aAAa,QAAQ,2BAA2B;AAEzD,OAAO,IAAMC,UAAU,GAAGA,CAAA,KAAM;EAC9B,OAAOV,UAAU,CAAC,CAAC;AACrB,CAAC;AAED,OAAO,IAAMW,GAAG,GAAIC,GAAW,IAAK;EAClC,OAAOb,UAAU,CAAC,KAAK,CAAC,CAACc,MAAM,CAACD,GAAG,CAAC,CAACE,MAAM,CAAC,KAAK,CAAC;AACpD,CAAC;AAED,OAAO,IAAMC,sBAAsB,GAAIC,MAAkB,IAAK;EAAA,IAAAC,kBAAA;EAC5D,IAAID,MAAM,CAACE,SAAS,EAAE;IACpB,OAAOF,MAAM,CAACE,SAAS;EACzB;EAEA,IAAMC,IAAI,IAAAF,kBAAA,GAAGD,MAAM,CAACI,UAAU,cAAAH,kBAAA,cAAAA,kBAAA,GAAKD,MAAM,CAACK,QAAQ,GAAGV,GAAG,CAACK,MAAM,CAACK,QAAQ,CAAC,GAAG,IAAK;EAEjF,IAAI,CAACF,IAAI,EAAE;IACT,OAAO,EAAE;EACX;EAEA,IAAMG,YAAY,GAAGN,MAAM,CAACO,UAAU,CACnCC,MAAM,CAAEC,CAAC,IAAK,EAACA,CAAC,aAADA,CAAC,eAADA,CAAC,CAAEC,QAAQ,EAAC,CAC3BC,IAAI,CAA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,aAAa;EACtB;AACF,CAAC;AAED,OAAO,IAAMK,WAAW,GAAGA,CAACX,SAAqB,EAAEY,KAAsB,KACvEA,KAAK,CAAC7F,GAAG,CAAEkF,IAAI,IAAKF,UAAU,CAACC,SAAS,EAAEC,IAAI,CAAC,CAAC;AAElD,OAAO,IAAMY,mBAAmB,GAAIC,MAAuD,IAAK;EAC9F,OAAO9H,OAAO,CAAC+H,GAAG,CAACC,gBAAgB,GAC/B,IAAI3H,aAAa,CAACyH,MAAM,CAACG,OAAO,CAAC,GACjC,IAAI7H,gBAAgB,CAAC;IACnB8H,UAAU,EAAEJ,MAAM,CAACI,UAAU,IAAI;EACnC,CAAC,CAAC;AACR,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"utils.js","names":["createHash","randomUUID","fs","readFile","path","process","LabelName","LinkType","StatusByPriority","FileSystemWriter","MessageWriter","randomUuid","md5","str","update","digest","getTestResultHistoryId","result","_result$testCaseId","historyId","tcId","testCaseId","fullName","paramsString","parameters","filter","p","excluded","sort","a","b","_a$name","_a$value","name","localeCompare","value","map","_p$name","_p$value","concat","join","paramsHash","getTestResultTestCaseId","undefined","statusToPriority","status","indexOf","getWorstTestStepResult","steps","length","readImageAsBase64","_ref","_asyncToGenerator","filePath","file","encoding","e","console","error","_x","apply","arguments","getProjectRoot","cachedProjectRoot","resolveProjectRootByPath","cwd","nextDir","dir","accessSync","constants","F_OK","_unused","dirname","getRelativePath","filepath","isAbsolute","projectRoot","relative","getPosixPath","platform","replaceAll","deepClone","obj","JSON","parse","stringify","getSuiteLabels","suites","parentSuite","suite","subSuites","labels","push","PARENT_SUITE","SUITE","SUB_SUITE","suiteLabelNames","ensureSuiteLabels","test","defaultSuites","_test$labels","find","l","includes","_test$labels2","reRegExpChar","reHasRegExpChar","RegExp","source","escapeRegExp","replace","isUrl","potentialUrl","URL","applyLinkTemplate","template","formatLink","templates","link","url","originalUrl","type","_templates","formattedLink","_objectSpread","urlTemplate","nameTemplate","DEFAULT","formatLinks","links","createDefaultWriter","config","env","ALLURE_TEST_MODE","emitter","resultsDir"],"sources":["../../../../src/sdk/reporter/utils.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\nimport type { EventEmitter } from \"node:events\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport type { Label, Link, Status, StepResult, TestResult } from \"../../model.js\";\nimport { LabelName, LinkType, StatusByPriority } from \"../../model.js\";\nimport type { LinkConfig, LinkTemplate } from \"./types.js\";\nimport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nimport { MessageWriter } from \"./writer/MessageWriter.js\";\n\nexport const randomUuid = () => {\n return randomUUID();\n};\n\nexport const md5 = (str: string) => {\n return createHash(\"md5\").update(str).digest(\"hex\");\n};\n\nexport const getTestResultHistoryId = (result: TestResult) => {\n if (result.historyId) {\n return result.historyId;\n }\n\n const tcId = result.testCaseId ?? (result.fullName ? md5(result.fullName) : null);\n\n if (!tcId) {\n return \"\";\n }\n\n const paramsString = result.parameters\n .filter((p) => !p?.excluded)\n .sort((a, b) => a.name?.localeCompare(b?.name) || a.value?.localeCompare(b?.value))\n .map((p) => `${p.name ?? \"null\"}:${p.value ?? \"null\"}`)\n .join(\",\");\n const paramsHash = md5(paramsString);\n\n return `${tcId}:${paramsHash}`;\n};\n\nexport const getTestResultTestCaseId = (result: TestResult) => {\n return result.fullName ? md5(result.fullName) : undefined;\n};\n\nconst statusToPriority = (status: Status | undefined) => {\n if (!status) {\n return -1;\n }\n return StatusByPriority.indexOf(status);\n};\n\nexport const getWorstTestStepResult = (steps: StepResult[]): StepResult | undefined => {\n if (steps.length === 0) {\n return;\n }\n\n return [...steps].sort((a, b) => statusToPriority(a.status) - statusToPriority(b.status))[0];\n};\n\nexport const readImageAsBase64 = async (filePath: string): Promise<string | undefined> => {\n try {\n const file = await readFile(filePath, { encoding: \"base64\" });\n\n return file ? `data:image/png;base64,${file}` : undefined;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not read file ${filePath}`, e);\n return undefined;\n }\n};\n\nexport const getProjectRoot = (() => {\n let cachedProjectRoot: string | null = null;\n\n const resolveProjectRootByPath = () => {\n const cwd = process.cwd();\n let nextDir = cwd;\n let dir;\n\n do {\n dir = nextDir;\n try {\n fs.accessSync(path.join(dir, \"package.json\"), fs.constants.F_OK);\n\n // package.json exists; use the directory as the project root\n return dir;\n } catch {}\n\n nextDir = path.dirname(dir);\n } while (nextDir.length < dir.length);\n\n // package.json doesn't exist in any parent; fall back to CWD\n return cwd;\n };\n\n return () => {\n if (!cachedProjectRoot) {\n cachedProjectRoot = resolveProjectRootByPath();\n }\n return cachedProjectRoot;\n };\n})();\n\nexport const getRelativePath = (filepath: string) => {\n if (path.isAbsolute(filepath)) {\n const projectRoot = getProjectRoot();\n filepath = path.relative(projectRoot, filepath);\n }\n return filepath;\n};\n\nexport const getPosixPath = (filepath: string) => {\n if (process.platform === \"win32\") {\n return filepath.replaceAll(\"\\\\\", \"/\");\n }\n return filepath;\n};\n\nexport const deepClone = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));\n\nexport const getSuiteLabels = (suites: readonly string[]): Label[] => {\n if (suites.length === 0) {\n return [];\n }\n\n const [parentSuite, suite, ...subSuites] = suites;\n const labels: Label[] = [];\n\n if (parentSuite) {\n labels.push({\n name: LabelName.PARENT_SUITE,\n value: parentSuite,\n });\n }\n\n if (suite) {\n labels.push({\n name: LabelName.SUITE,\n value: suite,\n });\n }\n\n if (subSuites.length > 0) {\n labels.push({\n name: LabelName.SUB_SUITE,\n value: subSuites.join(\" > \"),\n });\n }\n\n return labels;\n};\n\nconst suiteLabelNames: readonly string[] = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE];\n\nexport const ensureSuiteLabels = (test: Partial<TestResult>, defaultSuites: readonly string[]) => {\n if (!test.labels?.find((l) => suiteLabelNames.includes(l.name))) {\n test.labels = [...(test.labels ?? []), ...getSuiteLabels(defaultSuites)];\n }\n};\n\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport const escapeRegExp = (value: string): string => {\n return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, \"\\\\$&\") : value;\n};\n\n// TODO: may also use URL.canParse instead (requires node.js v18.17, v19.9, or higher)\nconst isUrl = (potentialUrl: string) => {\n // Short-circuits the check for many short URL cases, bypassing the try-catch logic.\n if (potentialUrl.indexOf(\":\") === -1) {\n return false;\n }\n\n // There is ':' in the string: a potential scheme separator.\n // The string might be a proper URL already.\n try {\n new URL(potentialUrl);\n return true;\n } catch (e) {\n return false;\n }\n};\n\nexport const applyLinkTemplate = (template: LinkTemplate, value: string) =>\n typeof template === \"string\" ? template.replace(\"%s\", value) : template(value);\n\nexport const formatLink = (templates: LinkConfig, link: Link) => {\n const { url: originalUrl, name, type } = link;\n if (isUrl(originalUrl)) {\n return link;\n } else {\n const formattedLink = { ...link };\n const { urlTemplate, nameTemplate } = templates[type ?? LinkType.DEFAULT] ?? {};\n if (urlTemplate !== undefined) {\n formattedLink.url = applyLinkTemplate(urlTemplate, originalUrl);\n }\n if (name === undefined && nameTemplate !== undefined) {\n formattedLink.name = applyLinkTemplate(nameTemplate, originalUrl);\n }\n return formattedLink;\n }\n};\n\nexport const formatLinks = (templates: LinkConfig, links: readonly Link[]) =>\n links.map((link) => formatLink(templates, link));\n\nexport const createDefaultWriter = (config: { resultsDir?: string; emitter?: EventEmitter }) => {\n return process.env.ALLURE_TEST_MODE\n ? new MessageWriter(config.emitter)\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n });\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,aAAa;AAEpD,OAAOC,EAAE,MAAM,SAAS;AACxB,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,OAAOC,IAAI,MAAM,WAAW;AAC5B,OAAOC,OAAO,MAAM,cAAc;AAElC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H,gBAAgB,CAAC;IACnB8H,UAAU,EAAEJ,MAAM,CAACI,UAAU,IAAI;EACnC,CAAC,CAAC;AACR,CAAC","ignoreList":[]}
|
package/dist/esm/sdk/utils.js
CHANGED
|
@@ -47,60 +47,122 @@ export var stripAnsi = str => {
|
|
|
47
47
|
var regex = ansiRegex();
|
|
48
48
|
return str.replace(regex, "");
|
|
49
49
|
};
|
|
50
|
+
var actualAndExpected = value => {
|
|
51
|
+
if (!value || typeof value !== "object") {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// support for jest asserts
|
|
56
|
+
if ("matcherResult" in value && value.matcherResult !== undefined && typeof value.matcherResult === "object") {
|
|
57
|
+
return {
|
|
58
|
+
actual: serialize(value.matcherResult.actual),
|
|
59
|
+
expected: serialize(value.matcherResult.expected)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var actual = "actual" in value && value.actual !== undefined ? {
|
|
63
|
+
actual: serialize(value.actual)
|
|
64
|
+
} : {};
|
|
65
|
+
var expected = "expected" in value && value.expected !== undefined ? {
|
|
66
|
+
expected: serialize(value.expected)
|
|
67
|
+
} : {};
|
|
68
|
+
return _objectSpread(_objectSpread({}, actual), expected);
|
|
69
|
+
};
|
|
50
70
|
export var getMessageAndTraceFromError = error => {
|
|
51
71
|
var {
|
|
52
72
|
message,
|
|
53
73
|
stack
|
|
54
74
|
} = error;
|
|
55
|
-
|
|
56
|
-
actual: serialize(error.actual)
|
|
57
|
-
} : {};
|
|
58
|
-
var expected = "expected" in error && error.expected !== undefined ? {
|
|
59
|
-
expected: serialize(error.expected)
|
|
60
|
-
} : {};
|
|
61
|
-
return _objectSpread(_objectSpread({
|
|
75
|
+
return _objectSpread({
|
|
62
76
|
message: message ? stripAnsi(message) : undefined,
|
|
63
77
|
trace: stack ? stripAnsi(stack) : undefined
|
|
64
|
-
},
|
|
78
|
+
}, actualAndExpected(error));
|
|
65
79
|
};
|
|
66
|
-
export var
|
|
80
|
+
export var allureMetadataRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.(\S+)$/, {
|
|
81
|
+
type: 1
|
|
82
|
+
});
|
|
83
|
+
export var allureTitleMetadataRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.([^:=\s]+)[:=]("[^"]+"|'[^']+'|`[^`]+`|\S+)/, {
|
|
84
|
+
type: 1
|
|
85
|
+
});
|
|
86
|
+
export var allureTitleMetadataRegexpGlobal = new RegExp(allureTitleMetadataRegexp, "g");
|
|
87
|
+
export var allureIdRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.id[:=](\S+)/, {
|
|
67
88
|
id: 1
|
|
68
89
|
});
|
|
69
|
-
export var allureIdRegexpGlobal = new RegExp(allureIdRegexp, "g");
|
|
70
90
|
export var allureLabelRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.label\.([^:=\s]+)[:=]([^\s]+)/, {
|
|
71
91
|
name: 1,
|
|
72
92
|
value: 2
|
|
73
93
|
});
|
|
74
|
-
export var
|
|
94
|
+
export var getTypeFromAllureTitleMetadataMatch = match => {
|
|
95
|
+
return match === null || match === void 0 ? void 0 : match[1];
|
|
96
|
+
};
|
|
97
|
+
export var getValueFromAllureTitleMetadataMatch = match => {
|
|
98
|
+
var _match$;
|
|
99
|
+
var quotesRegexp = /['"`]/;
|
|
100
|
+
var quoteOpenRegexp = new RegExp("^".concat(quotesRegexp.source));
|
|
101
|
+
var quoteCloseRegexp = new RegExp("".concat(quotesRegexp.source, "$"));
|
|
102
|
+
var matchedValue = (_match$ = match === null || match === void 0 ? void 0 : match[2]) !== null && _match$ !== void 0 ? _match$ : "";
|
|
103
|
+
if (quoteOpenRegexp.test(matchedValue) && quoteCloseRegexp.test(matchedValue)) {
|
|
104
|
+
return matchedValue.slice(1, -1);
|
|
105
|
+
}
|
|
106
|
+
return matchedValue;
|
|
107
|
+
};
|
|
75
108
|
export var isMetadataTag = tag => {
|
|
76
|
-
return
|
|
109
|
+
return allureMetadataRegexp.test(tag);
|
|
110
|
+
};
|
|
111
|
+
export var getMetadataLabel = (tag, value) => {
|
|
112
|
+
var _match$groups;
|
|
113
|
+
var match = tag.match(allureMetadataRegexp);
|
|
114
|
+
var type = match === null || match === void 0 || (_match$groups = match.groups) === null || _match$groups === void 0 ? void 0 : _match$groups.type;
|
|
115
|
+
if (!type) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
var [subtype, name] = type.split(".");
|
|
119
|
+
return {
|
|
120
|
+
name: subtype === "id" ? LabelName.ALLURE_ID : name,
|
|
121
|
+
value: value !== null && value !== void 0 ? value : ""
|
|
122
|
+
};
|
|
77
123
|
};
|
|
78
124
|
export var extractMetadataFromString = title => {
|
|
79
125
|
var labels = [];
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
name: LabelName.ALLURE_ID,
|
|
86
|
-
value: idValue
|
|
87
|
-
});
|
|
126
|
+
var links = [];
|
|
127
|
+
var metadata = title.matchAll(allureTitleMetadataRegexpGlobal);
|
|
128
|
+
var cleanTitle = title.replaceAll(allureTitleMetadataRegexpGlobal, "").split(" ").filter(Boolean).reduce((acc, word) => {
|
|
129
|
+
if (/^[\n\r]/.test(word)) {
|
|
130
|
+
return acc + word;
|
|
88
131
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
value
|
|
98
|
-
});
|
|
132
|
+
return "".concat(acc, " ").concat(word);
|
|
133
|
+
}, "").trim();
|
|
134
|
+
for (var m of metadata) {
|
|
135
|
+
var match = m;
|
|
136
|
+
var type = getTypeFromAllureTitleMetadataMatch(match);
|
|
137
|
+
var value = getValueFromAllureTitleMetadataMatch(match);
|
|
138
|
+
if (!type || !value) {
|
|
139
|
+
continue;
|
|
99
140
|
}
|
|
100
|
-
|
|
101
|
-
|
|
141
|
+
var [subtype, name] = type.split(".");
|
|
142
|
+
switch (subtype) {
|
|
143
|
+
case "id":
|
|
144
|
+
labels.push({
|
|
145
|
+
name: LabelName.ALLURE_ID,
|
|
146
|
+
value
|
|
147
|
+
});
|
|
148
|
+
break;
|
|
149
|
+
case "label":
|
|
150
|
+
labels.push({
|
|
151
|
+
name,
|
|
152
|
+
value
|
|
153
|
+
});
|
|
154
|
+
break;
|
|
155
|
+
case "link":
|
|
156
|
+
links.push({
|
|
157
|
+
type: name,
|
|
158
|
+
url: value
|
|
159
|
+
});
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
102
163
|
return {
|
|
103
164
|
labels,
|
|
165
|
+
links,
|
|
104
166
|
cleanTitle
|
|
105
167
|
};
|
|
106
168
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["LabelName","Status","getStatusFromError","error","test","constructor","name","message","stack","inspect","FAILED","BROKEN","ansiRegex","onlyFirst","arguments","length","undefined","pattern","join","RegExp","stripAnsi","str","regex","replace","getMessageAndTraceFromError","actual","serialize","expected","_objectSpread","trace","allureIdRegexp","_wrapRegExp","id","allureIdRegexpGlobal","allureLabelRegexp","value","allureLabelRegexpGlobal","isMetadataTag","tag","extractMetadataFromString","title","labels","split","forEach","val","_val$match","idValue","match","groups","push","ALLURE_ID","labelMatch","cleanTitle","trim","isAnyStepFailed","item","isFailed","status","steps","find","step","isAllStepsEnded","every","stop","hasLabel","testResult","labelName","l","hasStepMessage","messages","some","type","getStepsMessagesPair","reduce","acc","unfinishedStepIdx","findLastIndex","getUnfinishedStepsMessages","grouppedStepsMessage","filter","isPromise","obj","then","maxDepth","maxLength","replacer","limitString","JSON","stringify","createSerializeReplacer","String","userDefinedReplacer","parents","limitingReplacer","_","Object","is","at","pop","includes","Map","excludeCircularRefsFromMap","Set","excludeCircularRefsFromSet","composeReplacers","first","second","k","v","call","map","Array","from","_ref","_ref2","set","concat","substring"],"sources":["../../../src/sdk/utils.ts"],"sourcesContent":["import type { FixtureResult, Label, StatusDetails, StepResult, TestResult } from \"../model.js\";\nimport { LabelName, Status } from \"../model.js\";\nimport type { RuntimeMessage, SerializeOptions, SerializerReplacerFunc } from \"./types.js\";\n\nexport const getStatusFromError = (error: Partial<Error>): Status => {\n switch (true) {\n /**\n * Native `node:assert` and `chai` (`vitest` uses it under the hood) throw `AssertionError`\n * `jest` throws `JestAssertionError` instance\n * `jasmine` throws `ExpectationFailed` instance\n * `vitest` throws `Error` for extended assertions, so we look into stack\n */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case error.name && /assert/gi.test(error.name):\n case error.message && /assert/gi.test(error.message):\n case error.stack && /@vitest\\/expect/gi.test(error.stack):\n case error.stack && /playwright\\/lib\\/matchers\\/expect\\.js/gi.test(error.stack):\n case \"matcherResult\" in error:\n case \"inspect\" in error && typeof error.inspect === \"function\":\n return Status.FAILED;\n default:\n return Status.BROKEN;\n }\n};\n\n/**\n * Source: https://github.com/chalk/ansi-regex\n */\nconst ansiRegex = ({ onlyFirst = false } = {}) => {\n const pattern = [\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\n \"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\",\n ].join(\"|\");\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n\n/**\n * https://github.com/chalk/strip-ansi\n */\nexport const stripAnsi = (str: string): string => {\n const regex = ansiRegex();\n return str.replace(regex, \"\");\n};\n\nexport const getMessageAndTraceFromError = (error: Error | { message?: string; stack?: string }): StatusDetails => {\n const { message, stack } = error;\n const actual = \"actual\" in error && error.actual !== undefined ? { actual: serialize(error.actual) } : {};\n const expected = \"expected\" in error && error.expected !== undefined ? { expected: serialize(error.expected) } : {};\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\n ...actual,\n ...expected,\n };\n};\n\nexport const allureIdRegexp = /(?:^|\\s)@?allure\\.id[:=](?<id>[^\\s]+)/;\nexport const allureIdRegexpGlobal = new RegExp(allureIdRegexp, \"g\");\nexport const allureLabelRegexp = /(?:^|\\s)@?allure\\.label\\.(?<name>[^:=\\s]+)[:=](?<value>[^\\s]+)/;\nexport const allureLabelRegexpGlobal = new RegExp(allureLabelRegexp, \"g\");\n\nexport const isMetadataTag = (tag: string) => {\n return allureIdRegexp.test(tag) || allureLabelRegexp.test(tag);\n};\n\nexport const extractMetadataFromString = (\n title: string,\n): {\n labels: Label[];\n cleanTitle: string;\n} => {\n const labels = [] as Label[];\n\n title.split(\" \").forEach((val) => {\n const idValue = val.match(allureIdRegexp)?.groups?.id;\n\n if (idValue) {\n labels.push({ name: LabelName.ALLURE_ID, value: idValue });\n }\n\n const labelMatch = val.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n labels?.push({ name, value });\n }\n });\n\n const cleanTitle = title.replace(allureLabelRegexpGlobal, \"\").replace(allureIdRegexpGlobal, \"\").trim();\n\n return { labels, cleanTitle };\n};\n\nexport const isAnyStepFailed = (item: StepResult | TestResult | FixtureResult): boolean => {\n const isFailed = item.status === Status.FAILED;\n\n if (isFailed || item.steps.length === 0) {\n return isFailed;\n }\n\n return !!item.steps.find((step) => isAnyStepFailed(step));\n};\n\nexport const isAllStepsEnded = (item: StepResult | TestResult | FixtureResult): boolean => {\n return item.steps.every((val) => val.stop && isAllStepsEnded(val));\n};\n\nexport const hasLabel = (testResult: TestResult, labelName: LabelName | string): boolean => {\n return !!testResult.labels.find((l) => l.name === labelName);\n};\n\nexport const hasStepMessage = (messages: RuntimeMessage[]) => {\n return messages.some((message) => message.type === \"step_start\" || message.type === \"step_stop\");\n};\n\nexport const getStepsMessagesPair = (messages: RuntimeMessage[]) =>\n messages.reduce((acc, message) => {\n if (message.type !== \"step_start\" && message.type !== \"step_stop\") {\n return acc;\n }\n\n if (message.type === \"step_start\") {\n acc.push([message]);\n\n return acc;\n }\n\n const unfinishedStepIdx = acc.findLastIndex((step) => step.length === 1);\n\n if (unfinishedStepIdx === -1) {\n return acc;\n }\n\n acc[unfinishedStepIdx].push(message);\n\n return acc;\n }, [] as RuntimeMessage[][]);\n\nexport const getUnfinishedStepsMessages = (messages: RuntimeMessage[]) => {\n const grouppedStepsMessage = getStepsMessagesPair(messages);\n\n return grouppedStepsMessage.filter((step) => step.length === 1);\n};\n\nexport const isPromise = <T = any>(obj: any): obj is PromiseLike<T> =>\n !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n\nexport const serialize = (value: any, { maxDepth = 0, maxLength = 0, replacer }: SerializeOptions = {}): string =>\n limitString(\n typeof value === \"object\" ? JSON.stringify(value, createSerializeReplacer(maxDepth, replacer)) : String(value),\n maxLength,\n );\n\nconst createSerializeReplacer = (maxDepth: number, userDefinedReplacer: SerializeOptions[\"replacer\"]) => {\n const parents: unknown[] = [];\n const limitingReplacer = function (this: unknown, _: string, value: unknown) {\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n while (parents.length > 0 && !Object.is(parents.at(-1), this)) {\n parents.pop();\n }\n\n if ((maxDepth && parents.length >= maxDepth) || parents.includes(value)) {\n return undefined;\n }\n\n parents.push(value);\n\n return value instanceof Map\n ? excludeCircularRefsFromMap(parents, value)\n : value instanceof Set\n ? excludeCircularRefsFromSet(parents, value)\n : value;\n };\n return userDefinedReplacer ? composeReplacers(userDefinedReplacer, limitingReplacer) : limitingReplacer;\n};\n\nconst composeReplacers = (first: SerializerReplacerFunc, second: SerializerReplacerFunc): SerializerReplacerFunc =>\n function (k, v) {\n return second.call(this, k, first.call(this, k, v));\n };\n\nconst excludeCircularRefsFromMap = (parents: any[], map: Map<any, any>) => {\n return Array.from(map)\n .filter(([k]) => !parents.includes(k))\n .map(([k, v]) => [k, parents.includes(v) ? undefined : v]);\n};\n\nconst excludeCircularRefsFromSet = (parents: any[], set: Set<any>) => {\n return Array.from(set).map((v) => (parents.includes(v) ? undefined : v));\n};\n\nconst limitString = (value: string, maxLength: number) =>\n maxLength && value.length > maxLength ? `${value.substring(0, maxLength)}...` : value;\n"],"mappings":";;;;;;;;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,aAAa;AAG/C,OAAO,IAAMC,kBAAkB,GAAIC,KAAqB,IAAa;EACnE,QAAQ,IAAI;IACV;AACJ;AACA;AACA;AACA;AACA;IACI,KAAK,UAAU,CAACC,IAAI,CAACD,KAAK,CAACE,WAAW,CAACC,IAAI,CAAC;IAC5C,KAAK,eAAe,CAACF,IAAI,CAACD,KAAK,CAACE,WAAW,CAACC,IAAI,CAAC;IACjD,KAAKH,KAAK,CAACG,IAAI,IAAI,UAAU,CAACF,IAAI,CAACD,KAAK,CAACG,IAAI,CAAC;IAC9C,KAAKH,KAAK,CAACI,OAAO,IAAI,UAAU,CAACH,IAAI,CAACD,KAAK,CAACI,OAAO,CAAC;IACpD,KAAKJ,KAAK,CAACK,KAAK,IAAI,mBAAmB,CAACJ,IAAI,CAACD,KAAK,CAACK,KAAK,CAAC;IACzD,KAAKL,KAAK,CAACK,KAAK,IAAI,yCAAyC,CAACJ,IAAI,CAACD,KAAK,CAACK,KAAK,CAAC;IAC/E,KAAK,eAAe,IAAIL,KAAK;IAC7B,KAAK,SAAS,IAAIA,KAAK,IAAI,OAAOA,KAAK,CAACM,OAAO,KAAK,UAAU;MAC5D,OAAOR,MAAM,CAACS,MAAM;IACtB;MACE,OAAOT,MAAM,CAACU,MAAM;EACxB;AACF,CAAC;;AAED;AACA;AACA;AACA,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAA,EAAmC;EAAA,IAA/B;IAAEC,SAAS,GAAG;EAAM,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,G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CAAC,CAAC,CAAC;AACrD,CAAC;AAEH,IAAMP,0BAA0B,GAAGA,CAACT,OAAc,EAAEkB,GAAkB,KAAK;EACzE,OAAOC,KAAK,CAACC,IAAI,CAACF,GAAG,CAAC,CACnB/B,MAAM,CAACkC,IAAA;IAAA,IAAC,CAACN,CAAC,CAAC,GAAAM,IAAA;IAAA,OAAK,CAACrB,OAAO,CAACO,QAAQ,CAACQ,CAAC,CAAC;EAAA,EAAC,CACrCG,GAAG,CAACI,KAAA;IAAA,IAAC,CAACP,CAAC,EAAEC,CAAC,CAAC,GAAAM,KAAA;IAAA,OAAK,CAACP,CAAC,EAAEf,OAAO,CAACO,QAAQ,CAACS,CAAC,CAAC,GAAG5F,SAAS,GAAG4F,CAAC,CAAC;EAAA,EAAC;AAC9D,CAAC;AAED,IAAML,0BAA0B,GAAGA,CAACX,OAAc,EAAEuB,GAAa,KAAK;EACpE,OAAOJ,KAAK,CAACC,IAAI,CAACG,GAAG,CAAC,CAACL,GAAG,CAAEF,CAAC,IAAMhB,OAAO,CAACO,QAAQ,CAACS,CAAC,CAAC,GAAG5F,SAAS,GAAG4F,CAAE,CAAC;AAC1E,CAAC;AAED,IAAMtB,WAAW,GAAGA,CAACnD,KAAa,EAAEiD,SAAiB,KACnDA,SAAS,IAAIjD,KAAK,CAACpB,MAAM,GAAGqE,SAAS,MAAAgC,MAAA,CAAMjF,KAAK,CAACkF,SAAS,CAAC,CAAC,EAAEjC,SAAS,CAAC,WAAQjD,KAAK","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"utils.js","names":["LabelName","Status","getStatusFromError","error","test","constructor","name","message","stack","inspect","FAILED","BROKEN","ansiRegex","onlyFirst","arguments","length","undefined","pattern","join","RegExp","stripAnsi","str","regex","replace","actualAndExpected","value","matcherResult","actual","serialize","expected","_objectSpread","getMessageAndTraceFromError","trace","allureMetadataRegexp","_wrapRegExp","type","allureTitleMetadataRegexp","allureTitleMetadataRegexpGlobal","allureIdRegexp","id","allureLabelRegexp","getTypeFromAllureTitleMetadataMatch","match","getValueFromAllureTitleMetadataMatch","_match$","quotesRegexp","quoteOpenRegexp","concat","source","quoteCloseRegexp","matchedValue","slice","isMetadataTag","tag","getMetadataLabel","_match$groups","groups","subtype","split","ALLURE_ID","extractMetadataFromString","title","labels","links","metadata","matchAll","cleanTitle","replaceAll","filter","Boolean","reduce","acc","word","trim","m","push","url","isAnyStepFailed","item","isFailed","status","steps","find","step","isAllStepsEnded","every","val","stop","hasLabel","testResult","labelName","l","hasStepMessage","messages","some","getStepsMessagesPair","unfinishedStepIdx","findLastIndex","getUnfinishedStepsMessages","grouppedStepsMessage","isPromise","obj","then","maxDepth","maxLength","replacer","limitString","JSON","stringify","createSerializeReplacer","String","userDefinedReplacer","parents","limitingReplacer","_","Object","is","at","pop","includes","Map","excludeCircularRefsFromMap","Set","excludeCircularRefsFromSet","composeReplacers","first","second","k","v","call","map","Array","from","_ref","_ref2","set","substring"],"sources":["../../../src/sdk/utils.ts"],"sourcesContent":["import type { FixtureResult, Label, Link, StatusDetails, StepResult, TestResult } from \"../model.js\";\nimport { LabelName, Status } from \"../model.js\";\nimport type { RuntimeMessage, SerializeOptions, SerializerReplacerFunc } from \"./types.js\";\n\nexport const getStatusFromError = (error: Partial<Error>): Status => {\n switch (true) {\n /**\n * Native `node:assert` and `chai` (`vitest` uses it under the hood) throw `AssertionError`\n * `jest` throws `JestAssertionError` instance\n * `jasmine` throws `ExpectationFailed` instance\n * `vitest` throws `Error` for extended assertions, so we look into stack\n */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case error.name && /assert/gi.test(error.name):\n case error.message && /assert/gi.test(error.message):\n case error.stack && /@vitest\\/expect/gi.test(error.stack):\n case error.stack && /playwright\\/lib\\/matchers\\/expect\\.js/gi.test(error.stack):\n case \"matcherResult\" in error:\n case \"inspect\" in error && typeof error.inspect === \"function\":\n return Status.FAILED;\n default:\n return Status.BROKEN;\n }\n};\n\n/**\n * Source: https://github.com/chalk/ansi-regex\n */\nconst ansiRegex = ({ onlyFirst = false } = {}) => {\n const pattern = [\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\n \"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\",\n ].join(\"|\");\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n\n/**\n * https://github.com/chalk/strip-ansi\n */\nexport const stripAnsi = (str: string): string => {\n const regex = ansiRegex();\n return str.replace(regex, \"\");\n};\n\nconst actualAndExpected = (value: unknown): { actual?: string; expected?: string } => {\n if (!value || typeof value !== \"object\") {\n return {};\n }\n\n // support for jest asserts\n if (\"matcherResult\" in value && value.matcherResult !== undefined && typeof value.matcherResult === \"object\") {\n return {\n actual: serialize((value.matcherResult as any).actual),\n expected: serialize((value.matcherResult as any).expected),\n };\n }\n\n const actual = \"actual\" in value && value.actual !== undefined ? { actual: serialize(value.actual) } : {};\n const expected = \"expected\" in value && value.expected !== undefined ? { expected: serialize(value.expected) } : {};\n return {\n ...actual,\n ...expected,\n };\n};\n\nexport const getMessageAndTraceFromError = (\n error:\n | Error\n | {\n message?: string;\n stack?: string;\n },\n): StatusDetails => {\n const { message, stack } = error;\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\n ...actualAndExpected(error),\n };\n};\n\ntype AllureTitleMetadataMatch = RegExpMatchArray & {\n groups: {\n type?: string;\n v1?: string;\n v2?: string;\n v3?: string;\n v4?: string;\n };\n};\n\nexport const allureMetadataRegexp = /(?:^|\\s)@?allure\\.(?<type>\\S+)$/;\nexport const allureTitleMetadataRegexp = /(?:^|\\s)@?allure\\.(?<type>[^:=\\s]+)[:=](\"[^\"]+\"|'[^']+'|`[^`]+`|\\S+)/;\nexport const allureTitleMetadataRegexpGlobal = new RegExp(allureTitleMetadataRegexp, \"g\");\nexport const allureIdRegexp = /(?:^|\\s)@?allure\\.id[:=](?<id>\\S+)/;\nexport const allureLabelRegexp = /(?:^|\\s)@?allure\\.label\\.(?<name>[^:=\\s]+)[:=](?<value>[^\\s]+)/;\n\nexport const getTypeFromAllureTitleMetadataMatch = (match: AllureTitleMetadataMatch) => {\n return match?.[1];\n};\n\nexport const getValueFromAllureTitleMetadataMatch = (match: AllureTitleMetadataMatch) => {\n const quotesRegexp = /['\"`]/;\n const quoteOpenRegexp = new RegExp(`^${quotesRegexp.source}`);\n const quoteCloseRegexp = new RegExp(`${quotesRegexp.source}$`);\n const matchedValue = match?.[2] ?? \"\";\n\n if (quoteOpenRegexp.test(matchedValue) && quoteCloseRegexp.test(matchedValue)) {\n return matchedValue.slice(1, -1);\n }\n\n return matchedValue;\n};\n\nexport const isMetadataTag = (tag: string) => {\n return allureMetadataRegexp.test(tag);\n};\n\nexport const getMetadataLabel = (tag: string, value?: string): Label | undefined => {\n const match = tag.match(allureMetadataRegexp);\n const type = match?.groups?.type;\n\n if (!type) {\n return undefined;\n }\n\n const [subtype, name] = type.split(\".\");\n\n return {\n name: subtype === \"id\" ? LabelName.ALLURE_ID : name,\n value: value ?? \"\",\n };\n};\n\nexport const extractMetadataFromString = (\n title: string,\n): {\n labels: Label[];\n links: Link[];\n cleanTitle: string;\n} => {\n const labels = [] as Label[];\n const links = [] as Link[];\n const metadata = title.matchAll(allureTitleMetadataRegexpGlobal);\n const cleanTitle = title\n .replaceAll(allureTitleMetadataRegexpGlobal, \"\")\n .split(\" \")\n .filter(Boolean)\n .reduce((acc, word) => {\n if (/^[\\n\\r]/.test(word)) {\n return acc + word;\n }\n\n return `${acc} ${word}`;\n }, \"\")\n .trim();\n\n for (const m of metadata) {\n const match = m as AllureTitleMetadataMatch;\n const type = getTypeFromAllureTitleMetadataMatch(match);\n const value = getValueFromAllureTitleMetadataMatch(match);\n\n if (!type || !value) {\n continue;\n }\n\n const [subtype, name] = type.split(\".\");\n\n switch (subtype) {\n case \"id\":\n labels.push({ name: LabelName.ALLURE_ID, value });\n break;\n case \"label\":\n labels.push({ name, value });\n break;\n case \"link\":\n links.push({ type: name, url: value });\n break;\n }\n }\n\n return {\n labels,\n links,\n cleanTitle,\n };\n};\n\nexport const isAnyStepFailed = (item: StepResult | TestResult | FixtureResult): boolean => {\n const isFailed = item.status === Status.FAILED;\n\n if (isFailed || item.steps.length === 0) {\n return isFailed;\n }\n\n return !!item.steps.find((step) => isAnyStepFailed(step));\n};\n\nexport const isAllStepsEnded = (item: StepResult | TestResult | FixtureResult): boolean => {\n return item.steps.every((val) => val.stop && isAllStepsEnded(val));\n};\n\nexport const hasLabel = (testResult: TestResult, labelName: LabelName | string): boolean => {\n return !!testResult.labels.find((l) => l.name === labelName);\n};\n\nexport const hasStepMessage = (messages: RuntimeMessage[]) => {\n return messages.some((message) => message.type === \"step_start\" || message.type === \"step_stop\");\n};\n\nexport const getStepsMessagesPair = (messages: RuntimeMessage[]) =>\n messages.reduce((acc, message) => {\n if (message.type !== \"step_start\" && message.type !== \"step_stop\") {\n return acc;\n }\n\n if (message.type === \"step_start\") {\n acc.push([message]);\n\n return acc;\n }\n\n const unfinishedStepIdx = acc.findLastIndex((step) => step.length === 1);\n\n if (unfinishedStepIdx === -1) {\n return acc;\n }\n\n acc[unfinishedStepIdx].push(message);\n\n return acc;\n }, [] as RuntimeMessage[][]);\n\nexport const getUnfinishedStepsMessages = (messages: RuntimeMessage[]) => {\n const grouppedStepsMessage = getStepsMessagesPair(messages);\n\n return grouppedStepsMessage.filter((step) => step.length === 1);\n};\n\nexport const isPromise = <T = any>(obj: any): obj is PromiseLike<T> =>\n !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n\nexport const serialize = (value: any, { maxDepth = 0, maxLength = 0, replacer }: SerializeOptions = {}): string =>\n limitString(\n typeof value === \"object\" ? JSON.stringify(value, createSerializeReplacer(maxDepth, replacer)) : String(value),\n maxLength,\n );\n\nconst createSerializeReplacer = (maxDepth: number, userDefinedReplacer: SerializeOptions[\"replacer\"]) => {\n const parents: unknown[] = [];\n const limitingReplacer = function (this: unknown, _: string, value: unknown) {\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n while (parents.length > 0 && !Object.is(parents.at(-1), this)) {\n parents.pop();\n }\n\n if ((maxDepth && parents.length >= maxDepth) || parents.includes(value)) {\n return undefined;\n }\n\n parents.push(value);\n\n return value instanceof Map\n ? excludeCircularRefsFromMap(parents, value)\n : value instanceof Set\n ? excludeCircularRefsFromSet(parents, value)\n : value;\n };\n return userDefinedReplacer ? composeReplacers(userDefinedReplacer, limitingReplacer) : limitingReplacer;\n};\n\nconst composeReplacers = (first: SerializerReplacerFunc, second: SerializerReplacerFunc): SerializerReplacerFunc =>\n function (k, v) {\n return second.call(this, k, first.call(this, k, v));\n };\n\nconst excludeCircularRefsFromMap = (parents: any[], map: Map<any, any>) => {\n return Array.from(map)\n .filter(([k]) => !parents.includes(k))\n .map(([k, v]) => [k, parents.includes(v) ? undefined : v]);\n};\n\nconst excludeCircularRefsFromSet = (parents: any[], set: Set<any>) => {\n return Array.from(set).map((v) => (parents.includes(v) ? undefined : v));\n};\n\nconst limitString = (value: string, maxLength: number) =>\n maxLength && value.length > maxLength ? `${value.substring(0, maxLength)}...` : value;\n"],"mappings":";;;;;;;;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,aAAa;AAG/C,OAAO,IAAMC,kBAAkB,GAAIC,KAAqB,IAAa;EACnE,QAAQ,IAAI;IACV;AACJ;AACA;AACA;AACA;AACA;IACI,KAAK,UAAU,CAACC,IAAI,CAACD,KAAK,CAACE,WAAW,CAACC,IAAI,CAAC;IAC5C,KAAK,eAAe,CAACF,IAAI,CAACD,KAAK,CAACE,WAAW,CAACC,IAAI,CAAC;IACjD,KAAKH,KAAK,CAACG,IAAI,IAAI,UAAU,CAACF,IAAI,CAACD,KAAK,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