allure-js-commons 3.0.0-beta.6 → 3.0.0-beta.7
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/facade.js.map +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +2 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/testplan.js +19 -1
- package/dist/cjs/sdk/reporter/testplan.js.map +1 -1
- package/dist/cjs/sdk/utils.js +2 -2
- package/dist/cjs/sdk/utils.js.map +1 -1
- package/dist/esm/facade.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +2 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/testplan.js +15 -0
- package/dist/esm/sdk/reporter/testplan.js.map +1 -1
- package/dist/esm/sdk/utils.js +2 -2
- package/dist/esm/sdk/utils.js.map +1 -1
- package/dist/types/sdk/reporter/testplan.d.ts +4 -0
- package/dist/types/sdk/utils.d.ts +1 -1
- package/package.json +3 -3
package/dist/cjs/facade.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.js","names":["_model","require","_runtime","_utils","callRuntimeMethod","method","_len","arguments","length","args","Array","_key","runtime","getGlobalTestRuntimeWithAutoconfig","isPromise","then","testRuntime","label","name","value","exports","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","opts","contentType","attachmentPath","path","stepContext","mode","logStep","status","error","step","body","issue","LinkType","ISSUE","tms","TMS","allureId","LabelName","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len4","tagsList","_key4","map"],"sources":["../../src/facade.ts"],"sourcesContent":["import type { Status } from \"./model.js\";\nimport { type ContentType } from \"./model.js\";\nimport { type AttachmentOptions, type Label, type Link, type ParameterMode, type ParameterOptions } from \"./model.js\";\nimport { LabelName, LinkType } from \"./model.js\";\nimport { getGlobalTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { TestRuntime } from \"./sdk/runtime/types.js\";\nimport { isPromise } from \"./sdk/utils.js\";\n\nconst callRuntimeMethod = <\n T extends keyof TestRuntime,\n S extends Parameters<TestRuntime[T]>,\n R extends ReturnType<TestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalTestRuntimeWithAutoconfig();\n\n if (!isPromise(runtime)) {\n // @ts-ignore\n return (runtime as TestRuntime)[method](...args);\n }\n\n return (runtime as Promise<TestRuntime>).then((testRuntime) => {\n // @ts-ignore\n return testRuntime[method](...args);\n }) as R;\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nexport type StepContext = {\n displayName: (name: string) => void | PromiseLike<void>;\n parameter: (name: string, value: string, mode?: ParameterMode) => void | PromiseLike<void>;\n};\n\nconst stepContext: () => StepContext = () => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): PromiseLike<void> => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: StepContext) => T | PromiseLike<T>): PromiseLike<T> => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\"labels\", ...tagsList.map((value) => ({ name: LabelName.TAG, value })));\n};\n"],"mappings":";;;;;;AAGA,IA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AAAF,KAAA,EAAAE,KAAA;IAARD,QAAQ,CAAAC,KAAA,IAAA9E,SAAA,CAAA8E,KAAA;EAAA;EAC9B,OAAOjF,iBAAiB,CAAC,QAAQ,EAAE,GAAGgF,QAAQ,CAACE,GAAG,CAAEnE,KAAK,KAAM;IAAED,IAAI,EAAE0C,gBAAS,CAACqB,GAAG;IAAE9D;EAAM,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"facade.js","names":["_model","require","_runtime","_utils","callRuntimeMethod","method","_len","arguments","length","args","Array","_key","runtime","getGlobalTestRuntimeWithAutoconfig","isPromise","then","testRuntime","label","name","value","exports","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","opts","contentType","attachmentPath","path","stepContext","mode","logStep","status","error","step","body","issue","LinkType","ISSUE","tms","TMS","allureId","LabelName","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len4","tagsList","_key4","map"],"sources":["../../src/facade.ts"],"sourcesContent":["import type { Status } from \"./model.js\";\nimport { type ContentType } from \"./model.js\";\nimport { type AttachmentOptions, type Label, type Link, type ParameterMode, type ParameterOptions } from \"./model.js\";\nimport { LabelName, LinkType } from \"./model.js\";\nimport { getGlobalTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { TestRuntime } from \"./sdk/runtime/types.js\";\nimport { isPromise } from \"./sdk/utils.js\";\n\nconst callRuntimeMethod = <\n T extends keyof TestRuntime,\n S extends Parameters<TestRuntime[T]>,\n R extends ReturnType<TestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalTestRuntimeWithAutoconfig();\n\n if (!isPromise(runtime)) {\n // @ts-ignore\n return runtime[method](...args);\n }\n\n return runtime.then((testRuntime) => {\n // @ts-ignore\n return testRuntime[method](...args);\n }) as R;\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nexport type StepContext = {\n displayName: (name: string) => void | PromiseLike<void>;\n parameter: (name: string, value: string, mode?: ParameterMode) => void | PromiseLike<void>;\n};\n\nconst stepContext: () => StepContext = () => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): PromiseLike<void> => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: StepContext) => T | PromiseLike<T>): PromiseLike<T> => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\"labels\", ...tagsList.map((value) => ({ name: LabelName.TAG, value })));\n};\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAMG,iBAAiB,GAAG,SAApBA,iBAAiBA,CAKrBC,MAAS,EAEH;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EADHC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;EAAA;EAEP,IAAMC,OAAO,GAAG,IAAAC,2CAAkC,EAAC,CAAC;EAEpD,IAAI,CAAC,IAAAC,gBAAS,EAACF,OAAO,CAAC,E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A,QAAA;AAEpE,IAAME,KAAK,GAAIxD,IAAY,IAAKD,KAAK,CAAC2C,gBAAS,CAACe,KAAK,EAAEzD,IAAI,CAAC;AAACE,OAAA,CAAAsD,KAAA,GAAAA,KAAA;AAE7D,IAAME,QAAQ,GAAI1D,IAAY,IAAKD,KAAK,CAAC2C,gBAAS,CAACiB,QAAQ,EAAE3D,IAAI,CAAC;AAACE,OAAA,CAAAwD,QAAA,GAAAA,QAAA;AAEnE,IAAME,KAAK,GAAI5D,IAAY,IAAKD,KAAK,CAAC2C,gBAAS,CAACmB,KAAK,EAAE7D,IAAI,CAAC;AAACE,OAAA,CAAA0D,KAAA,GAAAA,KAAA;AAE7D,IAAME,GAAG,GAAI9D,IAAY,IAAKD,KAAK,CAAC2C,gBAAS,CAACqB,GAAG,EAAE/D,IAAI,CAAC;AAACE,OAAA,CAAA4D,GAAA,GAAAA,GAAA;AAEzD,IAAME,IAAI,GAAA9D,OAAA,CAAA8D,IAAA,GAAG,SAAPA,IAAIA,CAAA,EAA8B;EAAA,SAAAC,KAAA,GAAA5E,SAAA,CAAAC,MAAA,EAAvB4E,QAAQ,OAAA1E,KAAA,CAAAyE,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAARD,QAAQ,CAAAC,KAAA,IAAA9E,SAAA,CAAA8E,KAAA;EAAA;EAC9B,OAAOjF,iBAAiB,CAAC,QAAQ,EAAE,GAAGgF,QAAQ,CAACE,GAAG,CAAEnE,KAAK,KAAM;IAAED,IAAI,EAAE0C,gBAAS,CAACqB,GAAG;IAAE9D;EAAM,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ var _model = require("../../model.js");
|
|
|
9
9
|
var _LifecycleState = require("./LifecycleState.js");
|
|
10
10
|
var _Notifier = require("./Notifier.js");
|
|
11
11
|
var _factory = require("./factory.js");
|
|
12
|
+
var _testplan = require("./testplan.js");
|
|
12
13
|
var _utils = require("./utils.js");
|
|
13
14
|
var _attachments = require("./utils/attachments.js");
|
|
14
15
|
var _loader = require("./writer/loader.js");
|
|
@@ -209,7 +210,7 @@ class ReporterRuntime {
|
|
|
209
210
|
console.error("could not write test result: no test with uuid ".concat(uuid, " is found"));
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
212
|
-
if (
|
|
213
|
+
if ((0, _testplan.hasSkipLabel)(testResult.labels)) {
|
|
213
214
|
this.state.deleteTestResult(uuid);
|
|
214
215
|
return;
|
|
215
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["_path","require","_model","_LifecycleState","_Notifier","_factory","_utils","_attachments","_loader","_excluded","_objectWithoutProperties","e","t","o","r","i","_objectWithoutPropertiesLoose","Object","getOwnPropertySymbols","n","length","indexOf","propertyIsEnumerable","call","hasOwnProperty","ownKeys","keys","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","set","has","TypeError","_classPrivateFieldGet","s","get","_assertClassBrand","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","String","Number","DefaultStepStack","constructor","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","LifecycleState","uuid","randomUuid","state","setScope","updateFunc","scope","getScope","console","error","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","Stage","FINISHED","result","scopeUuids","undefined","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","beforeTestResultStop","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","testResults","labels","find","label","name","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","createStepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","extname","attachmentFileName","buildAttachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","updateFixture","displayName","parameters","rest","updateTest","linkConfig","formatLinks","assign","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","resolveWriter","Notifier","exports"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n 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 type { Config, FixtureType, FixtureWrapper, LinkConfig, TestScope, Writer } 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\n constructor({ writer, listeners = [], environmentInfo, categories, links }: Config) {\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\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(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);\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 testResult = this.state.getTestResult(uuid);\n if (!testResult) {\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 this.notifier.beforeTestResultStop(testResult);\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\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.testResults.get(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 (testResult.labels.find((label) => label.name === \"ALLURE_TESTPLAN_SKIP\")) {\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.getFixtureResult(rootUuid);\n if (fixtureResult) {\n this.updateFixture(rootUuid, (result) => {\n if (message.displayName) {\n result.name = message.displayName;\n }\n });\n return;\n }\n\n const { links, labels, parameters, displayName, ...rest } = message;\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 Object.assign(result, rest);\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: FixtureWrapper) => {\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 = (start?: number, stop?: number, duration?: number): { start?: number; stop?: number } => {\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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_LifecycleState","_Notifier","_factory","_testplan","_utils","_attachments","_loader","_excluded","_objectWithoutProperties","e","t","o","r","i","_objectWithoutPropertiesLoose","Object","getOwnPropertySymbols","n","length","indexOf","propertyIsEnumerable","call","hasOwnProperty","ownKeys","keys","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","set","has","TypeError","_classPrivateFieldGet","s","get","_assertClassBrand","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","String","Number","DefaultStepStack","constructor","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","LifecycleState","uuid","randomUuid","state","setScope","updateFunc","scope","getScope","console","error","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","Stage","FINISHED","result","scopeUuids","undefined","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","beforeTestResultStop","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","testResults","hasSkipLabel","labels","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","createStepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","extname","attachmentFileName","buildAttachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","updateFixture","displayName","parameters","rest","updateTest","linkConfig","formatLinks","assign","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","resolveWriter","Notifier","exports"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n 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 { Config, FixtureType, FixtureWrapper, LinkConfig, TestScope, Writer } 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\n constructor({ writer, listeners = [], environmentInfo, categories, links }: Config) {\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\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(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);\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 testResult = this.state.getTestResult(uuid);\n if (!testResult) {\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 this.notifier.beforeTestResultStop(testResult);\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\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.testResults.get(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.getFixtureResult(rootUuid);\n if (fixtureResult) {\n this.updateFixture(rootUuid, (result) => {\n if (message.displayName) {\n result.name = message.displayName;\n }\n });\n return;\n }\n\n const { links, labels, parameters, displayName, ...rest } = message;\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 Object.assign(result, rest);\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: FixtureWrapper) => {\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 = (start?: number, stop?: number, duration?: number): { start?: number; stop?: number } => {\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 result;\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAmBA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AA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AAGmH,kBAAkB;QACjD,CAAC,MAAM;UACLtG,MAAM,CAACL,IAAI,GAAGP,IAAI,CAACC,GAAG,CAAC,CAAC;UACxBW,MAAM,CAACb,KAAK,GAAGa,MAAM,CAACL,IAAI,GAAG2G,kBAAkB;QACjD;MACF,CAAC,MAAM;QACL,IAAItG,MAAM,CAACL,IAAI,KAAKO,SAAS,EAAE;UAC7BF,MAAM,CAACL,IAAI,GAAGP,IAAI,CAACC,GAAG,CAAC,CAAC;QAC1B;QACA,IAAIW,MAAM,CAACb,KAAK,KAAKe,SAAS,EAAE;UAC9BF,MAAM,CAACb,KAAK,GAAGa,MAAM,CAACL,IAAI;QAC5B;MACF;MACA,OAAOK,MAAM;IACf,CAAC;IApeC,IAAI,CAACpC,MAAM,GAAG,IAAA6I,qBAAa,EAAC7I,MAAM,CAAC;IACnC,IAAI,CAAC0C,QAAQ,GAAG,IAAIoG,kBAAQ,CAAC;MAAE7I;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACgH,UAAU,GAAG9G,MAAK;EACzB;AAgeF;AAAC2I,OAAA,CAAAlJ,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.parseTestPlan = exports.includedInTestPlan = void 0;
|
|
6
|
+
exports.parseTestPlan = exports.includedInTestPlan = exports.hasSkipLabel = exports.addSkipLabelAsMeta = exports.addSkipLabel = void 0;
|
|
7
7
|
var _nodeFs = require("node:fs");
|
|
8
8
|
var _utils = require("../utils.js");
|
|
9
9
|
var parseTestPlan = () => {
|
|
@@ -42,4 +42,22 @@ var includedInTestPlan = (testPlan, subject) => {
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
exports.includedInTestPlan = includedInTestPlan;
|
|
45
|
+
var addSkipLabel = labels => {
|
|
46
|
+
labels.push({
|
|
47
|
+
name: "ALLURE_TESTPLAN_SKIP",
|
|
48
|
+
value: "true"
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.addSkipLabel = addSkipLabel;
|
|
52
|
+
var addSkipLabelAsMeta = name => {
|
|
53
|
+
return "".concat(name, " @allure.label.ALLURE_TESTPLAN_SKIP:true");
|
|
54
|
+
};
|
|
55
|
+
exports.addSkipLabelAsMeta = addSkipLabelAsMeta;
|
|
56
|
+
var hasSkipLabel = labels => labels.some(_ref => {
|
|
57
|
+
var {
|
|
58
|
+
name
|
|
59
|
+
} = _ref;
|
|
60
|
+
return name === "ALLURE_TESTPLAN_SKIP";
|
|
61
|
+
});
|
|
62
|
+
exports.hasSkipLabel = hasSkipLabel;
|
|
45
63
|
//# sourceMappingURL=testplan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testplan.js","names":["_nodeFs","require","_utils","parseTestPlan","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","undefined","file","readFileSync","testPlan","JSON","parse","tests","length","e","exports","includedInTestPlan","subject","id","fullName","tags","effectiveId","map","tag","_tag$match","match","allureIdRegexp","groups","find","maybeId","some","test","idMatched","String","selectorMatched","selector"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport type { TestPlanV1 } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as TestPlanV1;\n\n // Execute all tests if test plan is empty\n if ((testPlan.tests || []).length === 0) {\n return undefined;\n }\n\n return testPlan;\n } catch (e) {\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { id?: string; fullName?: string; tags?: string[] },\n): boolean => {\n const { id, fullName, tags = [] } = subject;\n const effectiveId =\n id ?? tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n return testPlan.tests.some((test) => {\n const idMatched = effectiveId && test.id ? String(test.id) === effectiveId : false;\n const selectorMatched = fullName && test.selector === fullName;\n\n return idMatched || selectorMatched;\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"file":"testplan.js","names":["_nodeFs","require","_utils","parseTestPlan","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","undefined","file","readFileSync","testPlan","JSON","parse","tests","length","e","exports","includedInTestPlan","subject","id","fullName","tags","effectiveId","map","tag","_tag$match","match","allureIdRegexp","groups","find","maybeId","some","test","idMatched","String","selectorMatched","selector","addSkipLabel","labels","push","name","value","addSkipLabelAsMeta","concat","hasSkipLabel","_ref"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport type { Label } from \"../../model.js\";\nimport type { TestPlanV1 } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as TestPlanV1;\n\n // Execute all tests if test plan is empty\n if ((testPlan.tests || []).length === 0) {\n return undefined;\n }\n\n return testPlan;\n } catch (e) {\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { id?: string; fullName?: string; tags?: string[] },\n): boolean => {\n const { id, fullName, tags = [] } = subject;\n const effectiveId =\n id ?? tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n return testPlan.tests.some((test) => {\n const idMatched = effectiveId && test.id ? String(test.id) === effectiveId : false;\n const selectorMatched = fullName && test.selector === fullName;\n\n return idMatched || selectorMatched;\n });\n};\n\nexport const addSkipLabel = (labels: Label[]) => {\n labels.push({ name: \"ALLURE_TESTPLAN_SKIP\", value: \"true\" });\n};\n\nexport const addSkipLabelAsMeta = (name: string) => {\n return `${name} @allure.label.ALLURE_TESTPLAN_SKIP:true`;\n};\n\nexport const hasSkipLabel = (labels: readonly Label[]) => labels.some(({ name }) => name === \"ALLURE_TESTPLAN_SKIP\");\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAEO,IAAME,aAAa,GAAGA,CAAA,KAA8B;EACzD,IAAMC,YAAY,GAAGC,OAAO,CAACC,GAAG,CAACC,oBAAoB;EAErD,IAAI,CAACH,YAAY,EAAE;IACjB,OAAOI,SAAS;EAClB;EAEA,IAAI;IACF,IAAMC,IAAI,GAAG,IAAAC,oBAAY,EAACN,YAAY,EAAE,MAAM,CAAC;IAC/C,IAAMO,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACJ,IAAI,CAAe;;IAE/C;IACA,IAAI,CAACE,QAAQ,CAACG,KAAK,IAAI,EAAE,EAAEC,MAAM,KAAK,CAAC,EAAE;MACvC,OAAOP,SAAS;IAClB;IAEA,OAAOG,QAAQ;EACjB,CAAC,CAAC,OAAOK,CAAC,EAAE;IACV,OAAOR,SAAS;EAClB;AACF,CAAC;AAACS,OAAA,CAAAd,aAAA,GAAAA,aAAA;AAEK,IAAMe,kBAAkB,GAAGA,CAChCP,QAAoB,EACpBQ,OAA4D,KAChD;EACZ,IAAM;IAAEC,EAAE;IAAEC,QAAQ;IAAEC,IAAI,GAAG;EAAG,CAAC,GAAGH,OAAO;EAC3C,IAAMI,WAAW,GACfH,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAIE,IAAI,CAACE,GAAG,CAAEC,GAAG;IAAA,IAAAC,UAAA;IAAA,OAAKD,GAAG,a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56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
exports.getMessageAndTraceFromError = getMessageAndTraceFromError;
|
|
59
|
-
var allureIdRegexp = exports.allureIdRegexp = /*#__PURE__*/_wrapRegExp(
|
|
59
|
+
var allureIdRegexp = exports.allureIdRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.id[:=]([^\s]+)/, {
|
|
60
60
|
id: 1
|
|
61
61
|
});
|
|
62
62
|
var allureIdRegexpGlobal = exports.allureIdRegexpGlobal = new RegExp(allureIdRegexp, "g");
|
|
63
|
-
var allureLabelRegexp = exports.allureLabelRegexp = /*#__PURE__*/_wrapRegExp(
|
|
63
|
+
var allureLabelRegexp = exports.allureLabelRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.label\.([^:=\s]+)[:=]([^\s]+)/, {
|
|
64
64
|
name: 1,
|
|
65
65
|
value: 2
|
|
66
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_model","require","_wrapRegExp","e","r","BabelRegExp","RegExp","prototype","WeakMap","t","p","o","set","get","_setPrototypeOf","buildGroups","Object","keys","reduce","i","length","create","_inherits","exec","call","groups","indices","Symbol","replace","Array","isArray","join","arguments","slice","push","apply","TypeError","constructor","value","writable","configurable","defineProperty","setPrototypeOf","bind","__proto__","getStatusFromError","error","test","name","message","Status","FAILED","BROKEN","exports","ansiRegex","onlyFirst","undefined","pattern","stripAnsi","str","regex","getMessageAndTraceFromError","stack","trace","allureIdRegexp","id","allureIdRegexpGlobal","allureLabelRegexp","allureLabelRegexpGlobal","extractMetadataFromString","title","labels","split","forEach","val","_val$match","idValue","match","LabelName","ALLURE_ID","labelMatch","cleanTitle","trim","isAnyStepFailed","item","isFailed","status","steps","find","step","isAllStepsEnded","every","stop","hasLabel","testResult","labelName","l","hasStepMessage","messages","some","type","getStepsMessagesPair","acc","unfinishedStepIdx","findLastIndex","getUnfinishedStepsMessages","grouppedStepsMessage","filter","isPromise","obj","then"],"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 } from \"./types.js\";\n\nexport const getStatusFromError = (error: 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 */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case /assert/gi.test(error.name):\n case /assert/gi.test(error.message):\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 = (\n error: Error | { message?: string; stack?: string },\n): Pick<StatusDetails, \"message\" | \"trace\"> => {\n const { message, stack } = error;\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\n };\n};\n\nexport const allureIdRegexp = /@?allure.id[:=](?<id>[^\\s]+)/;\nexport const allureIdRegexpGlobal = new RegExp(allureIdRegexp, \"g\");\nexport const allureLabelRegexp = /@?allure.label.(?<name>[^\\s]+?)[:=](?<value>[^\\s]+)/;\nexport const allureLabelRegexpGlobal = new RegExp(allureLabelRegexp, \"g\");\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);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rE,IAAI,CAACe,OAAO,CAAC;EAEpC,OAAOqD,GAAG;AACZ,CAAC,EAAE,EAAwB,CAAC;AAACjD,OAAA,CAAAgD,oBAAA,GAAAA,oBAAA;AAExB,IAAMI,0BAA0B,GAAIP,QAA0B,IAAK;EACxE,IAAMQ,oBAAoB,GAAGL,oBAAoB,CAACH,QAAQ,CAAC;EAE3D,OAAOQ,oBAAoB,CAACC,MAAM,CAAElB,IAAI,IAAKA,IAAI,CAACrE,MAAM,KAAK,CAAC,CAAC;AACjE,CAAC;AAACiC,OAAA,CAAAoD,0BAAA,GAAAA,0BAAA;AAEK,IAAMG,SAAS,GAAIC,GAAQ,IAChC,CAAC,CAACA,GAAG,KAAK,OAAOA,GAAG,KAAK,QAAQ,IAAI,OAAOA,GAAG,KAAK,UAAU,CAAC,IAAI,OAAOA,GAAG,CAACC,IAAI,KAAK,UAAU;AAACzD,OAAA,CAAAuD,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_model","require","_wrapRegExp","e","r","BabelRegExp","RegExp","prototype","WeakMap","t","p","o","set","get","_setPrototypeOf","buildGroups","Object","keys","reduce","i","length","create","_inherits","exec","call","groups","indices","Symbol","replace","Array","isArray","join","arguments","slice","push","apply","TypeError","constructor","value","writable","configurable","defineProperty","setPrototypeOf","bind","__proto__","getStatusFromError","error","test","name","message","Status","FAILED","BROKEN","exports","ansiRegex","onlyFirst","undefined","pattern","stripAnsi","str","regex","getMessageAndTraceFromError","stack","trace","allureIdRegexp","id","allureIdRegexpGlobal","allureLabelRegexp","allureLabelRegexpGlobal","extractMetadataFromString","title","labels","split","forEach","val","_val$match","idValue","match","LabelName","ALLURE_ID","labelMatch","cleanTitle","trim","isAnyStepFailed","item","isFailed","status","steps","find","step","isAllStepsEnded","every","stop","hasLabel","testResult","labelName","l","hasStepMessage","messages","some","type","getStepsMessagesPair","acc","unfinishedStepIdx","findLastIndex","getUnfinishedStepsMessages","grouppedStepsMessage","filter","isPromise","obj","then"],"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 } from \"./types.js\";\n\nexport const getStatusFromError = (error: 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 */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case /assert/gi.test(error.name):\n case /assert/gi.test(error.message):\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 = (\n error: Error | { message?: string; stack?: string },\n): Pick<StatusDetails, \"message\" | \"trace\"> => {\n const { message, stack } = error;\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\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 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"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAAgD,SAAAC,YAAA,IAAAA,WAAA,YAAAA,YAAAC,CAAA,EAAAC,CAAA,eAAAC,WAAA,CAAAF,CAAA,UAAAC,CAAA,UAAAD,CAAA,GAAAG,MAAA,CAAAC,SAAA,EAAAH,CAAA,OAAAI,OAAA,aAAAH,YAAAF,CAAA,EAAAM,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAL,MAAA,CAAAH,CAAA,EAAAM,CAAA,UAAAL,CAAA,CAAAQ,GAAA,CAAAD,CAAA,EAAAD,CAAA,IAAAN,CAAA,CAAAS,GAAA,CAAAV,CAAA,IAAAW,eAAA,CAAAH,CAAA,EAAAN,WAAA,CAAAE,SAAA,cAAAQ,YAAAZ,CAAA,EAAAM,CAAA,QAAAC,CAAA,GAAAN,CAAA,CAAAS,GAAA,CAAAJ,CAAA,UAAAO,MAAA,CAAAC,IAAA,CAAAP,CAAA,EAAAQ,MAAA,WAAAd,CAAA,EAAAK,CAAA,QAAAE,CAAA,GAAAD,CAAA,CAAAD,CAAA,0BAAAE,CAAA,EAAAP,CAAA,CAAAK,CAAA,IAAAN,CAAA,CAAAQ,CAAA,kBAAAQ,CAAA,iBAAAhB,CAAA,CAAAQ,CAAA,CAAAQ,CAAA,MAAAA,CAAA,OAAAR,CAAA,CAAAS,MAAA,GAAAD,CAAA,IAAAf,CAAA,CAAAK,CAAA,IAAAN,CAAA,CAAAQ,CAAA,CAAAQ,CAAA,aAAAf,CAAA,KAAAY,MAAA,CAAAK,MAAA,kBAAAC,SAAA,CAAAjB,WAAA,EAAAC,MAAA,GAAAD,WAAA,CAAAE,SAAA,CAAAgB,IAAA,aAAAnB,CAAA,QAAAK,CAAA,GAAAN,CAAA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AAOD,GAAG;EACZ;EAEAA,GAAG,CAACC,iBAAiB,CAAC,CAACrE,IAAI,CAACe,OAAO,CAAC;EAEpC,OAAOqD,GAAG;AACZ,CAAC,EAAE,EAAwB,CAAC;AAACjD,OAAA,CAAAgD,oBAAA,GAAAA,oBAAA;AAExB,IAAMI,0BAA0B,GAAIP,QAA0B,IAAK;EACxE,IAAMQ,oBAAoB,GAAGL,oBAAoB,CAACH,QAAQ,CAAC;EAE3D,OAAOQ,oBAAoB,CAACC,MAAM,CAAElB,IAAI,IAAKA,IAAI,CAACrE,MAAM,KAAK,CAAC,CAAC;AACjE,CAAC;AAACiC,OAAA,CAAAoD,0BAAA,GAAAA,0BAAA;AAEK,IAAMG,SAAS,GAAaC,GAAQ,IACzC,CAAC,CAACA,GAAG,KAAK,OAAOA,GAAG,KAAK,QAAQ,IAAI,OAAOA,GAAG,KAAK,UAAU,CAAC,IAAI,OAAOA,GAAG,CAACC,IAAI,KAAK,UAAU;AAACzD,OAAA,CAAAuD,SAAA,GAAAA,SAAA","ignoreList":[]}
|
package/dist/esm/facade.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.js","names":["LabelName","LinkType","getGlobalTestRuntimeWithAutoconfig","isPromise","callRuntimeMethod","method","_len","arguments","length","args","Array","_key","runtime","then","testRuntime","label","name","value","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","opts","contentType","attachmentPath","path","stepContext","mode","logStep","status","error","step","body","issue","ISSUE","tms","TMS","allureId","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len4","tagsList","_key4","map"],"sources":["../../src/facade.ts"],"sourcesContent":["import type { Status } from \"./model.js\";\nimport { type ContentType } from \"./model.js\";\nimport { type AttachmentOptions, type Label, type Link, type ParameterMode, type ParameterOptions } from \"./model.js\";\nimport { LabelName, LinkType } from \"./model.js\";\nimport { getGlobalTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { TestRuntime } from \"./sdk/runtime/types.js\";\nimport { isPromise } from \"./sdk/utils.js\";\n\nconst callRuntimeMethod = <\n T extends keyof TestRuntime,\n S extends Parameters<TestRuntime[T]>,\n R extends ReturnType<TestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalTestRuntimeWithAutoconfig();\n\n if (!isPromise(runtime)) {\n // @ts-ignore\n return (runtime as TestRuntime)[method](...args);\n }\n\n return (runtime as Promise<TestRuntime>).then((testRuntime) => {\n // @ts-ignore\n return testRuntime[method](...args);\n }) as R;\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nexport type StepContext = {\n displayName: (name: string) => void | PromiseLike<void>;\n parameter: (name: string, value: string, mode?: ParameterMode) => void | PromiseLike<void>;\n};\n\nconst stepContext: () => StepContext = () => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): PromiseLike<void> => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: StepContext) => T | PromiseLike<T>): PromiseLike<T> => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\"labels\", ...tagsList.map((value) => ({ name: LabelName.TAG, value })));\n};\n"],"mappings":"AAGA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,YAAY;AAChD,SAASC,kCA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IAAM2D,GAAG,GAAI3D,IAAY,IAAKD,KAAK,CAACf,SAAS,CAAC4E,GAAG,EAAE5D,IAAI,CAAC;AAE/D,OAAO,IAAM6D,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAA8B;EAAA,SAAAC,KAAA,GAAAvE,SAAA,CAAAC,MAAA,EAAvBuE,QAAQ,OAAArE,KAAA,CAAAoE,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAARD,QAAQ,CAAAC,KAAA,IAAAzE,SAAA,CAAAyE,KAAA;EAAA;EAC9B,OAAO5E,iBAAiB,CAAC,QAAQ,EAAE,GAAG2E,QAAQ,CAACE,GAAG,CAAEhE,KAAK,KAAM;IAAED,IAAI,EAAEhB,SAAS,CAAC4E,GAAG;IAAE3D;EAAM,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"facade.js","names":["LabelName","LinkType","getGlobalTestRuntimeWithAutoconfig","isPromise","callRuntimeMethod","method","_len","arguments","length","args","Array","_key","runtime","then","testRuntime","label","name","value","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","opts","contentType","attachmentPath","path","stepContext","mode","logStep","status","error","step","body","issue","ISSUE","tms","TMS","allureId","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len4","tagsList","_key4","map"],"sources":["../../src/facade.ts"],"sourcesContent":["import type { Status } from \"./model.js\";\nimport { type ContentType } from \"./model.js\";\nimport { type AttachmentOptions, type Label, type Link, type ParameterMode, type ParameterOptions } from \"./model.js\";\nimport { LabelName, LinkType } from \"./model.js\";\nimport { getGlobalTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { TestRuntime } from \"./sdk/runtime/types.js\";\nimport { isPromise } from \"./sdk/utils.js\";\n\nconst callRuntimeMethod = <\n T extends keyof TestRuntime,\n S extends Parameters<TestRuntime[T]>,\n R extends ReturnType<TestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalTestRuntimeWithAutoconfig();\n\n if (!isPromise(runtime)) {\n // @ts-ignore\n return runtime[method](...args);\n }\n\n return runtime.then((testRuntime) => {\n // @ts-ignore\n return testRuntime[method](...args);\n }) as R;\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nexport type StepContext = {\n displayName: (name: string) => void | PromiseLike<void>;\n parameter: (name: string, value: string, mode?: ParameterMode) => void | PromiseLike<void>;\n};\n\nconst stepContext: () => StepContext = () => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): PromiseLike<void> => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: StepContext) => T | PromiseLike<T>): PromiseLike<T> => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\"labels\", ...tagsList.map((value) => ({ name: LabelName.TAG, value })));\n};\n"],"mappings":"AAGA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,YAAY;AAChD,SAASC,kCAAkC,QAAQ,0BAA0B;AAE7E,SAASC,SAAS,QAAQ,gBAAgB;AAE1C,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAKrBC,MAAS,EAEH;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EADHC,I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AA,CAAAC,MAAA,EAAvBuE,QAAQ,OAAArE,KAAA,CAAAoE,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAARD,QAAQ,CAAAC,KAAA,IAAAzE,SAAA,CAAAyE,KAAA;EAAA;EAC9B,OAAO5E,iBAAiB,CAAC,QAAQ,EAAE,GAAG2E,QAAQ,CAACE,GAAG,CAAEhE,KAAK,KAAM;IAAED,IAAI,EAAEhB,SAAS,CAAC4E,GAAG;IAAE3D;EAAM,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,7 @@ import { Stage } from "../../model.js";
|
|
|
16
16
|
import { LifecycleState } from "./LifecycleState.js";
|
|
17
17
|
import { Notifier } from "./Notifier.js";
|
|
18
18
|
import { createFixtureResult, createStepResult, createTestResult } from "./factory.js";
|
|
19
|
+
import { hasSkipLabel } from "./testplan.js";
|
|
19
20
|
import { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from "./utils.js";
|
|
20
21
|
import { buildAttachmentFileName } from "./utils/attachments.js";
|
|
21
22
|
import { resolveWriter } from "./writer/loader.js";
|
|
@@ -204,7 +205,7 @@ export class ReporterRuntime {
|
|
|
204
205
|
console.error("could not write test result: no test with uuid ".concat(uuid, " is found"));
|
|
205
206
|
return;
|
|
206
207
|
}
|
|
207
|
-
if (testResult.labels
|
|
208
|
+
if (hasSkipLabel(testResult.labels)) {
|
|
208
209
|
this.state.deleteTestResult(uuid);
|
|
209
210
|
return;
|
|
210
211
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","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","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","beforeTestResultStop","testCaseId","historyId","afterTestResultStop","testResults","labels","find","label","name","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","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","_classPrivateFieldInitSpec","updateFixture","displayName","parameters","rest","_objectWithoutProperties","_excluded","updateTest","linkConfig","Object","assign","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"],"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 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 type { Config, FixtureType, FixtureWrapper, LinkConfig, TestScope, Writer } 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\n constructor({ writer, listeners = [], environmentInfo, categories, links }: Config) {\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\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(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);\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 testResult = this.state.getTestResult(uuid);\n if (!testResult) {\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 this.notifier.beforeTestResultStop(testResult);\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\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.testResults.get(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 (testResult.labels.find((label) => label.name === \"ALLURE_TESTPLAN_SKIP\")) {\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.getFixtureResult(rootUuid);\n if (fixtureResult) {\n this.updateFixture(rootUuid, (result) => {\n if (message.displayName) {\n result.name = message.displayName;\n }\n });\n return;\n }\n\n const { links, labels, parameters, displayName, ...rest } = message;\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 Object.assign(result, rest);\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: FixtureWrapper) => {\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 = (start?: number, stop?: number, duration?: number): { start?: number; stop?: number } => {\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 result;\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,SAIEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AAEtF,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;MACxB,IAAI,CAACC,WAAW,CAACD,KAAK,CAAC,CAAC;IAC1B,CAAC;IAAAH,eAAA,qBAEaK,QAAgB,IAAW;MACvC,IAAMC,UAAU,GAAG,IAAI,CAACJ,WAAW,CAACK,GAAG,CAACF,QAAQ,CAAC;MACjD,IAAI,CAACH,WAAW,CAACM,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GAAGyG,kBAAkB;QACjD,CAAC,MAAM,IAAIrG,MAAM,CAACZ,KAAK,KAAKe,SAAS,EAAE;UACrCH,MAAM,CAACJ,IAAI,GAAGI,MAAM,CAACZ,KAAK,GAAGiH,kBAAkB;QACjD,CAAC,MAAM;UACLrG,MAAM,CAACJ,IAAI,GAAGP,IAAI,CAACC,GAAG,CAAC,CAAC;UACxBU,MAAM,CAACZ,KAAK,GAAGY,MAAM,CAACJ,IAAI,GAAGyG,kBAAkB;QACjD;MACF,CAAC,MAAM;QACL,IAAIrG,MAAM,CAACJ,IAAI,KAAKO,SAAS,EAAE;UAC7BH,MAAM,CAACJ,IAAI,GAAGP,IAAI,CAACC,GAAG,CAAC,CAAC;QAC1B;QACA,IAAIU,MAAM,CAACZ,KAAK,KAAKe,SAAS,EAAE;UAC9BH,MAAM,CAACZ,KAAK,GAAGY,MAAM,CAACJ,IAAI;QAC5B;MACF;MACA,OAAOI,MAAM;IACf,CAAC;IApeC,IAAI,CAACnC,MAAM,GAAGnC,aAAa,CAACmC,MAAM,CAAC;IACnC,IAAI,CAACwC,QAAQ,GAAG,IAAIrF,QAAQ,CAAC;MAAE8C;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAAC6G,UAAU,GAAG3G,MAAK;EACzB;AAgeF","ignoreList":[]}
|
|
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","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","beforeTestResultStop","testCaseId","historyId","afterTestResultStop","testResults","labels","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","updateFixture","displayName","parameters","rest","_objectWithoutProperties","_excluded","updateTest","linkConfig","Object","assign","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"],"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 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 { Config, FixtureType, FixtureWrapper, LinkConfig, TestScope, Writer } 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\n constructor({ writer, listeners = [], environmentInfo, categories, links }: Config) {\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\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(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);\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 testResult = this.state.getTestResult(uuid);\n if (!testResult) {\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 this.notifier.beforeTestResultStop(testResult);\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\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.testResults.get(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.getFixtureResult(rootUuid);\n if (fixtureResult) {\n this.updateFixture(rootUuid, (result) => {\n if (message.displayName) {\n result.name = message.displayName;\n }\n });\n return;\n }\n\n const { links, labels, parameters, displayName, ...rest } = message;\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 Object.assign(result, rest);\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: FixtureWrapper) => {\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 = (start?: number, stop?: number, duration?: number): { start?: number; stop?: number } => {\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 result;\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,SAIEC,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;AAE5C,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;MACxB,IAAI,CAACC,WAAW,CAACD,KAAK,CAAC,CAAC;IAC1B,CAAC;IAAAH,eAAA,qBAEaK,QAAgB,IAAW;MACvC,IAAMC,UAAU,GAAG,IAAI,CAACJ,WAAW,CAACK,GAAG,CAACF,QAAQ,CAAC;MACjD,IAAI,CAACH,WAAW,CAACM,MAAM,CAACH,QAAQ,CAAC;MACjC,IAAIC,UAAU,EAAE;QACdA,UAAU,CAACG,OAAO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G+G,kBAAkB;QACjD,CAAC,MAAM;UACLnG,MAAM,CAACJ,IAAI,GAAGP,IAAI,CAACC,GAAG,CAAC,CAAC;UACxBU,MAAM,CAACZ,KAAK,GAAGY,MAAM,CAACJ,IAAI,GAAGuG,kBAAkB;QACjD;MACF,CAAC,MAAM;QACL,IAAInG,MAAM,CAACJ,IAAI,KAAKO,SAAS,EAAE;UAC7BH,MAAM,CAACJ,IAAI,GAAGP,IAAI,CAACC,GAAG,CAAC,CAAC;QAC1B;QACA,IAAIU,MAAM,CAACZ,KAAK,KAAKe,SAAS,EAAE;UAC9BH,MAAM,CAACZ,KAAK,GAAGY,MAAM,CAACJ,IAAI;QAC5B;MACF;MACA,OAAOI,MAAM;IACf,CAAC;IApeC,IAAI,CAACnC,MAAM,GAAGnC,aAAa,CAACmC,MAAM,CAAC;IACnC,IAAI,CAACwC,QAAQ,GAAG,IAAItF,QAAQ,CAAC;MAAE+C;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAAC2G,UAAU,GAAGzG,MAAK;EACzB;AAgeF","ignoreList":[]}
|
|
@@ -34,4 +34,19 @@ export var includedInTestPlan = (testPlan, subject) => {
|
|
|
34
34
|
return idMatched || selectorMatched;
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
+
export var addSkipLabel = labels => {
|
|
38
|
+
labels.push({
|
|
39
|
+
name: "ALLURE_TESTPLAN_SKIP",
|
|
40
|
+
value: "true"
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export var addSkipLabelAsMeta = name => {
|
|
44
|
+
return "".concat(name, " @allure.label.ALLURE_TESTPLAN_SKIP:true");
|
|
45
|
+
};
|
|
46
|
+
export var hasSkipLabel = labels => labels.some(_ref => {
|
|
47
|
+
var {
|
|
48
|
+
name
|
|
49
|
+
} = _ref;
|
|
50
|
+
return name === "ALLURE_TESTPLAN_SKIP";
|
|
51
|
+
});
|
|
37
52
|
//# sourceMappingURL=testplan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testplan.js","names":["readFileSync","allureIdRegexp","parseTestPlan","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","undefined","file","testPlan","JSON","parse","tests","length","e","includedInTestPlan","subject","id","fullName","tags","effectiveId","map","tag","_tag$match","match","groups","find","maybeId","some","test","idMatched","String","selectorMatched","selector"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport type { TestPlanV1 } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as TestPlanV1;\n\n // Execute all tests if test plan is empty\n if ((testPlan.tests || []).length === 0) {\n return undefined;\n }\n\n return testPlan;\n } catch (e) {\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { id?: string; fullName?: string; tags?: string[] },\n): boolean => {\n const { id, fullName, tags = [] } = subject;\n const effectiveId =\n id ?? tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n return testPlan.tests.some((test) => {\n const idMatched = effectiveId && test.id ? String(test.id) === effectiveId : false;\n const selectorMatched = fullName && test.selector === fullName;\n\n return idMatched || selectorMatched;\n });\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"testplan.js","names":["readFileSync","allureIdRegexp","parseTestPlan","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","undefined","file","testPlan","JSON","parse","tests","length","e","includedInTestPlan","subject","id","fullName","tags","effectiveId","map","tag","_tag$match","match","groups","find","maybeId","some","test","idMatched","String","selectorMatched","selector","addSkipLabel","labels","push","name","value","addSkipLabelAsMeta","concat","hasSkipLabel","_ref"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport type { Label } from \"../../model.js\";\nimport type { TestPlanV1 } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as TestPlanV1;\n\n // Execute all tests if test plan is empty\n if ((testPlan.tests || []).length === 0) {\n return undefined;\n }\n\n return testPlan;\n } catch (e) {\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { id?: string; fullName?: string; tags?: string[] },\n): boolean => {\n const { id, fullName, tags = [] } = subject;\n const effectiveId =\n id ?? tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n return testPlan.tests.some((test) => {\n const idMatched = effectiveId && test.id ? String(test.id) === effectiveId : false;\n const selectorMatched = fullName && test.selector === fullName;\n\n return idMatched || selectorMatched;\n });\n};\n\nexport const addSkipLabel = (labels: Label[]) => {\n labels.push({ name: \"ALLURE_TESTPLAN_SKIP\", value: \"true\" });\n};\n\nexport const addSkipLabelAsMeta = (name: string) => {\n return `${name} @allure.label.ALLURE_TESTPLAN_SKIP:true`;\n};\n\nexport const hasSkipLabel = (labels: readonly Label[]) => labels.some(({ name }) => name === \"ALLURE_TESTPLAN_SKIP\");\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,SAAS;AAGtC,SAASC,cAAc,QAAQ,aAAa;AAE5C,OAAO,IAAMC,aAAa,GAAGA,CAAA,KAA8B;EACzD,IAAMC,YAAY,GAAGC,OAAO,CAACC,GAAG,CAACC,oBAAoB;EAErD,IAAI,CAACH,YAAY,EAAE;IACjB,OAA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OAAO,IAAME,YAAY,GAAIC,MAAe,IAAK;EAC/CA,MAAM,CAACC,IAAI,CAAC;IAAEC,IAAI,EAAE,sBAAsB;IAAEC,KAAK,EAAE;EAAO,CAAC,CAAC;AAC9D,CAAC;AAED,OAAO,IAAMC,kBAAkB,GAAIF,IAAY,IAAK;EAClD,UAAAG,MAAA,CAAUH,IAAI;AAChB,CAAC;AAED,OAAO,IAAMI,YAAY,GAAIN,MAAwB,IAAKA,MAAM,CAACP,IAAI,CAACc,IAAA;EAAA,IAAC;IAAEL;EAAK,CAAC,GAAAK,IAAA;EAAA,OAAKL,IAAI,KAAK,sBAAsB;AAAA,EAAC","ignoreList":[]}
|
package/dist/esm/sdk/utils.js
CHANGED
|
@@ -47,11 +47,11 @@ export var getMessageAndTraceFromError = error => {
|
|
|
47
47
|
trace: stack ? stripAnsi(stack) : undefined
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
export var allureIdRegexp = /*#__PURE__*/_wrapRegExp(
|
|
50
|
+
export var allureIdRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.id[:=]([^\s]+)/, {
|
|
51
51
|
id: 1
|
|
52
52
|
});
|
|
53
53
|
export var allureIdRegexpGlobal = new RegExp(allureIdRegexp, "g");
|
|
54
|
-
export var allureLabelRegexp = /*#__PURE__*/_wrapRegExp(
|
|
54
|
+
export var allureLabelRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.label\.([^:=\s]+)[:=]([^\s]+)/, {
|
|
55
55
|
name: 1,
|
|
56
56
|
value: 2
|
|
57
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["LabelName","Status","getStatusFromError","error","test","constructor","name","message","FAILED","BROKEN","ansiRegex","onlyFirst","arguments","length","undefined","pattern","join","RegExp","stripAnsi","str","regex","replace","getMessageAndTraceFromError","stack","trace","allureIdRegexp","_wrapRegExp","id","allureIdRegexpGlobal","allureLabelRegexp","value","allureLabelRegexpGlobal","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"],"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 } from \"./types.js\";\n\nexport const getStatusFromError = (error: 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 */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case /assert/gi.test(error.name):\n case /assert/gi.test(error.message):\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 = (\n error: Error | { message?: string; stack?: string },\n): Pick<StatusDetails, \"message\" | \"trace\"> => {\n const { message, stack } = error;\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\n };\n};\n\nexport const allureIdRegexp =
|
|
1
|
+
{"version":3,"file":"utils.js","names":["LabelName","Status","getStatusFromError","error","test","constructor","name","message","FAILED","BROKEN","ansiRegex","onlyFirst","arguments","length","undefined","pattern","join","RegExp","stripAnsi","str","regex","replace","getMessageAndTraceFromError","stack","trace","allureIdRegexp","_wrapRegExp","id","allureIdRegexpGlobal","allureLabelRegexp","value","allureLabelRegexpGlobal","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"],"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 } from \"./types.js\";\n\nexport const getStatusFromError = (error: 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 */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case /assert/gi.test(error.name):\n case /assert/gi.test(error.message):\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 = (\n error: Error | { message?: string; stack?: string },\n): Pick<StatusDetails, \"message\" | \"trace\"> => {\n const { message, stack } = error;\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\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 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"],"mappings":";;;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,aAAa;AAG/C,OAAO,IAAMC,kBAAkB,GAAIC,KAAY,IAAa;EAC1D,QAAQ,IAAI;IACV;AACJ;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,KAAK,UAAU,CAACF,IAAI,CAACD,KAAK,CAACG,IAAI,CAAC;IAChC,KAAK,UAAU,CAACF,IAAI,CAACD,KAAK,CAACI,OAAO,CAAC;MACjC,OAAON,MAAM,CAACO,MAAM;IACtB;MACE,OAAOP,MAAM,CAACQ,MAAM;EACxB;AACF,CAAC;;AAED;A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CAACnC,OAAO,CAAC;EAEpC,OAAO4D,GAAG;AACZ,CAAC,EAAE,EAAwB,CAAC;AAE9B,OAAO,IAAMG,0BAA0B,GAAIR,QAA0B,IAAK;EACxE,IAAMS,oBAAoB,GAAGN,oBAAoB,CAACH,QAAQ,CAAC;EAE3D,OAAOS,oBAAoB,CAACC,MAAM,CAAEnB,IAAI,IAAKA,IAAI,CAACxC,MAAM,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,OAAO,IAAM4D,SAAS,GAAaC,GAAQ,IACzC,CAAC,CAACA,GAAG,KAAK,OAAOA,GAAG,KAAK,QAAQ,IAAI,OAAOA,GAAG,KAAK,UAAU,CAAC,IAAI,OAAOA,GAAG,CAACC,IAAI,KAAK,UAAU","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Label } from "../../model.js";
|
|
1
2
|
import type { TestPlanV1 } from "../types.js";
|
|
2
3
|
export declare const parseTestPlan: () => TestPlanV1 | undefined;
|
|
3
4
|
export declare const includedInTestPlan: (testPlan: TestPlanV1, subject: {
|
|
@@ -5,3 +6,6 @@ export declare const includedInTestPlan: (testPlan: TestPlanV1, subject: {
|
|
|
5
6
|
fullName?: string;
|
|
6
7
|
tags?: string[];
|
|
7
8
|
}) => boolean;
|
|
9
|
+
export declare const addSkipLabel: (labels: Label[]) => void;
|
|
10
|
+
export declare const addSkipLabelAsMeta: (name: string) => string;
|
|
11
|
+
export declare const hasSkipLabel: (labels: readonly Label[]) => boolean;
|
|
@@ -24,4 +24,4 @@ export declare const hasLabel: (testResult: TestResult, labelName: LabelName | s
|
|
|
24
24
|
export declare const hasStepMessage: (messages: RuntimeMessage[]) => boolean;
|
|
25
25
|
export declare const getStepsMessagesPair: (messages: RuntimeMessage[]) => RuntimeMessage[][];
|
|
26
26
|
export declare const getUnfinishedStepsMessages: (messages: RuntimeMessage[]) => RuntimeMessage[][];
|
|
27
|
-
export declare const isPromise: (obj: any) =>
|
|
27
|
+
export declare const isPromise: <T = any>(obj: any) => obj is PromiseLike<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure-js-commons",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.7",
|
|
4
4
|
"description": "Allure JS Commons",
|
|
5
5
|
"homepage": "https://allurereport.org/",
|
|
6
6
|
"repository": {
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"eslint-plugin-no-null": "^1.0.2",
|
|
83
83
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
84
84
|
"npm-run-all2": "^6.1.2",
|
|
85
|
-
"rimraf": "^
|
|
85
|
+
"rimraf": "^6.0.0",
|
|
86
86
|
"typescript": "^5.2.2",
|
|
87
87
|
"vitest": "^1.6.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"allure-playwright": "3.0.0-beta.
|
|
90
|
+
"allure-playwright": "3.0.0-beta.7"
|
|
91
91
|
},
|
|
92
92
|
"peerDependenciesMeta": {
|
|
93
93
|
"allure-playwright": {
|