allure-js-commons 3.0.7 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/model.js.map +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +5 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/types.js.map +1 -1
- package/dist/cjs/sdk/utils.js +14 -2
- package/dist/cjs/sdk/utils.js.map +1 -1
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +5 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/types.js.map +1 -1
- package/dist/esm/sdk/utils.js +14 -2
- package/dist/esm/sdk/utils.js.map +1 -1
- package/dist/types/model.d.ts +2 -0
- package/dist/types/sdk/reporter/ReporterRuntime.d.ts +3 -2
- package/dist/types/sdk/reporter/types.d.ts +1 -0
- package/dist/types/sdk/utils.d.ts +1 -1
- package/package.json +3 -3
package/dist/cjs/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":["Status","exports","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"model.js","names":["Status","exports","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n actual?: string;\n expected?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":";;;;;;AAyCA;AAsCA;AAAA,IACYA,MAAM,GAAAC,OAAA,CAAAD,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAOX,IAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,CAACF,MAAM,CAACG,MAAM,EAAEH,MAAM,CAACI,MAAM,EAAEJ,MAAM,CAACK,MAAM,EAAEL,MAAM,CAACM,OAAO,CAAC;;AAE7F;AAAA,IACYC,KAAK,GAAAN,OAAA,CAAAM,KAAA,0BAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA;AAQjB;AAAA,IACYC,SAAS,GAAAP,OAAA,CAAAO,SAAA,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AA0BrB;AAAA,IACYC,QAAQ,GAAAR,OAAA,CAAAQ,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAQpB;AAAA,IACYC,WAAW,GAAAT,OAAA,CAAAS,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAkBvB;AAAA,IACYC,QAAQ,GAAAV,OAAA,CAAAU,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
|
@@ -85,7 +85,8 @@ class ReporterRuntime {
|
|
|
85
85
|
listeners = [],
|
|
86
86
|
environmentInfo,
|
|
87
87
|
categories,
|
|
88
|
-
links: _links
|
|
88
|
+
links: _links,
|
|
89
|
+
globalLabels
|
|
89
90
|
} = _ref;
|
|
90
91
|
_defineProperty(this, "state", new _LifecycleState.LifecycleState());
|
|
91
92
|
_defineProperty(this, "notifier", void 0);
|
|
@@ -94,6 +95,7 @@ class ReporterRuntime {
|
|
|
94
95
|
_defineProperty(this, "categories", void 0);
|
|
95
96
|
_defineProperty(this, "environmentInfo", void 0);
|
|
96
97
|
_defineProperty(this, "linkConfig", void 0);
|
|
98
|
+
_defineProperty(this, "globalLabels", []);
|
|
97
99
|
_defineProperty(this, "startScope", () => {
|
|
98
100
|
var uuid = (0, _utils.randomUuid)();
|
|
99
101
|
this.state.setScope(uuid);
|
|
@@ -220,6 +222,7 @@ class ReporterRuntime {
|
|
|
220
222
|
testResult.descriptionHtml = (_testResult$descripti2 = testResult.descriptionHtml) !== null && _testResult$descripti2 !== void 0 ? _testResult$descripti2 : scope.descriptionHtml;
|
|
221
223
|
}
|
|
222
224
|
});
|
|
225
|
+
testResult.labels = [...this.globalLabels, ...testResult.labels];
|
|
223
226
|
this.notifier.afterTestResultStop(testResult);
|
|
224
227
|
});
|
|
225
228
|
_defineProperty(this, "writeTest", uuid => {
|
|
@@ -587,6 +590,7 @@ class ReporterRuntime {
|
|
|
587
590
|
this.categories = categories;
|
|
588
591
|
this.environmentInfo = environmentInfo;
|
|
589
592
|
this.linkConfig = _links;
|
|
593
|
+
this.globalLabels = globalLabels !== null && globalLabels !== void 0 ? globalLabels : [];
|
|
590
594
|
}
|
|
591
595
|
}
|
|
592
596
|
exports.ReporterRuntime = ReporterRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["_path","require","_model","_LifecycleState","_Notifier","_factory","_testplan","_utils","_attachments","_loader","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","set","has","TypeError","_classPrivateFieldGet","s","get","_assertClassBrand","n","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","DefaultStepStack","constructor","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","LifecycleState","uuid","randomUuid","state","setScope","updateFunc","scope","getScope","console","error","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","Stage","FINISHED","result","scopeUuids","undefined","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","createStepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","extname","attachmentFileName","buildAttachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","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 {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\ninterface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\nclass DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n\n constructor({ writer, listeners = [], environmentInfo, categories, links }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n 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 const scopeUuids = wrapped.scopeUuids;\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (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 {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAmBA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AASA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAmD,SAAAS,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,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L,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,OAAO;QACLR,KAAK,EAAEa,MAAM,CAACb,KAAK,GAAGyH,IAAI,CAACE,KAAK,CAAC9G,MAAM,CAACb,KAAK,CAAC,GAAGe,SAAS;QAC1DP,IAAI,EAAEK,MAAM,CAACL,IAAI,GAAGiH,IAAI,CAACE,KAAK,CAAC9G,MAAM,CAACL,IAAI,CAAC,GAAGO;MAChD,CAAC;IACH,CAAC;IAhjBC,IAAI,CAACtC,MAAM,GAAG,IAAAmJ,qBAAa,EAACnJ,MAAM,CAAC;IACnC,IAAI,CAAC0C,QAAQ,GAAG,IAAI0G,kBAAQ,CAAC;MAAEnJ;IAAU,CAAC,CAAC;IAC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACqH,UAAU,GAAGnH,MAAK;EACzB;AA4iBF;AAACiJ,OAAA,CAAAxJ,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReporterRuntime.js","names":["_path","require","_model","_LifecycleState","_Notifier","_factory","_testplan","_utils","_attachments","_loader","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","set","has","TypeError","_classPrivateFieldGet","s","get","_assertClassBrand","n","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","DefaultStepStack","constructor","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","uuid","randomUuid","state","setScope","updateFunc","scope","getScope","console","error","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","Stage","FINISHED","result","scopeUuids","undefined","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","createStepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","extname","attachmentFileName","buildAttachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","exports"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\ninterface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\nclass DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({ writer, listeners = [], environmentInfo, categories, links, globalLabels }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n this.globalLabels = globalLabels ?? [];\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAoBA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AASA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAmD,SAAAS,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA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AC3C,IAAI,CAACE,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACD,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACsH,UAAU,GAAGpH,MAAK;IACvB,IAAI,CAACC,YAAY,GAAGA,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAE;EACxC;AA6jBF;AAACiJ,OAAA,CAAAzJ,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","exports","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Label,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":";;;;;;AAYO,IAAMA,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,sCAAsC;AAC3E,IAAME,mCAAmC,GAAAD,OAAA,CAAAC,mCAAA,GAAG,qCAAqC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","exports","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Label,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly globalLabels?: Label[];\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":";;;;;;AAYO,IAAMA,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,sCAAsC;AAC3E,IAAME,mCAAmC,GAAAD,OAAA,CAAAC,mCAAA,GAAG,qCAAqC","ignoreList":[]}
|
package/dist/cjs/sdk/utils.js
CHANGED
|
@@ -8,6 +8,11 @@ var _model = require("../model.js");
|
|
|
8
8
|
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
9
9
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
10
10
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
16
|
var getStatusFromError = error => {
|
|
12
17
|
switch (true) {
|
|
13
18
|
/**
|
|
@@ -23,6 +28,7 @@ var getStatusFromError = error => {
|
|
|
23
28
|
case error.stack && /@vitest\/expect/gi.test(error.stack):
|
|
24
29
|
case error.stack && /playwright\/lib\/matchers\/expect\.js/gi.test(error.stack):
|
|
25
30
|
case "matcherResult" in error:
|
|
31
|
+
case "inspect" in error && typeof error.inspect === "function":
|
|
26
32
|
return _model.Status.FAILED;
|
|
27
33
|
default:
|
|
28
34
|
return _model.Status.BROKEN;
|
|
@@ -54,10 +60,16 @@ var getMessageAndTraceFromError = error => {
|
|
|
54
60
|
message,
|
|
55
61
|
stack
|
|
56
62
|
} = error;
|
|
57
|
-
|
|
63
|
+
var actual = "actual" in error && error.actual !== undefined ? {
|
|
64
|
+
actual: serialize(error.actual)
|
|
65
|
+
} : {};
|
|
66
|
+
var expected = "expected" in error && error.expected !== undefined ? {
|
|
67
|
+
expected: serialize(error.expected)
|
|
68
|
+
} : {};
|
|
69
|
+
return _objectSpread(_objectSpread({
|
|
58
70
|
message: message ? stripAnsi(message) : undefined,
|
|
59
71
|
trace: stack ? stripAnsi(stack) : undefined
|
|
60
|
-
};
|
|
72
|
+
}, actual), expected);
|
|
61
73
|
};
|
|
62
74
|
exports.getMessageAndTraceFromError = getMessageAndTraceFromError;
|
|
63
75
|
var allureIdRegexp = exports.allureIdRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.id[:=]([^\s]+)/, {
|
|
@@ -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","stack","Status","FAILED","BROKEN","exports","ansiRegex","onlyFirst","undefined","pattern","stripAnsi","str","regex","getMessageAndTraceFromError","trace","allureIdRegexp","id","allureIdRegexpGlobal","allureLabelRegexp","allureLabelRegexpGlobal","isMetadataTag","tag","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","serialize","maxDepth","maxLength","replacer","limitString","JSON","stringify","createSerializeReplacer","String","userDefinedReplacer","parents","limitingReplacer","_","is","at","pop","includes","Map","excludeCircularRefsFromMap","Set","excludeCircularRefsFromSet","composeReplacers","first","second","k","v","map","from","_ref","_ref2","concat","substring"],"sources":["../../../src/sdk/utils.ts"],"sourcesContent":["import type { FixtureResult, Label, StatusDetails, StepResult, TestResult } from \"../model.js\";\nimport { LabelName, Status } from \"../model.js\";\nimport type { RuntimeMessage, SerializeOptions, SerializerReplacerFunc } from \"./types.js\";\n\nexport const getStatusFromError = (error: Partial<Error>): Status => {\n switch (true) {\n /**\n * Native `node:assert` and `chai` (`vitest` uses it under the hood) throw `AssertionError`\n * `jest` throws `JestAssertionError` instance\n * `jasmine` throws `ExpectationFailed` instance\n * `vitest` throws `Error` for extended assertions, so we look into stack\n */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case error.name && /assert/gi.test(error.name):\n case error.message && /assert/gi.test(error.message):\n case error.stack && /@vitest\\/expect/gi.test(error.stack):\n case error.stack && /playwright\\/lib\\/matchers\\/expect\\.js/gi.test(error.stack):\n case \"matcherResult\" in error:\n 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 isMetadataTag = (tag: string) => {\n return allureIdRegexp.test(tag) || allureLabelRegexp.test(tag);\n};\n\nexport const extractMetadataFromString = (\n title: string,\n): {\n labels: Label[];\n cleanTitle: string;\n} => {\n const labels = [] as Label[];\n\n title.split(\" \").forEach((val) => {\n const idValue = val.match(allureIdRegexp)?.groups?.id;\n\n if (idValue) {\n labels.push({ name: LabelName.ALLURE_ID, value: idValue });\n }\n\n const labelMatch = val.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n labels?.push({ name, value });\n }\n });\n\n const cleanTitle = title.replace(allureLabelRegexpGlobal, \"\").replace(allureIdRegexpGlobal, \"\").trim();\n\n return { labels, cleanTitle };\n};\n\nexport const isAnyStepFailed = (item: StepResult | TestResult | FixtureResult): boolean => {\n const isFailed = item.status === Status.FAILED;\n\n if (isFailed || item.steps.length === 0) {\n return isFailed;\n }\n\n return !!item.steps.find((step) => isAnyStepFailed(step));\n};\n\nexport const isAllStepsEnded = (item: StepResult | TestResult | FixtureResult): boolean => {\n return item.steps.every((val) => val.stop && isAllStepsEnded(val));\n};\n\nexport const hasLabel = (testResult: TestResult, labelName: LabelName | string): boolean => {\n return !!testResult.labels.find((l) => l.name === labelName);\n};\n\nexport const hasStepMessage = (messages: RuntimeMessage[]) => {\n return messages.some((message) => message.type === \"step_start\" || message.type === \"step_stop\");\n};\n\nexport const getStepsMessagesPair = (messages: RuntimeMessage[]) =>\n messages.reduce((acc, message) => {\n if (message.type !== \"step_start\" && message.type !== \"step_stop\") {\n return acc;\n }\n\n if (message.type === \"step_start\") {\n acc.push([message]);\n\n return acc;\n }\n\n const unfinishedStepIdx = acc.findLastIndex((step) => step.length === 1);\n\n if (unfinishedStepIdx === -1) {\n return acc;\n }\n\n acc[unfinishedStepIdx].push(message);\n\n return acc;\n }, [] as RuntimeMessage[][]);\n\nexport const getUnfinishedStepsMessages = (messages: RuntimeMessage[]) => {\n const grouppedStepsMessage = getStepsMessagesPair(messages);\n\n return grouppedStepsMessage.filter((step) => step.length === 1);\n};\n\nexport const isPromise = <T = any>(obj: any): obj is PromiseLike<T> =>\n !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n\nexport const serialize = (value: any, { maxDepth = 0, maxLength = 0, replacer }: SerializeOptions = {}): string =>\n limitString(\n typeof value === \"object\" ? JSON.stringify(value, createSerializeReplacer(maxDepth, replacer)) : String(value),\n maxLength,\n );\n\nconst createSerializeReplacer = (maxDepth: number, userDefinedReplacer: SerializeOptions[\"replacer\"]) => {\n const parents: unknown[] = [];\n const limitingReplacer = function (this: unknown, _: string, value: unknown) {\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n while (parents.length > 0 && !Object.is(parents.at(-1), this)) {\n parents.pop();\n }\n\n if ((maxDepth && parents.length >= maxDepth) || parents.includes(value)) {\n return undefined;\n }\n\n parents.push(value);\n\n return value instanceof Map\n ? excludeCircularRefsFromMap(parents, value)\n : value instanceof Set\n ? excludeCircularRefsFromSet(parents, value)\n : value;\n };\n return userDefinedReplacer ? composeReplacers(userDefinedReplacer, limitingReplacer) : limitingReplacer;\n};\n\nconst composeReplacers = (first: SerializerReplacerFunc, second: SerializerReplacerFunc): SerializerReplacerFunc =>\n function (k, v) {\n return second.call(this, k, first.call(this, k, v));\n };\n\nconst excludeCircularRefsFromMap = (parents: any[], map: Map<any, any>) => {\n return Array.from(map)\n .filter(([k]) => !parents.includes(k))\n .map(([k, v]) => [k, parents.includes(v) ? undefined : v]);\n};\n\nconst excludeCircularRefsFromSet = (parents: any[], set: Set<any>) => {\n return Array.from(set).map((v) => (parents.includes(v) ? undefined : v));\n};\n\nconst limitString = (value: string, maxLength: number) =>\n maxLength && value.length > maxLength ? `${value.substring(0, maxLength)}...` : value;\n"],"mappings":";;;;;;AACA,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,C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AAE6E,SAAiB,KACnDA,SAAS,IAAI7E,KAAK,CAAClB,MAAM,GAAG+F,SAAS,MAAA4B,MAAA,CAAMzG,KAAK,CAAC0G,SAAS,CAAC,CAAC,EAAE7B,SAAS,CAAC,WAAQ7E,KAAK","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__","ownKeys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","_toPrimitive","toPrimitive","String","Number","getStatusFromError","error","test","name","message","stack","inspect","Status","FAILED","BROKEN","exports","ansiRegex","onlyFirst","undefined","pattern","stripAnsi","str","regex","getMessageAndTraceFromError","actual","serialize","expected","trace","allureIdRegexp","id","allureIdRegexpGlobal","allureLabelRegexp","allureLabelRegexpGlobal","isMetadataTag","tag","extractMetadataFromString","title","labels","split","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","isPromise","obj","then","maxDepth","maxLength","replacer","limitString","JSON","stringify","createSerializeReplacer","userDefinedReplacer","parents","limitingReplacer","_","is","at","pop","includes","Map","excludeCircularRefsFromMap","Set","excludeCircularRefsFromSet","composeReplacers","first","second","k","v","map","from","_ref","_ref2","concat","substring"],"sources":["../../../src/sdk/utils.ts"],"sourcesContent":["import type { FixtureResult, Label, StatusDetails, StepResult, TestResult } from \"../model.js\";\nimport { LabelName, Status } from \"../model.js\";\nimport type { RuntimeMessage, SerializeOptions, SerializerReplacerFunc } from \"./types.js\";\n\nexport const getStatusFromError = (error: Partial<Error>): Status => {\n switch (true) {\n /**\n * Native `node:assert` and `chai` (`vitest` uses it under the hood) throw `AssertionError`\n * `jest` throws `JestAssertionError` instance\n * `jasmine` throws `ExpectationFailed` instance\n * `vitest` throws `Error` for extended assertions, so we look into stack\n */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case error.name && /assert/gi.test(error.name):\n case error.message && /assert/gi.test(error.message):\n case error.stack && /@vitest\\/expect/gi.test(error.stack):\n case error.stack && /playwright\\/lib\\/matchers\\/expect\\.js/gi.test(error.stack):\n case \"matcherResult\" in error:\n case \"inspect\" in error && typeof error.inspect === \"function\":\n return Status.FAILED;\n default:\n return Status.BROKEN;\n }\n};\n\n/**\n * Source: https://github.com/chalk/ansi-regex\n */\nconst ansiRegex = ({ onlyFirst = false } = {}) => {\n const pattern = [\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\n \"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\",\n ].join(\"|\");\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n\n/**\n * https://github.com/chalk/strip-ansi\n */\nexport const stripAnsi = (str: string): string => {\n const regex = ansiRegex();\n return str.replace(regex, \"\");\n};\n\nexport const getMessageAndTraceFromError = (error: Error | { message?: string; stack?: string }): StatusDetails => {\n const { message, stack } = error;\n const actual = \"actual\" in error && error.actual !== undefined ? { actual: serialize(error.actual) } : {};\n const expected = \"expected\" in error && error.expected !== undefined ? { expected: serialize(error.expected) } : {};\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\n ...actual,\n ...expected,\n };\n};\n\nexport const allureIdRegexp = /(?:^|\\s)@?allure\\.id[:=](?<id>[^\\s]+)/;\nexport const allureIdRegexpGlobal = new RegExp(allureIdRegexp, \"g\");\nexport const allureLabelRegexp = /(?:^|\\s)@?allure\\.label\\.(?<name>[^:=\\s]+)[:=](?<value>[^\\s]+)/;\nexport const allureLabelRegexpGlobal = new RegExp(allureLabelRegexp, \"g\");\n\nexport const isMetadataTag = (tag: string) => {\n return allureIdRegexp.test(tag) || allureLabelRegexp.test(tag);\n};\n\nexport const extractMetadataFromString = (\n title: string,\n): {\n labels: Label[];\n cleanTitle: string;\n} => {\n const labels = [] as Label[];\n\n title.split(\" \").forEach((val) => {\n const idValue = val.match(allureIdRegexp)?.groups?.id;\n\n if (idValue) {\n labels.push({ name: LabelName.ALLURE_ID, value: idValue });\n }\n\n const labelMatch = val.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n labels?.push({ name, value });\n }\n });\n\n const cleanTitle = title.replace(allureLabelRegexpGlobal, \"\").replace(allureIdRegexpGlobal, \"\").trim();\n\n return { labels, cleanTitle };\n};\n\nexport const isAnyStepFailed = (item: StepResult | TestResult | FixtureResult): boolean => {\n const isFailed = item.status === Status.FAILED;\n\n if (isFailed || item.steps.length === 0) {\n return isFailed;\n }\n\n return !!item.steps.find((step) => isAnyStepFailed(step));\n};\n\nexport const isAllStepsEnded = (item: StepResult | TestResult | FixtureResult): boolean => {\n return item.steps.every((val) => val.stop && isAllStepsEnded(val));\n};\n\nexport const hasLabel = (testResult: TestResult, labelName: LabelName | string): boolean => {\n return !!testResult.labels.find((l) => l.name === labelName);\n};\n\nexport const hasStepMessage = (messages: RuntimeMessage[]) => {\n return messages.some((message) => message.type === \"step_start\" || message.type === \"step_stop\");\n};\n\nexport const getStepsMessagesPair = (messages: RuntimeMessage[]) =>\n messages.reduce((acc, message) => {\n if (message.type !== \"step_start\" && message.type !== \"step_stop\") {\n return acc;\n }\n\n if (message.type === \"step_start\") {\n acc.push([message]);\n\n return acc;\n }\n\n const unfinishedStepIdx = acc.findLastIndex((step) => step.length === 1);\n\n if (unfinishedStepIdx === -1) {\n return acc;\n }\n\n acc[unfinishedStepIdx].push(message);\n\n return acc;\n }, [] as RuntimeMessage[][]);\n\nexport const getUnfinishedStepsMessages = (messages: RuntimeMessage[]) => {\n const grouppedStepsMessage = getStepsMessagesPair(messages);\n\n return grouppedStepsMessage.filter((step) => step.length === 1);\n};\n\nexport const isPromise = <T = any>(obj: any): obj is PromiseLike<T> =>\n !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n\nexport const serialize = (value: any, { maxDepth = 0, maxLength = 0, replacer }: SerializeOptions = {}): string =>\n limitString(\n typeof value === \"object\" ? JSON.stringify(value, createSerializeReplacer(maxDepth, replacer)) : String(value),\n maxLength,\n );\n\nconst createSerializeReplacer = (maxDepth: number, userDefinedReplacer: SerializeOptions[\"replacer\"]) => {\n const parents: unknown[] = [];\n const limitingReplacer = function (this: unknown, _: string, value: unknown) {\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n while (parents.length > 0 && !Object.is(parents.at(-1), this)) {\n parents.pop();\n }\n\n if ((maxDepth && parents.length >= maxDepth) || parents.includes(value)) {\n return undefined;\n }\n\n parents.push(value);\n\n return value instanceof Map\n ? excludeCircularRefsFromMap(parents, value)\n : value instanceof Set\n ? excludeCircularRefsFromSet(parents, value)\n : value;\n };\n return userDefinedReplacer ? composeReplacers(userDefinedReplacer, limitingReplacer) : limitingReplacer;\n};\n\nconst composeReplacers = (first: SerializerReplacerFunc, second: SerializerReplacerFunc): SerializerReplacerFunc =>\n function (k, v) {\n return second.call(this, k, first.call(this, k, v));\n };\n\nconst excludeCircularRefsFromMap = (parents: any[], map: Map<any, any>) => {\n return Array.from(map)\n .filter(([k]) => !parents.includes(k))\n .map(([k, v]) => [k, parents.includes(v) ? undefined : v]);\n};\n\nconst excludeCircularRefsFromSet = (parents: any[], set: Set<any>) => {\n return Array.from(set).map((v) => (parents.includes(v) ? undefined : v));\n};\n\nconst limitString = (value: string, maxLength: number) =>\n maxLength && value.length > maxLength ? `${value.substring(0, maxLength)}...` : value;\n"],"mappings":";;;;;;AACA,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,CA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,EAAEgI,CAAC,EAAEF,KAAK,CAAC9H,IAAI,CAAC,IAAI,EAAEgI,CAAC,EAAEC,CAAC,CAAC,CAAC;AACrD,CAAC;AAEH,IAAMP,0BAA0B,GAAGA,CAACR,OAAc,EAAEgB,GAAkB,KAAK;EACzE,OAAO7H,KAAK,CAAC8H,IAAI,CAACD,GAAG,CAAC,CACnB3G,MAAM,CAAC6G,IAAA;IAAA,IAAC,CAACJ,CAAC,CAAC,GAAAI,IAAA;IAAA,OAAK,CAAClB,OAAO,CAACM,QAAQ,CAACQ,CAAC,CAAC;EAAA,EAAC,CACrCE,GAAG,CAACG,KAAA;IAAA,IAAC,CAACL,CAAC,EAAEC,CAAC,CAAC,GAAAI,KAAA;IAAA,OAAK,CAACL,CAAC,EAAEd,OAAO,CAACM,QAAQ,CAACS,CAAC,CAAC,GAAGhF,SAAS,GAAGgF,CAAC,CAAC;EAAA,EAAC;AAC9D,CAAC;AAED,IAAML,0BAA0B,GAAGA,CAACV,OAAc,EAAE9H,GAAa,KAAK;EACpE,OAAOiB,KAAK,CAAC8H,IAAI,CAAC/I,GAAG,CAAC,CAAC8I,GAAG,CAAED,CAAC,IAAMf,OAAO,CAACM,QAAQ,CAACS,CAAC,CAAC,GAAGhF,SAAS,GAAGgF,CAAE,CAAC;AAC1E,CAAC;AAED,IAAMpB,WAAW,GAAGA,CAAC/F,KAAa,EAAE6F,SAAiB,KACnDA,SAAS,IAAI7F,KAAK,CAAClB,MAAM,GAAG+G,SAAS,MAAA2B,MAAA,CAAMxH,KAAK,CAACyH,SAAS,CAAC,CAAC,EAAE5B,SAAS,CAAC,WAAQ7F,KAAK","ignoreList":[]}
|
package/dist/esm/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":["Status","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"model.js","names":["Status","StatusByPriority","FAILED","BROKEN","PASSED","SKIPPED","Stage","LabelName","Severity","ContentType","LinkType"],"sources":["../../src/model.ts"],"sourcesContent":["export interface Attachment {\n name: string;\n type?: string;\n source: string;\n}\n\nexport interface AttachmentOptions {\n contentType: ContentType | string;\n encoding?: BufferEncoding;\n fileExtension?: string;\n}\n\nexport interface Label {\n name: LabelName | string;\n value: string;\n}\n\nexport interface Link {\n name?: string;\n url: string;\n type?: LinkType | string;\n}\n\nexport type ParameterMode = \"hidden\" | \"masked\" | \"default\";\n\nexport interface Parameter {\n name: string;\n value: string;\n excluded?: boolean;\n mode?: ParameterMode;\n}\n\nexport type ParameterOptions = Pick<Parameter, \"mode\" | \"excluded\">;\n\nexport interface StatusDetails {\n message?: string;\n trace?: string;\n actual?: string;\n expected?: string;\n}\n\n// don't use the interface as is, use Results types instead\ninterface Executable {\n name?: string;\n status?: Status;\n statusDetails: StatusDetails;\n stage: Stage;\n description?: string;\n descriptionHtml?: string;\n steps: StepResult[];\n attachments: Attachment[];\n parameters: Parameter[];\n start?: number;\n stop?: number;\n}\n\nexport interface FixtureResult extends Executable {}\n\nexport interface StepResult extends Executable {}\n\nexport interface TestResult extends Executable {\n uuid: string;\n historyId?: string;\n fullName?: string;\n testCaseId?: string;\n labels: Label[];\n links: Link[];\n}\n\nexport interface TestResultContainer {\n uuid: string;\n name?: string;\n children: string[];\n befores: FixtureResult[];\n afters: FixtureResult[];\n}\n\nexport type TestOrStepResult = StepResult | TestResult;\n\n/* eslint-disable no-shadow */\nexport enum Status {\n FAILED = \"failed\",\n BROKEN = \"broken\",\n PASSED = \"passed\",\n SKIPPED = \"skipped\",\n}\n\nexport const StatusByPriority = [Status.FAILED, Status.BROKEN, Status.PASSED, Status.SKIPPED];\n\n/* eslint-disable no-shadow */\nexport enum Stage {\n SCHEDULED = \"scheduled\",\n RUNNING = \"running\",\n FINISHED = \"finished\",\n PENDING = \"pending\",\n INTERRUPTED = \"interrupted\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LabelName {\n ALLURE_ID = \"ALLURE_ID\",\n /**\n * @deprecated please use ALLURE_ID instead\n */\n AS_ID = ALLURE_ID,\n SUITE = \"suite\",\n PARENT_SUITE = \"parentSuite\",\n SUB_SUITE = \"subSuite\",\n EPIC = \"epic\",\n FEATURE = \"feature\",\n STORY = \"story\",\n SEVERITY = \"severity\",\n TAG = \"tag\",\n OWNER = \"owner\",\n LEAD = \"lead\",\n HOST = \"host\",\n THREAD = \"thread\",\n TEST_METHOD = \"testMethod\",\n TEST_CLASS = \"testClass\",\n PACKAGE = \"package\",\n FRAMEWORK = \"framework\",\n LANGUAGE = \"language\",\n LAYER = \"layer\",\n}\n\n/* eslint-disable no-shadow */\nexport enum Severity {\n BLOCKER = \"blocker\",\n CRITICAL = \"critical\",\n NORMAL = \"normal\",\n MINOR = \"minor\",\n TRIVIAL = \"trivial\",\n}\n\n/* eslint-disable no-shadow */\nexport enum ContentType {\n TEXT = \"text/plain\",\n XML = \"application/xml\",\n HTML = \"text/html\",\n CSV = \"text/csv\",\n TSV = \"text/tab-separated-values\",\n CSS = \"text/css\",\n URI = \"text/uri-list\",\n SVG = \"image/svg+xml\",\n PNG = \"image/png\",\n JSON = \"application/json\",\n ZIP = \"application/zip\",\n WEBM = \"video/webm\",\n JPEG = \"image/jpeg\",\n MP4 = \"video/mp4\",\n IMAGEDIFF = \"application/vnd.allure.image.diff\",\n}\n\n/* eslint-disable no-shadow */\nexport enum LinkType {\n DEFAULT = \"link\",\n ISSUE = \"issue\",\n TMS = \"tms\",\n}\n\nexport interface ImageDiffAttachment {\n expected: string | undefined; // data:image;base64,\n actual: string | undefined; // data:image;base64,\n diff: string | undefined; // data:image;base64,\n name: string;\n}\n"],"mappings":"AAyCA;;AAsCA;AACA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAOlB,OAAO,IAAMC,gBAAgB,GAAG,CAACD,MAAM,CAACE,MAAM,EAAEF,MAAM,CAACG,MAAM,EAAEH,MAAM,CAACI,MAAM,EAAEJ,MAAM,CAACK,OAAO,CAAC;;AAE7F;AACA,WAAYC,KAAK,0BAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA;;AAQjB;AACA,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AA0BrB;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;;AAQpB;AACA,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAkBvB;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
|
@@ -80,7 +80,8 @@ export class ReporterRuntime {
|
|
|
80
80
|
listeners = [],
|
|
81
81
|
environmentInfo,
|
|
82
82
|
categories,
|
|
83
|
-
links: _links
|
|
83
|
+
links: _links,
|
|
84
|
+
globalLabels
|
|
84
85
|
} = _ref;
|
|
85
86
|
_defineProperty(this, "state", new LifecycleState());
|
|
86
87
|
_defineProperty(this, "notifier", void 0);
|
|
@@ -89,6 +90,7 @@ export class ReporterRuntime {
|
|
|
89
90
|
_defineProperty(this, "categories", void 0);
|
|
90
91
|
_defineProperty(this, "environmentInfo", void 0);
|
|
91
92
|
_defineProperty(this, "linkConfig", void 0);
|
|
93
|
+
_defineProperty(this, "globalLabels", []);
|
|
92
94
|
_defineProperty(this, "startScope", () => {
|
|
93
95
|
var uuid = randomUuid();
|
|
94
96
|
this.state.setScope(uuid);
|
|
@@ -215,6 +217,7 @@ export class ReporterRuntime {
|
|
|
215
217
|
testResult.descriptionHtml = (_testResult$descripti2 = testResult.descriptionHtml) !== null && _testResult$descripti2 !== void 0 ? _testResult$descripti2 : scope.descriptionHtml;
|
|
216
218
|
}
|
|
217
219
|
});
|
|
220
|
+
testResult.labels = [...this.globalLabels, ...testResult.labels];
|
|
218
221
|
this.notifier.afterTestResultStop(testResult);
|
|
219
222
|
});
|
|
220
223
|
_defineProperty(this, "writeTest", uuid => {
|
|
@@ -582,6 +585,7 @@ export class ReporterRuntime {
|
|
|
582
585
|
this.categories = categories;
|
|
583
586
|
this.environmentInfo = environmentInfo;
|
|
584
587
|
this.linkConfig = _links;
|
|
588
|
+
this.globalLabels = globalLabels !== null && globalLabels !== void 0 ? globalLabels : [];
|
|
585
589
|
}
|
|
586
590
|
}
|
|
587
591
|
//# sourceMappingURL=ReporterRuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","DefaultStepStack","constructor","_defineProperty","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","length","set","push","removeStep","newValue","filter","value","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","uuid","state","setScope","updateFunc","scope","getScope","console","error","concat","_classPrivateFieldGet","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","_objectSpread","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","FINISHED","result","scopeUuids","arguments","undefined","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","testCaseId","historyId","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","attachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","_classPrivateFieldInitSpec","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\ninterface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\nclass DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n\n constructor({ writer, listeners = [], environmentInfo, categories, links }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n 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 const scopeUuids = wrapped.scopeUuids;\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (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 {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,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;AAS5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAChH,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAclD,MAAMC,gBAAgB,CAAsB;EAAAC,YAAA;IAAAC,eAAA,sBACG,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,sBACX,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,gBAE5C,MAAY;MAClB,IAAI,CAACE,WAAW,CAACC,KAAK,CAAC,CAAC;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,CAAEC,QAAQ,IAAK,IAAI,CAACN,WAAW,CAACI,MAAM,CAACE,QAAQ,CAAC,CAAC;MACrE;IACF,CAAC;IAAAV,eAAA,sBAEcK,QAAgB,IAAyB;MACtD,IAAMC,UAAU,GAAG,IAAI,CAACJ,WAAW,CAACK,GAAG,CAACF,QAAQ,CA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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,OAAO;QACLR,KAAK,EAAEY,MAAM,CAACZ,KAAK,GAAGkH,IAAI,CAACE,KAAK,CAACxG,MAAM,CAACZ,KAAK,CAAC,GAAGe,SAAS;QAC1DP,IAAI,EAAEI,MAAM,CAACJ,IAAI,GAAG0G,IAAI,CAACE,KAAK,CAACxG,MAAM,CAACJ,IAAI,CAAC,GAAGO;MAChD,CAAC;IACH,CAAC;IAhjBC,IAAI,CAACtC,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,CAAC8G,UAAU,GAAG5G,MAAK;EACzB;AA4iBF","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","globalLabels","uuid","state","setScope","updateFunc","scope","getScope","console","error","concat","_classPrivateFieldGet","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","_objectSpread","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","FINISHED","result","scopeUuids","arguments","undefined","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","testCaseId","historyId","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","attachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","_classPrivateFieldInitSpec","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\ninterface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\nclass DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({ writer, listeners = [], environmentInfo, categories, links, globalLabels }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n this.globalLabels = globalLabels ?? [];\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,SAKEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,YAAY,QAAQ,eAAe;AAS5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAChH,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAclD,MAAMC,gBAAgB,CAAsB;EAAAC,YAAA;IAAAC,eAAA,sBACG,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,sBACX,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,gBAE5C,MAAY;MAClB,IAAI,CAACE,WAAW,CAACC,KAAK,CAAC,CAAC;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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AAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAE;EACxC;AA6jBF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Label,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":"AAYA,OAAO,IAAMA,4BAA4B,GAAG,sCAAsC;AAClF,OAAO,IAAMC,mCAAmC,GAAG,qCAAqC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Label,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly globalLabels?: Label[];\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":"AAYA,OAAO,IAAMA,4BAA4B,GAAG,sCAAsC;AAClF,OAAO,IAAMC,mCAAmC,GAAG,qCAAqC","ignoreList":[]}
|
package/dist/esm/sdk/utils.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
2
2
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
3
3
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
9
|
import { LabelName, Status } from "../model.js";
|
|
5
10
|
export var getStatusFromError = error => {
|
|
6
11
|
switch (true) {
|
|
@@ -17,6 +22,7 @@ export var getStatusFromError = error => {
|
|
|
17
22
|
case error.stack && /@vitest\/expect/gi.test(error.stack):
|
|
18
23
|
case error.stack && /playwright\/lib\/matchers\/expect\.js/gi.test(error.stack):
|
|
19
24
|
case "matcherResult" in error:
|
|
25
|
+
case "inspect" in error && typeof error.inspect === "function":
|
|
20
26
|
return Status.FAILED;
|
|
21
27
|
default:
|
|
22
28
|
return Status.BROKEN;
|
|
@@ -46,10 +52,16 @@ export var getMessageAndTraceFromError = error => {
|
|
|
46
52
|
message,
|
|
47
53
|
stack
|
|
48
54
|
} = error;
|
|
49
|
-
|
|
55
|
+
var actual = "actual" in error && error.actual !== undefined ? {
|
|
56
|
+
actual: serialize(error.actual)
|
|
57
|
+
} : {};
|
|
58
|
+
var expected = "expected" in error && error.expected !== undefined ? {
|
|
59
|
+
expected: serialize(error.expected)
|
|
60
|
+
} : {};
|
|
61
|
+
return _objectSpread(_objectSpread({
|
|
50
62
|
message: message ? stripAnsi(message) : undefined,
|
|
51
63
|
trace: stack ? stripAnsi(stack) : undefined
|
|
52
|
-
};
|
|
64
|
+
}, actual), expected);
|
|
53
65
|
};
|
|
54
66
|
export var allureIdRegexp = /*#__PURE__*/_wrapRegExp(/(?:^|\s)@?allure\.id[:=]([^\s]+)/, {
|
|
55
67
|
id: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["LabelName","Status","getStatusFromError","error","test","constructor","name","message","stack","FAILED","BROKEN","ansiRegex","onlyFirst","arguments","length","undefined","pattern","join","RegExp","stripAnsi","str","regex","replace","getMessageAndTraceFromError","trace","allureIdRegexp","_wrapRegExp","id","allureIdRegexpGlobal","allureLabelRegexp","value","allureLabelRegexpGlobal","isMetadataTag","tag","extractMetadataFromString","title","labels","split","forEach","val","_val$match","idValue","match","groups","push","ALLURE_ID","labelMatch","cleanTitle","trim","isAnyStepFailed","item","isFailed","status","steps","find","step","isAllStepsEnded","every","stop","hasLabel","testResult","labelName","l","hasStepMessage","messages","some","type","getStepsMessagesPair","reduce","acc","unfinishedStepIdx","findLastIndex","getUnfinishedStepsMessages","grouppedStepsMessage","filter","isPromise","obj","then","serialize","maxDepth","maxLength","replacer","limitString","JSON","stringify","createSerializeReplacer","String","userDefinedReplacer","parents","limitingReplacer","_","Object","is","at","pop","includes","Map","excludeCircularRefsFromMap","Set","excludeCircularRefsFromSet","composeReplacers","first","second","k","v","call","map","Array","from","_ref","_ref2","set","concat","substring"],"sources":["../../../src/sdk/utils.ts"],"sourcesContent":["import type { FixtureResult, Label, StatusDetails, StepResult, TestResult } from \"../model.js\";\nimport { LabelName, Status } from \"../model.js\";\nimport type { RuntimeMessage, SerializeOptions, SerializerReplacerFunc } from \"./types.js\";\n\nexport const getStatusFromError = (error: Partial<Error>): Status => {\n switch (true) {\n /**\n * Native `node:assert` and `chai` (`vitest` uses it under the hood) throw `AssertionError`\n * `jest` throws `JestAssertionError` instance\n * `jasmine` throws `ExpectationFailed` instance\n * `vitest` throws `Error` for extended assertions, so we look into stack\n */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case error.name && /assert/gi.test(error.name):\n case error.message && /assert/gi.test(error.message):\n case error.stack && /@vitest\\/expect/gi.test(error.stack):\n case error.stack && /playwright\\/lib\\/matchers\\/expect\\.js/gi.test(error.stack):\n case \"matcherResult\" in error:\n 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 isMetadataTag = (tag: string) => {\n return allureIdRegexp.test(tag) || allureLabelRegexp.test(tag);\n};\n\nexport const extractMetadataFromString = (\n title: string,\n): {\n labels: Label[];\n cleanTitle: string;\n} => {\n const labels = [] as Label[];\n\n title.split(\" \").forEach((val) => {\n const idValue = val.match(allureIdRegexp)?.groups?.id;\n\n if (idValue) {\n labels.push({ name: LabelName.ALLURE_ID, value: idValue });\n }\n\n const labelMatch = val.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n labels?.push({ name, value });\n }\n });\n\n const cleanTitle = title.replace(allureLabelRegexpGlobal, \"\").replace(allureIdRegexpGlobal, \"\").trim();\n\n return { labels, cleanTitle };\n};\n\nexport const isAnyStepFailed = (item: StepResult | TestResult | FixtureResult): boolean => {\n const isFailed = item.status === Status.FAILED;\n\n if (isFailed || item.steps.length === 0) {\n return isFailed;\n }\n\n return !!item.steps.find((step) => isAnyStepFailed(step));\n};\n\nexport const isAllStepsEnded = (item: StepResult | TestResult | FixtureResult): boolean => {\n return item.steps.every((val) => val.stop && isAllStepsEnded(val));\n};\n\nexport const hasLabel = (testResult: TestResult, labelName: LabelName | string): boolean => {\n return !!testResult.labels.find((l) => l.name === labelName);\n};\n\nexport const hasStepMessage = (messages: RuntimeMessage[]) => {\n return messages.some((message) => message.type === \"step_start\" || message.type === \"step_stop\");\n};\n\nexport const getStepsMessagesPair = (messages: RuntimeMessage[]) =>\n messages.reduce((acc, message) => {\n if (message.type !== \"step_start\" && message.type !== \"step_stop\") {\n return acc;\n }\n\n if (message.type === \"step_start\") {\n acc.push([message]);\n\n return acc;\n }\n\n const unfinishedStepIdx = acc.findLastIndex((step) => step.length === 1);\n\n if (unfinishedStepIdx === -1) {\n return acc;\n }\n\n acc[unfinishedStepIdx].push(message);\n\n return acc;\n }, [] as RuntimeMessage[][]);\n\nexport const getUnfinishedStepsMessages = (messages: RuntimeMessage[]) => {\n const grouppedStepsMessage = getStepsMessagesPair(messages);\n\n return grouppedStepsMessage.filter((step) => step.length === 1);\n};\n\nexport const isPromise = <T = any>(obj: any): obj is PromiseLike<T> =>\n !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n\nexport const serialize = (value: any, { maxDepth = 0, maxLength = 0, replacer }: SerializeOptions = {}): string =>\n limitString(\n typeof value === \"object\" ? JSON.stringify(value, createSerializeReplacer(maxDepth, replacer)) : String(value),\n maxLength,\n );\n\nconst createSerializeReplacer = (maxDepth: number, userDefinedReplacer: SerializeOptions[\"replacer\"]) => {\n const parents: unknown[] = [];\n const limitingReplacer = function (this: unknown, _: string, value: unknown) {\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n while (parents.length > 0 && !Object.is(parents.at(-1), this)) {\n parents.pop();\n }\n\n if ((maxDepth && parents.length >= maxDepth) || parents.includes(value)) {\n return undefined;\n }\n\n parents.push(value);\n\n return value instanceof Map\n ? excludeCircularRefsFromMap(parents, value)\n : value instanceof Set\n ? excludeCircularRefsFromSet(parents, value)\n : value;\n };\n return userDefinedReplacer ? composeReplacers(userDefinedReplacer, limitingReplacer) : limitingReplacer;\n};\n\nconst composeReplacers = (first: SerializerReplacerFunc, second: SerializerReplacerFunc): SerializerReplacerFunc =>\n function (k, v) {\n return second.call(this, k, first.call(this, k, v));\n };\n\nconst excludeCircularRefsFromMap = (parents: any[], map: Map<any, any>) => {\n return Array.from(map)\n .filter(([k]) => !parents.includes(k))\n .map(([k, v]) => [k, parents.includes(v) ? undefined : v]);\n};\n\nconst excludeCircularRefsFromSet = (parents: any[], set: Set<any>) => {\n return Array.from(set).map((v) => (parents.includes(v) ? undefined : v));\n};\n\nconst limitString = (value: string, maxLength: number) =>\n maxLength && value.length > maxLength ? `${value.substring(0, maxLength)}...` : value;\n"],"mappings":";;;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,aAAa;AAG/C,OAAO,IAAMC,kBAAkB,GAAIC,KAAqB,IAAa;EACnE,QAAQ,IAAI;IACV;AACJ;AACA;AACA;AACA;A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AA,CAAMlF,KAAK,CAACmF,SAAS,CAAC,CAAC,EAAEjC,SAAS,CAAC,WAAQlD,KAAK","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"utils.js","names":["LabelName","Status","getStatusFromError","error","test","constructor","name","message","stack","inspect","FAILED","BROKEN","ansiRegex","onlyFirst","arguments","length","undefined","pattern","join","RegExp","stripAnsi","str","regex","replace","getMessageAndTraceFromError","actual","serialize","expected","_objectSpread","trace","allureIdRegexp","_wrapRegExp","id","allureIdRegexpGlobal","allureLabelRegexp","value","allureLabelRegexpGlobal","isMetadataTag","tag","extractMetadataFromString","title","labels","split","forEach","val","_val$match","idValue","match","groups","push","ALLURE_ID","labelMatch","cleanTitle","trim","isAnyStepFailed","item","isFailed","status","steps","find","step","isAllStepsEnded","every","stop","hasLabel","testResult","labelName","l","hasStepMessage","messages","some","type","getStepsMessagesPair","reduce","acc","unfinishedStepIdx","findLastIndex","getUnfinishedStepsMessages","grouppedStepsMessage","filter","isPromise","obj","then","maxDepth","maxLength","replacer","limitString","JSON","stringify","createSerializeReplacer","String","userDefinedReplacer","parents","limitingReplacer","_","Object","is","at","pop","includes","Map","excludeCircularRefsFromMap","Set","excludeCircularRefsFromSet","composeReplacers","first","second","k","v","call","map","Array","from","_ref","_ref2","set","concat","substring"],"sources":["../../../src/sdk/utils.ts"],"sourcesContent":["import type { FixtureResult, Label, StatusDetails, StepResult, TestResult } from \"../model.js\";\nimport { LabelName, Status } from \"../model.js\";\nimport type { RuntimeMessage, SerializeOptions, SerializerReplacerFunc } from \"./types.js\";\n\nexport const getStatusFromError = (error: Partial<Error>): Status => {\n switch (true) {\n /**\n * Native `node:assert` and `chai` (`vitest` uses it under the hood) throw `AssertionError`\n * `jest` throws `JestAssertionError` instance\n * `jasmine` throws `ExpectationFailed` instance\n * `vitest` throws `Error` for extended assertions, so we look into stack\n */\n case /assert/gi.test(error.constructor.name):\n case /expectation/gi.test(error.constructor.name):\n case error.name && /assert/gi.test(error.name):\n case error.message && /assert/gi.test(error.message):\n case error.stack && /@vitest\\/expect/gi.test(error.stack):\n case error.stack && /playwright\\/lib\\/matchers\\/expect\\.js/gi.test(error.stack):\n case \"matcherResult\" in error:\n case \"inspect\" in error && typeof error.inspect === \"function\":\n return Status.FAILED;\n default:\n return Status.BROKEN;\n }\n};\n\n/**\n * Source: https://github.com/chalk/ansi-regex\n */\nconst ansiRegex = ({ onlyFirst = false } = {}) => {\n const pattern = [\n \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\n \"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\",\n ].join(\"|\");\n\n return new RegExp(pattern, onlyFirst ? undefined : \"g\");\n};\n\n/**\n * https://github.com/chalk/strip-ansi\n */\nexport const stripAnsi = (str: string): string => {\n const regex = ansiRegex();\n return str.replace(regex, \"\");\n};\n\nexport const getMessageAndTraceFromError = (error: Error | { message?: string; stack?: string }): StatusDetails => {\n const { message, stack } = error;\n const actual = \"actual\" in error && error.actual !== undefined ? { actual: serialize(error.actual) } : {};\n const expected = \"expected\" in error && error.expected !== undefined ? { expected: serialize(error.expected) } : {};\n return {\n message: message ? stripAnsi(message) : undefined,\n trace: stack ? stripAnsi(stack) : undefined,\n ...actual,\n ...expected,\n };\n};\n\nexport const allureIdRegexp = /(?:^|\\s)@?allure\\.id[:=](?<id>[^\\s]+)/;\nexport const allureIdRegexpGlobal = new RegExp(allureIdRegexp, \"g\");\nexport const allureLabelRegexp = /(?:^|\\s)@?allure\\.label\\.(?<name>[^:=\\s]+)[:=](?<value>[^\\s]+)/;\nexport const allureLabelRegexpGlobal = new RegExp(allureLabelRegexp, \"g\");\n\nexport const isMetadataTag = (tag: string) => {\n return allureIdRegexp.test(tag) || allureLabelRegexp.test(tag);\n};\n\nexport const extractMetadataFromString = (\n title: string,\n): {\n labels: Label[];\n cleanTitle: string;\n} => {\n const labels = [] as Label[];\n\n title.split(\" \").forEach((val) => {\n const idValue = val.match(allureIdRegexp)?.groups?.id;\n\n if (idValue) {\n labels.push({ name: LabelName.ALLURE_ID, value: idValue });\n }\n\n const labelMatch = val.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n labels?.push({ name, value });\n }\n });\n\n const cleanTitle = title.replace(allureLabelRegexpGlobal, \"\").replace(allureIdRegexpGlobal, \"\").trim();\n\n return { labels, cleanTitle };\n};\n\nexport const isAnyStepFailed = (item: StepResult | TestResult | FixtureResult): boolean => {\n const isFailed = item.status === Status.FAILED;\n\n if (isFailed || item.steps.length === 0) {\n return isFailed;\n }\n\n return !!item.steps.find((step) => isAnyStepFailed(step));\n};\n\nexport const isAllStepsEnded = (item: StepResult | TestResult | FixtureResult): boolean => {\n return item.steps.every((val) => val.stop && isAllStepsEnded(val));\n};\n\nexport const hasLabel = (testResult: TestResult, labelName: LabelName | string): boolean => {\n return !!testResult.labels.find((l) => l.name === labelName);\n};\n\nexport const hasStepMessage = (messages: RuntimeMessage[]) => {\n return messages.some((message) => message.type === \"step_start\" || message.type === \"step_stop\");\n};\n\nexport const getStepsMessagesPair = (messages: RuntimeMessage[]) =>\n messages.reduce((acc, message) => {\n if (message.type !== \"step_start\" && message.type !== \"step_stop\") {\n return acc;\n }\n\n if (message.type === \"step_start\") {\n acc.push([message]);\n\n return acc;\n }\n\n const unfinishedStepIdx = acc.findLastIndex((step) => step.length === 1);\n\n if (unfinishedStepIdx === -1) {\n return acc;\n }\n\n acc[unfinishedStepIdx].push(message);\n\n return acc;\n }, [] as RuntimeMessage[][]);\n\nexport const getUnfinishedStepsMessages = (messages: RuntimeMessage[]) => {\n const grouppedStepsMessage = getStepsMessagesPair(messages);\n\n return grouppedStepsMessage.filter((step) => step.length === 1);\n};\n\nexport const isPromise = <T = any>(obj: any): obj is PromiseLike<T> =>\n !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n\nexport const serialize = (value: any, { maxDepth = 0, maxLength = 0, replacer }: SerializeOptions = {}): string =>\n limitString(\n typeof value === \"object\" ? JSON.stringify(value, createSerializeReplacer(maxDepth, replacer)) : String(value),\n maxLength,\n );\n\nconst createSerializeReplacer = (maxDepth: number, userDefinedReplacer: SerializeOptions[\"replacer\"]) => {\n const parents: unknown[] = [];\n const limitingReplacer = function (this: unknown, _: string, value: unknown) {\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n while (parents.length > 0 && !Object.is(parents.at(-1), this)) {\n parents.pop();\n }\n\n if ((maxDepth && parents.length >= maxDepth) || parents.includes(value)) {\n return undefined;\n }\n\n parents.push(value);\n\n return value instanceof Map\n ? excludeCircularRefsFromMap(parents, value)\n : value instanceof Set\n ? excludeCircularRefsFromSet(parents, value)\n : value;\n };\n return userDefinedReplacer ? composeReplacers(userDefinedReplacer, limitingReplacer) : limitingReplacer;\n};\n\nconst composeReplacers = (first: SerializerReplacerFunc, second: SerializerReplacerFunc): SerializerReplacerFunc =>\n function (k, v) {\n return second.call(this, k, first.call(this, k, v));\n };\n\nconst excludeCircularRefsFromMap = (parents: any[], map: Map<any, any>) => {\n return Array.from(map)\n .filter(([k]) => !parents.includes(k))\n .map(([k, v]) => [k, parents.includes(v) ? undefined : v]);\n};\n\nconst excludeCircularRefsFromSet = (parents: any[], set: Set<any>) => {\n return Array.from(set).map((v) => (parents.includes(v) ? undefined : v));\n};\n\nconst limitString = (value: string, maxLength: number) =>\n maxLength && value.length > maxLength ? `${value.substring(0, maxLength)}...` : value;\n"],"mappings":";;;;;;;;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,aAAa;AAG/C,OAAO,IAAMC,kBAAkB,GAAIC,KAAqB,IAAa;EACnE,QAAQ,IAAI;IACV;AACJ;AACA;AACA;AACA;AACA;IACI,KAAK,UAAU,CAACC,IAAI,CAACD,KAAK,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S,CAAC,CAAC,GAAG5F,SAAS,GAAG4F,CAAC,CAAC;EAAA,EAAC;AAC9D,CAAC;AAED,IAAML,0BAA0B,GAAGA,CAACX,OAAc,EAAEuB,GAAa,KAAK;EACpE,OAAOJ,KAAK,CAACC,IAAI,CAACG,GAAG,CAAC,CAACL,GAAG,CAAEF,CAAC,IAAMhB,OAAO,CAACO,QAAQ,CAACS,CAAC,CAAC,GAAG5F,SAAS,GAAG4F,CAAE,CAAC;AAC1E,CAAC;AAED,IAAMtB,WAAW,GAAGA,CAACnD,KAAa,EAAEiD,SAAiB,KACnDA,SAAS,IAAIjD,KAAK,CAACpB,MAAM,GAAGqE,SAAS,MAAAgC,MAAA,CAAMjF,KAAK,CAACkF,SAAS,CAAC,CAAC,EAAEjC,SAAS,CAAC,WAAQjD,KAAK","ignoreList":[]}
|
package/dist/types/model.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { type AttachmentOptions, type FixtureResult, type StepResult, type TestResult } from "../../model.js";
|
|
2
|
+
import { type AttachmentOptions, type FixtureResult, type Label, type StepResult, type TestResult } from "../../model.js";
|
|
3
3
|
import type { Category, EnvironmentInfo, RuntimeMessage } from "../types.js";
|
|
4
4
|
import type { FixtureType, LinkConfig, ReporterRuntimeConfig, TestScope, Writer } from "./types.js";
|
|
5
5
|
export declare class ReporterRuntime {
|
|
@@ -11,7 +11,8 @@ export declare class ReporterRuntime {
|
|
|
11
11
|
categories?: Category[];
|
|
12
12
|
environmentInfo?: EnvironmentInfo;
|
|
13
13
|
linkConfig?: LinkConfig;
|
|
14
|
-
|
|
14
|
+
globalLabels: Label[];
|
|
15
|
+
constructor({ writer, listeners, environmentInfo, categories, links, globalLabels }: ReporterRuntimeConfig);
|
|
15
16
|
startScope: () => string;
|
|
16
17
|
updateScope: (uuid: string, updateFunc: (scope: TestScope) => void) => void;
|
|
17
18
|
writeScope: (uuid: string) => void;
|
|
@@ -25,6 +25,7 @@ export type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | stri
|
|
|
25
25
|
export interface ReporterConfig {
|
|
26
26
|
readonly resultsDir?: string;
|
|
27
27
|
readonly links?: LinkConfig;
|
|
28
|
+
readonly globalLabels?: Label[];
|
|
28
29
|
readonly listeners?: LifecycleListener[];
|
|
29
30
|
readonly environmentInfo?: EnvironmentInfo;
|
|
30
31
|
readonly categories?: Category[];
|
|
@@ -9,7 +9,7 @@ export declare const stripAnsi: (str: string) => string;
|
|
|
9
9
|
export declare const getMessageAndTraceFromError: (error: Error | {
|
|
10
10
|
message?: string;
|
|
11
11
|
stack?: string;
|
|
12
|
-
}) =>
|
|
12
|
+
}) => StatusDetails;
|
|
13
13
|
export declare const allureIdRegexp: RegExp;
|
|
14
14
|
export declare const allureIdRegexpGlobal: RegExp;
|
|
15
15
|
export declare const allureLabelRegexp: RegExp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure-js-commons",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"description": "Allure JS Commons",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
"npm-run-all2": "^7.0.0",
|
|
103
103
|
"rimraf": "^6.0.0",
|
|
104
104
|
"typescript": "^5.2.2",
|
|
105
|
-
"vitest": "^2.1.
|
|
105
|
+
"vitest": "^2.1.8"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
|
-
"allure-playwright": "3.0.
|
|
108
|
+
"allure-playwright": "3.0.9"
|
|
109
109
|
},
|
|
110
110
|
"peerDependenciesMeta": {
|
|
111
111
|
"allure-playwright": {
|