allure-js-commons 3.14.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/dist/cjs/facade.js +37 -1
- package/dist/cjs/facade.js.map +1 -1
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model.js +6 -2
- package/dist/cjs/model.js.map +1 -1
- package/dist/cjs/sdk/index.js.map +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +76 -18
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/index.js.map +1 -1
- package/dist/cjs/sdk/reporter/testplan.js +17 -8
- package/dist/cjs/sdk/reporter/testplan.js.map +1 -1
- package/dist/cjs/sdk/reporter/types.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils.js +12 -1
- package/dist/cjs/sdk/reporter/utils.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js +1 -1
- package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js +4 -5
- package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/MessageReader.js +10 -8
- package/dist/cjs/sdk/reporter/writer/MessageReader.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/MessageWriter.js +2 -2
- package/dist/cjs/sdk/reporter/writer/MessageWriter.js.map +1 -1
- package/dist/cjs/sdk/runtime/MessageTestRuntime.js +98 -30
- package/dist/cjs/sdk/runtime/MessageTestRuntime.js.map +1 -1
- package/dist/cjs/sdk/runtime/NoopTestRuntime.js +48 -12
- package/dist/cjs/sdk/runtime/NoopTestRuntime.js.map +1 -1
- package/dist/cjs/sdk/runtime/types.js.map +1 -1
- package/dist/cjs/sdk/types.js.map +1 -1
- package/dist/cjs/sdk/utils.js +9 -7
- package/dist/cjs/sdk/utils.js.map +1 -1
- package/dist/cjs/sync.js +24 -0
- package/dist/cjs/sync.js.map +1 -1
- package/dist/cjs/syncFacade.js +17 -1
- package/dist/cjs/syncFacade.js.map +1 -1
- package/dist/esm/facade.js +31 -0
- package/dist/esm/facade.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model.js +6 -0
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/sdk/index.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +76 -18
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/index.js.map +1 -1
- package/dist/esm/sdk/reporter/testplan.js +17 -6
- package/dist/esm/sdk/reporter/testplan.js.map +1 -1
- package/dist/esm/sdk/reporter/types.js.map +1 -1
- package/dist/esm/sdk/reporter/utils.js +10 -1
- package/dist/esm/sdk/reporter/utils.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/FileSystemWriter.js +1 -1
- package/dist/esm/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/InMemoryWriter.js +4 -5
- package/dist/esm/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/MessageReader.js +10 -8
- package/dist/esm/sdk/reporter/writer/MessageReader.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/MessageWriter.js +2 -2
- package/dist/esm/sdk/reporter/writer/MessageWriter.js.map +1 -1
- package/dist/esm/sdk/runtime/MessageTestRuntime.js +98 -30
- package/dist/esm/sdk/runtime/MessageTestRuntime.js.map +1 -1
- package/dist/esm/sdk/runtime/NoopTestRuntime.js +48 -12
- package/dist/esm/sdk/runtime/NoopTestRuntime.js.map +1 -1
- package/dist/esm/sdk/runtime/types.js.map +1 -1
- package/dist/esm/sdk/types.js.map +1 -1
- package/dist/esm/sdk/utils.js +9 -6
- package/dist/esm/sdk/utils.js.map +1 -1
- package/dist/esm/sync.js +1 -1
- package/dist/esm/sync.js.map +1 -1
- package/dist/esm/syncFacade.js +12 -0
- package/dist/esm/syncFacade.js.map +1 -1
- package/dist/types/facade.d.ts +6 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/model.d.ts +9 -1
- package/dist/types/sdk/index.d.ts +1 -1
- package/dist/types/sdk/reporter/ReporterRuntime.d.ts +11 -1
- package/dist/types/sdk/reporter/index.d.ts +1 -1
- package/dist/types/sdk/reporter/testplan.d.ts +5 -1
- package/dist/types/sdk/reporter/types.d.ts +6 -2
- package/dist/types/sdk/reporter/utils.d.ts +3 -0
- package/dist/types/sdk/reporter/writer/FileSystemWriter.d.ts +2 -2
- package/dist/types/sdk/reporter/writer/InMemoryWriter.d.ts +3 -3
- package/dist/types/sdk/reporter/writer/MessageWriter.d.ts +2 -2
- package/dist/types/sdk/runtime/MessageTestRuntime.d.ts +6 -2
- package/dist/types/sdk/runtime/NoopTestRuntime.d.ts +9 -1
- package/dist/types/sdk/runtime/types.d.ts +10 -2
- package/dist/types/sdk/types.d.ts +10 -5
- package/dist/types/sdk/utils.d.ts +4 -3
- package/dist/types/sync.d.ts +1 -1
- package/dist/types/syncFacade.d.ts +4 -0
- package/package.json +2 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncFacade.js","names":["LabelName","LinkType","getGlobalSyncTestRuntimeWithAutoconfig","callRuntimeMethod","method","runtime","_len","arguments","length","args","Array","_key","label","name","value","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","opts","contentType","globalAttachment","globalAttachmentPath","path","globalError","_len4","_key4","attachTrace","attachmentPath","stepContext","mode","logStep","status","error","step","body","issue","ISSUE","tms","TMS","allureId","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len5","tagsList","_key5","map"],"sources":["../../src/syncFacade.ts"],"sourcesContent":["import type {\n AttachmentOptions,\n GlobalErrorArgs,\n Label,\n Link,\n ParameterMode,\n ParameterOptions,\n Status,\n} from \"./model.js\";\nimport { type ContentType, LabelName, LinkType } from \"./model.js\";\nimport { getGlobalSyncTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { SyncStepContext, SyncTestRuntime } from \"./sdk/runtime/types.js\";\n\nconst callRuntimeMethod = <\n T extends keyof SyncTestRuntime,\n S extends Parameters<SyncTestRuntime[T]>,\n R extends ReturnType<SyncTestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalSyncTestRuntimeWithAutoconfig();\n\n // @ts-ignore\n return runtime[method](...args);\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | Uint8Array | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const globalAttachment = (\n name: string,\n content: Buffer | Uint8Array | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachment\", name, content, opts);\n};\n\nexport const globalAttachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachmentFromPath\", name, path, opts);\n};\n\nexport const globalError = (...args: GlobalErrorArgs) => {\n return callRuntimeMethod(\"globalError\", ...args);\n};\n\nexport const attachTrace = (name: string, path: string) => {\n return callRuntimeMethod(\"attachmentFromPath\", name, path, {\n contentType: \"application/vnd.allure.playwright-trace\",\n });\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nconst stepContext = (): SyncStepContext => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?: ParameterMode) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): void => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: SyncStepContext) => T): T => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\n \"labels\",\n ...tagsList.map((value) => ({\n name: LabelName.TAG,\n value,\n })),\n );\n};\n"],"mappings":"AASA,SAA2BA,SAAS,EAAEC,QAAQ,QAAQ,YAAY;AAClE,SAASC,sCAAsC,QAAQ,0BAA0B;AAGjF,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAKrBC,MAAS,EAEH;EACN,IAAMC,OAAO,GAAGH,sCAAsC,CAAC,CAAC;;EAExD;EAAA,SAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAJGC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;EAAA;EAKP,OAAON,OAAO,CAACD,MAAM,CAAC,CAAC,GAAGK,IAAI,CAAC;AACjC,CAAC;AAED,OAAO,IAAMG,KAAK,GAAGA,CAACC,IAAwB,EAAEC,KAAa,KAAK;EAChE,OAAOX,iBAAiB,CAAC,QAAQ,EAAE;IAAEU,IAAI;IAAEC;EAAM,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA,EAA+B;EAAA,SAAAC,KAAA,GAAAT,SAAA,CAAAC,MAAA,EAAxBS,UAAU,OAAAP,KAAA,CAAAM,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAAVD,UAAU,CAAAC,KAAA,IAAAX,SAAA,CAAAW,KAAA;EAAA;EAClC,OAAO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CAAC;AAEnE,OAAO,IAAMiE,GAAG,GAAIjE,IAAY,IAAKD,KAAK,CAACZ,SAAS,CAAC+E,GAAG,EAAElE,IAAI,CAAC;AAE/D,OAAO,IAAMmE,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAA8B;EAAA,SAAAC,KAAA,GAAA1E,SAAA,CAAAC,MAAA,EAAvB0E,QAAQ,OAAAxE,KAAA,CAAAuE,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAARD,QAAQ,CAAAC,KAAA,IAAA5E,SAAA,CAAA4E,KAAA;EAAA;EAC9B,OAAOhF,iBAAiB,CACtB,QAAQ,EACR,GAAG+E,QAAQ,CAACE,GAAG,CAAEtE,KAAK,KAAM;IAC1BD,IAAI,EAAEb,SAAS,CAAC+E,GAAG;IACnBjE;EACF,CAAC,CAAC,CACJ,CAAC;AACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"syncFacade.js","names":["LabelName","LinkType","getGlobalSyncTestRuntimeWithAutoconfig","callRuntimeMethod","method","runtime","_len","arguments","length","args","Array","_key","label","name","value","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","precondition","preconditionHtml","expectedResult","expectedResultHtml","displayName","historyId","testCaseId","attachment","content","opts","contentType","globalAttachment","globalAttachmentPath","path","globalError","_len4","_key4","attachTrace","attachmentPath","stepContext","mode","logStep","status","error","step","body","issue","ISSUE","tms","TMS","allureId","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len5","tagsList","_key5","map"],"sources":["../../src/syncFacade.ts"],"sourcesContent":["import type {\n AttachmentOptions,\n GlobalErrorArgs,\n Label,\n Link,\n ParameterMode,\n ParameterOptions,\n Status,\n} from \"./model.js\";\nimport { type ContentType, LabelName, LinkType } from \"./model.js\";\nimport { getGlobalSyncTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { SyncStepContext, SyncTestRuntime } from \"./sdk/runtime/types.js\";\n\nconst callRuntimeMethod = <\n T extends keyof SyncTestRuntime,\n S extends Parameters<SyncTestRuntime[T]>,\n R extends ReturnType<SyncTestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalSyncTestRuntimeWithAutoconfig();\n\n // @ts-ignore\n return runtime[method](...args);\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const precondition = (markdown: string) => {\n return callRuntimeMethod(\"precondition\", markdown);\n};\n\nexport const preconditionHtml = (html: string) => {\n return callRuntimeMethod(\"preconditionHtml\", html);\n};\n\nexport const expectedResult = (markdown: string) => {\n return callRuntimeMethod(\"expectedResult\", markdown);\n};\n\nexport const expectedResultHtml = (html: string) => {\n return callRuntimeMethod(\"expectedResultHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | Uint8Array | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const globalAttachment = (\n name: string,\n content: Buffer | Uint8Array | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachment\", name, content, opts);\n};\n\nexport const globalAttachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachmentFromPath\", name, path, opts);\n};\n\nexport const globalError = (...args: GlobalErrorArgs) => {\n return callRuntimeMethod(\"globalError\", ...args);\n};\n\nexport const attachTrace = (name: string, path: string) => {\n return callRuntimeMethod(\"attachmentFromPath\", name, path, {\n contentType: \"application/vnd.allure.playwright-trace\",\n });\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nconst stepContext = (): SyncStepContext => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?: ParameterMode) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): void => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: SyncStepContext) => T): T => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\n \"labels\",\n ...tagsList.map((value) => ({\n name: LabelName.TAG,\n value,\n })),\n );\n};\n"],"mappings":"AASA,SAA2BA,SAAS,EAAEC,QAAQ,QAAQ,YAAY;AAClE,SAASC,sCAAsC,QAAQ,0BAA0B;AAGjF,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAKrBC,MAAS,EAEH;EACN,IAAMC,OAAO,GAAGH,sCAAsC,CAAC,CAAC;;EAExD;EAAA,SAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAJGC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;EAAA;EAKP,OAAON,OAAO,CAACD,MAAM,CAAC,CAAC,GAAGK,IAAI,CAAC;AACjC,CAAC;AAED,OAAO,IAAMG,KAAK,GAAGA,CAACC,IAAwB,EAAEC,KAAa,KAAK;EAChE,OAAOX,iBAAiB,CAAC,QAAQ,EAAE;IAAEU,IAAI;IAAEC;EAAM,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA,EAA+B;EAAA,SAAAC,KAAA,GAAAT,SAAA,CAAAC,MAAA,EAAxBS,UAAU,OAAAP,KAAA,CAAAM,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,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CAACuE,KAAK,EAAE1D,IAAI,CAAC;AAEnE,OAAO,IAAM2D,WAAW,GAAI3D,IAAY,IAAKD,KAAK,CAACZ,SAAS,CAACyE,YAAY,EAAE5D,IAAI,CAAC;AAEhF,OAAO,IAAM6D,QAAQ,GAAI7D,IAAY,IAAKD,KAAK,CAACZ,SAAS,CAAC2E,SAAS,EAAE9D,IAAI,CAAC;AAE1E,OAAO,IAAM+D,KAAK,GAAI/D,IAAY,IAAKD,KAAK,CAACZ,SAAS,CAAC6E,KAAK,EAAEhE,IAAI,CAAC;AAEnE,OAAO,IAAMiE,QAAQ,GAAIjE,IAAY,IAAKD,KAAK,CAACZ,SAAS,CAAC+E,QAAQ,EAAElE,IAAI,CAAC;AAEzE,OAAO,IAAMmE,KAAK,GAAInE,IAAY,IAAKD,KAAK,CAACZ,SAAS,CAACiF,KAAK,EAAEpE,IAAI,CAAC;AAEnE,OAAO,IAAMqE,GAAG,GAAIrE,IAAY,IAAKD,KAAK,CAACZ,SAAS,CAACmF,GAAG,EAAEtE,IAAI,CAAC;AAE/D,OAAO,IAAMuE,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAA8B;EAAA,SAAAC,KAAA,GAAA9E,SAAA,CAAAC,MAAA,EAAvB8E,QAAQ,OAAA5E,KAAA,CAAA2E,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAARD,QAAQ,CAAAC,KAAA,IAAAhF,SAAA,CAAAgF,KAAA;EAAA;EAC9B,OAAOpF,iBAAiB,CACtB,QAAQ,EACR,GAAGmF,QAAQ,CAACE,GAAG,CAAE1E,KAAK,KAAM;IAC1BD,IAAI,EAAEb,SAAS,CAACmF,GAAG;IACnBrE;EACF,CAAC,CAAC,CACJ,CAAC;AACH,CAAC","ignoreList":[]}
|
package/dist/types/facade.d.ts
CHANGED
|
@@ -11,12 +11,18 @@ export declare const links: (...linksList: Link[]) => PromiseLike<void>;
|
|
|
11
11
|
export declare const parameter: (name: string, value: string, options?: ParameterOptions) => PromiseLike<void>;
|
|
12
12
|
export declare const description: (markdown: string) => PromiseLike<void>;
|
|
13
13
|
export declare const descriptionHtml: (html: string) => PromiseLike<void>;
|
|
14
|
+
export declare const precondition: (markdown: string) => PromiseLike<void>;
|
|
15
|
+
export declare const preconditionHtml: (html: string) => PromiseLike<void>;
|
|
16
|
+
export declare const expectedResult: (markdown: string) => PromiseLike<void>;
|
|
17
|
+
export declare const expectedResultHtml: (html: string) => PromiseLike<void>;
|
|
14
18
|
export declare const displayName: (name: string) => PromiseLike<void>;
|
|
15
19
|
export declare const historyId: (value: string) => PromiseLike<void>;
|
|
16
20
|
export declare const testCaseId: (value: string) => PromiseLike<void>;
|
|
17
21
|
export declare const attachment: (name: string, content: Buffer | Uint8Array | string, options: ContentType | string | AttachmentOptions) => PromiseLike<void>;
|
|
18
22
|
export declare const globalAttachment: (name: string, content: Buffer | Uint8Array | string, options: ContentType | string | AttachmentOptions) => PromiseLike<void>;
|
|
19
23
|
export declare const globalAttachmentPath: (name: string, path: string, options: ContentType | string | Omit<AttachmentOptions, "encoding">) => PromiseLike<void>;
|
|
24
|
+
/** Record a numeric metric for the report. The key identifies the same metric across runs. */
|
|
25
|
+
export declare const metric: (key: string, value: number | string) => PromiseLike<void>;
|
|
20
26
|
export declare const globalError: (...args: GlobalErrorArgs) => PromiseLike<void>;
|
|
21
27
|
export declare const attachTrace: (name: string, path: string) => PromiseLike<void>;
|
|
22
28
|
export declare const attachmentPath: (name: string, path: string, options: ContentType | string | Omit<AttachmentOptions, "encoding">) => PromiseLike<void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { allureId, attachment, attachmentPath, attachTrace, description, descriptionHtml, displayName, epic, feature, globalAttachment, globalAttachmentPath, globalError, historyId, issue, label, labels, layer, link, links, logStep, owner, parameter, parentSuite, severity, step, story, subSuite, suite, tag, tags, testCaseId, tms, } from "./facade.js";
|
|
1
|
+
export { allureId, attachment, attachmentPath, attachTrace, description, descriptionHtml, displayName, epic, expectedResult, expectedResultHtml, feature, globalAttachment, globalAttachmentPath, globalError, historyId, issue, label, labels, layer, link, links, logStep, metric, owner, parameter, parentSuite, precondition, preconditionHtml, severity, step, story, subSuite, suite, tag, tags, testCaseId, tms, } from "./facade.js";
|
|
2
2
|
export type { StepContext } from "./sdk/runtime/types.js";
|
|
3
3
|
export type { HttpExchange, HttpExchangeBody, HttpExchangeBodyPart, HttpExchangeCookie, HttpExchangeError, HttpExchangeInformationalResponse, HttpExchangeNameValue, HttpExchangeRequest, HttpExchangeResponse, HttpExchangeStream, } from "./http.js";
|
|
4
4
|
export { ALLURE_HTTP_EXCHANGE_CONTENT_TYPE, ALLURE_HTTP_EXCHANGE_FILE_EXTENSION, ALLURE_HTTP_EXCHANGE_SCHEMA_VERSION, ALLURE_HTTP_REDACTED_VALUE, } from "./http.js";
|
|
5
|
-
export type {
|
|
6
|
-
export { ContentType, LinkType, LabelName, Severity, Stage, Status, StatusByPriority } from "./model.js";
|
|
5
|
+
export type { AllureMetricResult, Attachment, AttachmentOptions, ErrorDetails, ErrorStatus, FixtureResult, GlobalErrorArgs, ImageDiffAttachment, Label, Link, Globals, Parameter, ParameterMode, ParameterOptions, StatusDetails, StepResult, TestOrStepResult, TestResult, TestResultContainer, } from "./model.js";
|
|
6
|
+
export { ContentType, LinkType, LabelName, Severity, Stage, Status, StatusByPriority, WellKnownParameters, } from "./model.js";
|
package/dist/types/model.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export interface Parameter {
|
|
|
28
28
|
mode?: ParameterMode;
|
|
29
29
|
}
|
|
30
30
|
export type ParameterOptions = Pick<Parameter, "mode" | "excluded">;
|
|
31
|
+
export declare enum WellKnownParameters {
|
|
32
|
+
Retry = "Retry",
|
|
33
|
+
MaxRetries = "Max retries"
|
|
34
|
+
}
|
|
31
35
|
export interface StatusDetails {
|
|
32
36
|
message?: string;
|
|
33
37
|
trace?: string;
|
|
@@ -48,7 +52,7 @@ export interface Globals {
|
|
|
48
52
|
attachments: GlobalAttachment[];
|
|
49
53
|
errors: GlobalError[];
|
|
50
54
|
}
|
|
51
|
-
export interface
|
|
55
|
+
export interface AllureMetricResult {
|
|
52
56
|
id: string;
|
|
53
57
|
key: string;
|
|
54
58
|
value: number;
|
|
@@ -79,6 +83,10 @@ export interface TestResult extends Executable {
|
|
|
79
83
|
fullName?: string;
|
|
80
84
|
testCaseId?: string;
|
|
81
85
|
titlePath?: string[];
|
|
86
|
+
precondition?: string;
|
|
87
|
+
preconditionHtml?: string;
|
|
88
|
+
expectedResult?: string;
|
|
89
|
+
expectedResultHtml?: string;
|
|
82
90
|
labels: Label[];
|
|
83
91
|
links: Link[];
|
|
84
92
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { AllureResults, Category, EnvironmentInfo, ExecutorInfo, RuntimeMessage, RuntimeMetadataMessage, RuntimeAttachmentContentMessage, RuntimeAttachmentPathMessage, RuntimeGlobalAttachmentContentMessage, RuntimeGlobalAttachmentPathMessage, RuntimeGlobalErrorMessage,
|
|
1
|
+
export type { AllureResults, Category, EnvironmentInfo, ExecutorInfo, RuntimeMessage, RuntimeMetadataMessage, RuntimeAttachmentContentMessage, RuntimeAttachmentPathMessage, RuntimeGlobalAttachmentContentMessage, RuntimeGlobalAttachmentPathMessage, RuntimeGlobalErrorMessage, RuntimeMetricResultMessage, RuntimeStartStepMessage, RuntimeStepMetadataMessage, RuntimeStopStepMessage, SerializeOptions, TestPlanV1Test, TestPlanV1, } from "./types.js";
|
|
2
2
|
export { getStatusFromError, getMessageAndTraceFromError, getGlobalErrorDetails, toGlobalErrorMessage, isMetadataTag, getMetadataLabel, extractMetadataFromString, isAllStepsEnded, isAnyStepFailed, getUnfinishedStepsMessages, hasStepMessage, isGlobalRuntimeMessage, isPromise, hasLabel, stripAnsi, serialize, uint8ArrayToBase64, } from "./utils.js";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type AttachmentOptions, type FixtureResult, type Label, type StepResult, type TestResult } from "../../model.js";
|
|
2
2
|
import type { Category, EnvironmentInfo, RuntimeMessage } from "../types.js";
|
|
3
3
|
import type { FixtureType, LinkConfig, ReporterRuntimeConfig, TestScope, Writer } from "./types.js";
|
|
4
|
+
declare const attachmentReferenceBrand: unique symbol;
|
|
5
|
+
export type AttachmentReference = {
|
|
6
|
+
readonly [attachmentReferenceBrand]: true;
|
|
7
|
+
};
|
|
4
8
|
export interface StepStack {
|
|
5
9
|
clear(): void;
|
|
6
10
|
removeRoot(rootUuid: string): void;
|
|
@@ -78,7 +82,12 @@ export declare class ReporterRuntime {
|
|
|
78
82
|
stop?: number;
|
|
79
83
|
duration?: number;
|
|
80
84
|
}) => void;
|
|
81
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Writes attachment bytes or copies a source file without linking it to a result.
|
|
87
|
+
* Pass the returned reference to this runtime's writeAttachment to link it later.
|
|
88
|
+
*/
|
|
89
|
+
emitAttachment: (attachmentContentOrPath: Buffer | string, options: Pick<AttachmentOptions, "contentType" | "fileExtension">) => AttachmentReference;
|
|
90
|
+
writeAttachment: (rootUuid: string, parentStepUuid: string | null | undefined, attachmentName: string, attachmentContentOrPath: Buffer | string | AttachmentReference, options: AttachmentOptions & {
|
|
82
91
|
wrapInStep?: boolean;
|
|
83
92
|
timestamp?: number;
|
|
84
93
|
}) => void;
|
|
@@ -87,3 +96,4 @@ export declare class ReporterRuntime {
|
|
|
87
96
|
applyRuntimeMessages: (rootUuid: string, messages: RuntimeMessage[]) => void;
|
|
88
97
|
applyGlobalRuntimeMessages: (messages: RuntimeMessage[]) => void;
|
|
89
98
|
}
|
|
99
|
+
export {};
|
|
@@ -4,7 +4,7 @@ export * from "./utils.js";
|
|
|
4
4
|
export * from "./testplan.js";
|
|
5
5
|
export * from "./factory.js";
|
|
6
6
|
export { LifecycleState } from "./LifecycleState.js";
|
|
7
|
-
export { type StepStack, DefaultStepStack, ReporterRuntime, ShallowStepsStack } from "./ReporterRuntime.js";
|
|
7
|
+
export { type AttachmentReference, type StepStack, DefaultStepStack, ReporterRuntime, ShallowStepsStack, } from "./ReporterRuntime.js";
|
|
8
8
|
export { InMemoryWriter } from "./writer/InMemoryWriter.js";
|
|
9
9
|
export { FileSystemWriter } from "./writer/FileSystemWriter.js";
|
|
10
10
|
export { MessageWriter } from "./writer/MessageWriter.js";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { Label } from "../../model.js";
|
|
2
2
|
import type { TestPlanV1 } from "../types.js";
|
|
3
|
-
export declare const parseTestPlan: (
|
|
3
|
+
export declare const parseTestPlan: (options?: {
|
|
4
|
+
includeMutedTests?: boolean;
|
|
5
|
+
}) => TestPlanV1 | undefined;
|
|
4
6
|
export declare const includedInTestPlan: (testPlan: TestPlanV1, subject: {
|
|
5
7
|
allureId?: string;
|
|
6
8
|
id?: string;
|
|
7
9
|
fullName?: string;
|
|
8
10
|
nativeSelector?: string;
|
|
9
11
|
tags?: string[];
|
|
12
|
+
}, options?: {
|
|
13
|
+
enableMutedTests?: boolean;
|
|
10
14
|
}) => boolean;
|
|
11
15
|
export declare const addSkipLabel: (labels: Label[]) => void;
|
|
12
16
|
export declare const addSkipLabelAsMeta: (name: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AllureMetricResult, FixtureResult, Globals, Label, LabelName, Link, LinkType, Parameter, StepResult, TestResult, TestResultContainer } from "../../model.js";
|
|
2
2
|
import type { Category, EnvironmentInfo } from "../types.js";
|
|
3
3
|
export declare const ALLURE_METADATA_CONTENT_TYPE = "application/vnd.allure.metadata+json";
|
|
4
4
|
export declare const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = "application/vnd.allure.message+json";
|
|
@@ -41,7 +41,7 @@ export interface Writer {
|
|
|
41
41
|
writeEnvironmentInfo(info: EnvironmentInfo): void;
|
|
42
42
|
writeCategoriesDefinitions(categories: Category[]): void;
|
|
43
43
|
writeGlobals(distFileName: string, info: Globals): void;
|
|
44
|
-
|
|
44
|
+
writeMetricResults?(distFileName: string, results: AllureMetricResult[]): void;
|
|
45
45
|
}
|
|
46
46
|
export type TestScope = {
|
|
47
47
|
uuid: string;
|
|
@@ -52,6 +52,10 @@ export type TestScope = {
|
|
|
52
52
|
parameters: Parameter[];
|
|
53
53
|
description?: string;
|
|
54
54
|
descriptionHtml?: string;
|
|
55
|
+
precondition?: string;
|
|
56
|
+
preconditionHtml?: string;
|
|
57
|
+
expectedResult?: string;
|
|
58
|
+
expectedResultHtml?: string;
|
|
55
59
|
};
|
|
56
60
|
export type FixtureType = "before" | "after";
|
|
57
61
|
export type FixtureResultWrapper = {
|
|
@@ -17,6 +17,8 @@ export declare const getRelativePath: (filepath: string, searchFrom?: string) =>
|
|
|
17
17
|
export declare const getPosixPath: (filepath: string) => string;
|
|
18
18
|
export declare const deepClone: <T>(obj: T) => T;
|
|
19
19
|
export declare const getSuiteLabels: (suites: readonly string[]) => Label[];
|
|
20
|
+
/** Returns generated suite labels for levels not already present in the result. */
|
|
21
|
+
export declare const getDefaultSuiteLabels: (test: TestResult, suites: readonly string[]) => Label[];
|
|
20
22
|
/**
|
|
21
23
|
* Resolves suite labels for the given test results and add default lables if there is no any suite label.
|
|
22
24
|
* @example
|
|
@@ -30,6 +32,7 @@ export declare const getSuiteLabels: (suites: readonly string[]) => Label[];
|
|
|
30
32
|
*/
|
|
31
33
|
export declare const ensureSuiteLabels: (test: Partial<TestResult>, defaultSuites: readonly string[]) => Label[];
|
|
32
34
|
export declare const escapeRegExp: (value: string) => string;
|
|
35
|
+
export declare const isUrl: (potentialUrl: string) => boolean;
|
|
33
36
|
export declare const applyLinkTemplate: (template: LinkTemplate, value: string) => string;
|
|
34
37
|
export declare const formatLink: (templates: LinkConfig, link: Link) => Link;
|
|
35
38
|
export declare const formatLinks: (templates: LinkConfig, links: readonly Link[]) => Link[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AllureMetricResult, Globals, TestResult, TestResultContainer } from "../../../model.js";
|
|
2
2
|
import type { Category, EnvironmentInfo } from "../../types.js";
|
|
3
3
|
import type { Writer } from "../types.js";
|
|
4
4
|
export declare class FileSystemWriter implements Writer {
|
|
@@ -13,6 +13,6 @@ export declare class FileSystemWriter implements Writer {
|
|
|
13
13
|
writeGroup(result: TestResultContainer): void;
|
|
14
14
|
writeResult(result: TestResult): void;
|
|
15
15
|
writeGlobals(distFileName: string, info: Globals): void;
|
|
16
|
-
|
|
16
|
+
writeMetricResults(distFileName: string, results: AllureMetricResult[]): void;
|
|
17
17
|
private buildPath;
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AllureMetricResult, Globals, TestResult, TestResultContainer } from "../../../model.js";
|
|
2
2
|
import type { AllureResults, Category, EnvironmentInfo } from "../../types.js";
|
|
3
3
|
import type { Writer } from "../types.js";
|
|
4
4
|
export declare class InMemoryWriter implements Writer, AllureResults {
|
|
@@ -8,7 +8,7 @@ export declare class InMemoryWriter implements Writer, AllureResults {
|
|
|
8
8
|
categories?: Category[];
|
|
9
9
|
envInfo?: Record<string, string | undefined>;
|
|
10
10
|
globals?: Record<string, Globals>;
|
|
11
|
-
|
|
11
|
+
metrics?: Record<string, AllureMetricResult[]>;
|
|
12
12
|
writeGroup(result: TestResultContainer): void;
|
|
13
13
|
writeResult(result: TestResult): void;
|
|
14
14
|
writeAttachment(distFileName: string, content: Buffer): void;
|
|
@@ -16,5 +16,5 @@ export declare class InMemoryWriter implements Writer, AllureResults {
|
|
|
16
16
|
writeCategoriesDefinitions(categories: Category[]): void;
|
|
17
17
|
writeEnvironmentInfo(envInfo: EnvironmentInfo): void;
|
|
18
18
|
writeGlobals(distFileName: string, info: Globals): void;
|
|
19
|
-
|
|
19
|
+
writeMetricResults(distFileName: string, results: AllureMetricResult[]): void;
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EventEmitter } from "node:events";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AllureMetricResult, Globals, TestResult, TestResultContainer } from "../../../model.js";
|
|
3
3
|
import type { Category, EnvironmentInfo } from "../../types.js";
|
|
4
4
|
import type { Writer } from "../types.js";
|
|
5
5
|
export declare class MessageWriter implements Writer {
|
|
@@ -14,5 +14,5 @@ export declare class MessageWriter implements Writer {
|
|
|
14
14
|
writeGroup(result: TestResultContainer): void;
|
|
15
15
|
writeResult(result: TestResult): void;
|
|
16
16
|
writeGlobals(distFileName: string, info: Globals): void;
|
|
17
|
-
|
|
17
|
+
writeMetricResults(distFileName: string, results: AllureMetricResult[]): void;
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AllureMetricResult, type AttachmentOptions, type GlobalErrorArgs, type Label, type LabelName, type Link, type LinkType, type ParameterMode, type ParameterOptions, Status } from "../../model.js";
|
|
2
2
|
import type { RuntimeMessage } from "../types.js";
|
|
3
3
|
import type { SyncTestRuntime, TestRuntime } from "./types.js";
|
|
4
4
|
export declare abstract class BaseMessageTestRuntime implements TestRuntime {
|
|
@@ -11,6 +11,10 @@ export declare abstract class BaseMessageTestRuntime implements TestRuntime {
|
|
|
11
11
|
parameter(name: string, value: string, options?: ParameterOptions): Promise<void>;
|
|
12
12
|
description(markdown: string): Promise<void>;
|
|
13
13
|
descriptionHtml(html: string): Promise<void>;
|
|
14
|
+
precondition(markdown: string): Promise<void>;
|
|
15
|
+
preconditionHtml(html: string): Promise<void>;
|
|
16
|
+
expectedResult(markdown: string): Promise<void>;
|
|
17
|
+
expectedResultHtml(html: string): Promise<void>;
|
|
14
18
|
displayName(name: string): Promise<void>;
|
|
15
19
|
historyId(value: string): Promise<void>;
|
|
16
20
|
testCaseId(value: string): Promise<void>;
|
|
@@ -19,7 +23,7 @@ export declare abstract class BaseMessageTestRuntime implements TestRuntime {
|
|
|
19
23
|
globalAttachment(name: string, content: Buffer | Uint8Array | string, options: AttachmentOptions): Promise<void>;
|
|
20
24
|
globalAttachmentFromPath(name: string, path: string, options: Omit<AttachmentOptions, "encoding">): Promise<void>;
|
|
21
25
|
globalError(...args: GlobalErrorArgs): Promise<void>;
|
|
22
|
-
|
|
26
|
+
metrics(...results: AllureMetricResult[]): Promise<void>;
|
|
23
27
|
logStep(name: string, status?: Status, error?: Error): Promise<void>;
|
|
24
28
|
step<T = void>(name: string, body: () => T | PromiseLike<T>): Promise<T>;
|
|
25
29
|
stepDisplayName(name: string): Promise<void>;
|
|
@@ -19,6 +19,10 @@ export declare class NoopSyncTestRuntime implements SyncTestRuntime {
|
|
|
19
19
|
globalError(..._: GlobalErrorArgs): void;
|
|
20
20
|
description(_: string): void;
|
|
21
21
|
descriptionHtml(_: string): void;
|
|
22
|
+
precondition(_: string): void;
|
|
23
|
+
preconditionHtml(_: string): void;
|
|
24
|
+
expectedResult(_: string): void;
|
|
25
|
+
expectedResultHtml(_: string): void;
|
|
22
26
|
displayName(_: string): void;
|
|
23
27
|
historyId(_: string): void;
|
|
24
28
|
labels(..._: {
|
|
@@ -50,9 +54,13 @@ export declare class NoopTestRuntime implements TestRuntime {
|
|
|
50
54
|
globalAttachment(): Promise<void>;
|
|
51
55
|
globalAttachmentFromPath(): Promise<void>;
|
|
52
56
|
globalError(..._: GlobalErrorArgs): Promise<void>;
|
|
53
|
-
|
|
57
|
+
metrics(): Promise<void>;
|
|
54
58
|
description(): Promise<void>;
|
|
55
59
|
descriptionHtml(): Promise<void>;
|
|
60
|
+
precondition(): Promise<void>;
|
|
61
|
+
preconditionHtml(): Promise<void>;
|
|
62
|
+
expectedResult(): Promise<void>;
|
|
63
|
+
expectedResultHtml(): Promise<void>;
|
|
56
64
|
displayName(): Promise<void>;
|
|
57
65
|
historyId(): Promise<void>;
|
|
58
66
|
labels(): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AllureMetricResult, AttachmentOptions, GlobalErrorArgs, Label, Link, ParameterMode, ParameterOptions, Status } from "../../model.js";
|
|
2
2
|
export interface StepContext {
|
|
3
3
|
displayName: (name: string) => void | PromiseLike<void>;
|
|
4
4
|
parameter: (name: string, value: string, mode?: ParameterMode) => void | PromiseLike<void>;
|
|
@@ -13,6 +13,10 @@ export interface SyncTestRuntime {
|
|
|
13
13
|
parameter: (name: string, value: string, options?: ParameterOptions) => void;
|
|
14
14
|
description: (markdown: string) => void;
|
|
15
15
|
descriptionHtml: (html: string) => void;
|
|
16
|
+
precondition: (markdown: string) => void;
|
|
17
|
+
preconditionHtml: (html: string) => void;
|
|
18
|
+
expectedResult: (markdown: string) => void;
|
|
19
|
+
expectedResultHtml: (html: string) => void;
|
|
16
20
|
displayName: (name: string) => void;
|
|
17
21
|
historyId: (value: string) => void;
|
|
18
22
|
testCaseId: (value: string) => void;
|
|
@@ -32,6 +36,10 @@ export interface TestRuntime {
|
|
|
32
36
|
parameter: (name: string, value: string, options?: ParameterOptions) => PromiseLike<void>;
|
|
33
37
|
description: (markdown: string) => PromiseLike<void>;
|
|
34
38
|
descriptionHtml: (html: string) => PromiseLike<void>;
|
|
39
|
+
precondition: (markdown: string) => PromiseLike<void>;
|
|
40
|
+
preconditionHtml: (html: string) => PromiseLike<void>;
|
|
41
|
+
expectedResult: (markdown: string) => PromiseLike<void>;
|
|
42
|
+
expectedResultHtml: (html: string) => PromiseLike<void>;
|
|
35
43
|
displayName: (name: string) => PromiseLike<void>;
|
|
36
44
|
historyId: (value: string) => PromiseLike<void>;
|
|
37
45
|
testCaseId: (value: string) => PromiseLike<void>;
|
|
@@ -39,7 +47,7 @@ export interface TestRuntime {
|
|
|
39
47
|
globalAttachment: (name: string, content: Buffer | Uint8Array | string, options: AttachmentOptions) => PromiseLike<void>;
|
|
40
48
|
globalAttachmentFromPath: (name: string, path: string, options: Omit<AttachmentOptions, "encoding">) => PromiseLike<void>;
|
|
41
49
|
globalError: (...args: GlobalErrorArgs) => PromiseLike<void>;
|
|
42
|
-
|
|
50
|
+
metrics: (...results: AllureMetricResult[]) => PromiseLike<void>;
|
|
43
51
|
attachmentFromPath: (name: string, path: string, options: Omit<AttachmentOptions, "encoding">) => PromiseLike<void>;
|
|
44
52
|
logStep: (name: string, status?: Status, error?: Error) => PromiseLike<void>;
|
|
45
53
|
step: <T = void>(name: string, body: () => T | PromiseLike<T>) => PromiseLike<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AllureMetricResult, ErrorStatus, Globals, Label, Link, Parameter, Status, StatusDetails, TestResult, TestResultContainer } from "../model.js";
|
|
2
2
|
type RuntimeMessageBase<T extends string> = {
|
|
3
3
|
type: T;
|
|
4
4
|
};
|
|
@@ -9,6 +9,10 @@ export type RuntimeMetadataMessage = RuntimeMessageBase<"metadata"> & {
|
|
|
9
9
|
parameters?: Parameter[];
|
|
10
10
|
description?: string;
|
|
11
11
|
descriptionHtml?: string;
|
|
12
|
+
precondition?: string;
|
|
13
|
+
preconditionHtml?: string;
|
|
14
|
+
expectedResult?: string;
|
|
15
|
+
expectedResultHtml?: string;
|
|
12
16
|
testCaseId?: string;
|
|
13
17
|
historyId?: string;
|
|
14
18
|
displayName?: string;
|
|
@@ -76,10 +80,10 @@ export type RuntimeGlobalErrorMessage = RuntimeMessageBase<"global_error"> & {
|
|
|
76
80
|
status?: ErrorStatus;
|
|
77
81
|
};
|
|
78
82
|
};
|
|
79
|
-
export type
|
|
80
|
-
data:
|
|
83
|
+
export type RuntimeMetricResultMessage = RuntimeMessageBase<"metric_result"> & {
|
|
84
|
+
data: AllureMetricResult[];
|
|
81
85
|
};
|
|
82
|
-
export type RuntimeMessage = RuntimeMetadataMessage | RuntimeStartStepMessage | RuntimeStepMetadataMessage | RuntimeStopStepMessage | RuntimeAttachmentContentMessage | RuntimeAttachmentPathMessage | RuntimeGlobalAttachmentContentMessage | RuntimeGlobalAttachmentPathMessage | RuntimeGlobalErrorMessage |
|
|
86
|
+
export type RuntimeMessage = RuntimeMetadataMessage | RuntimeStartStepMessage | RuntimeStepMetadataMessage | RuntimeStopStepMessage | RuntimeAttachmentContentMessage | RuntimeAttachmentPathMessage | RuntimeGlobalAttachmentContentMessage | RuntimeGlobalAttachmentPathMessage | RuntimeGlobalErrorMessage | RuntimeMetricResultMessage;
|
|
83
87
|
export interface TestPlanV1Test {
|
|
84
88
|
id?: string | number;
|
|
85
89
|
selector?: string;
|
|
@@ -87,6 +91,7 @@ export interface TestPlanV1Test {
|
|
|
87
91
|
export interface TestPlanV1 {
|
|
88
92
|
version: "1.0";
|
|
89
93
|
tests: TestPlanV1Test[];
|
|
94
|
+
mutedTests?: TestPlanV1Test[];
|
|
90
95
|
}
|
|
91
96
|
export type EnvironmentInfo = Record<string, string | undefined>;
|
|
92
97
|
export interface Category {
|
|
@@ -113,7 +118,7 @@ export interface AllureResults {
|
|
|
113
118
|
groups: TestResultContainer[];
|
|
114
119
|
attachments: Record<string, Buffer | string>;
|
|
115
120
|
globals?: Record<string, Globals>;
|
|
116
|
-
|
|
121
|
+
metrics?: Record<string, AllureMetricResult[]>;
|
|
117
122
|
envInfo?: EnvironmentInfo;
|
|
118
123
|
categories?: Category[];
|
|
119
124
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { ErrorStatus, FixtureResult, GlobalErrorArgs, Label, Link, StatusDetails, StepResult, TestResult } from "../model.js";
|
|
2
2
|
import { LabelName, Status } from "../model.js";
|
|
3
|
-
import type { RuntimeGlobalAttachmentContentMessage, RuntimeGlobalAttachmentPathMessage, RuntimeGlobalErrorMessage,
|
|
3
|
+
import type { RuntimeGlobalAttachmentContentMessage, RuntimeGlobalAttachmentPathMessage, RuntimeGlobalErrorMessage, RuntimeMetricResultMessage, RuntimeMessage, SerializeOptions, SerializerReplacerFunc } from "./types.js";
|
|
4
4
|
export declare const getStatusFromError: (error: unknown) => ErrorStatus;
|
|
5
5
|
/**
|
|
6
6
|
* https://github.com/chalk/strip-ansi
|
|
7
7
|
*/
|
|
8
8
|
export declare const stripAnsi: (str: string) => string;
|
|
9
|
+
/** Extract error details, optionally using an adapter-specific serializer for assertion values. */
|
|
9
10
|
export declare const getMessageAndTraceFromError: (error: Error | {
|
|
10
11
|
message?: string;
|
|
11
12
|
stack?: string;
|
|
12
|
-
}) => StatusDetails;
|
|
13
|
+
}, serializeValue?: (value: unknown) => string) => StatusDetails;
|
|
13
14
|
/**
|
|
14
15
|
* Normalize global errors before transport, while non-enumerable error properties
|
|
15
16
|
* and assertion metadata are still available for extraction and classification.
|
|
@@ -52,7 +53,7 @@ export declare const isAnyStepFailed: (item: StepResult | TestResult | FixtureRe
|
|
|
52
53
|
export declare const isAllStepsEnded: (item: StepResult | TestResult | FixtureResult) => boolean;
|
|
53
54
|
export declare const hasLabel: (testResult: TestResult, labelName: LabelName | string) => boolean;
|
|
54
55
|
export declare const hasStepMessage: (messages: RuntimeMessage[]) => boolean;
|
|
55
|
-
export declare const isGlobalRuntimeMessage: (message: RuntimeMessage) => message is RuntimeGlobalAttachmentContentMessage | RuntimeGlobalAttachmentPathMessage | RuntimeGlobalErrorMessage |
|
|
56
|
+
export declare const isGlobalRuntimeMessage: (message: RuntimeMessage) => message is RuntimeGlobalAttachmentContentMessage | RuntimeGlobalAttachmentPathMessage | RuntimeGlobalErrorMessage | RuntimeMetricResultMessage;
|
|
56
57
|
export declare const getStepsMessagesPair: (messages: RuntimeMessage[]) => RuntimeMessage[][];
|
|
57
58
|
export declare const getUnfinishedStepsMessages: (messages: RuntimeMessage[]) => RuntimeMessage[][];
|
|
58
59
|
export declare const isPromise: <T = any>(obj: any) => obj is PromiseLike<T>;
|
package/dist/types/sync.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { allureId, attachment, attachmentPath, attachTrace, description, descriptionHtml, displayName, epic, feature, globalAttachment, globalAttachmentPath, globalError, historyId, issue, label, labels, layer, link, links, logStep, owner, parameter, parentSuite, severity, step, story, subSuite, suite, tag, tags, testCaseId, tms, } from "./syncFacade.js";
|
|
1
|
+
export { allureId, attachment, attachmentPath, attachTrace, description, descriptionHtml, displayName, epic, expectedResult, expectedResultHtml, feature, globalAttachment, globalAttachmentPath, globalError, historyId, issue, label, labels, layer, link, links, logStep, owner, parameter, parentSuite, precondition, preconditionHtml, severity, step, story, subSuite, suite, tag, tags, testCaseId, tms, } from "./syncFacade.js";
|
|
2
2
|
export type { SyncStepContext } from "./sdk/runtime/types.js";
|
|
3
3
|
export type { Attachment, AttachmentOptions, ErrorDetails, ErrorStatus, FixtureResult, GlobalErrorArgs, Globals, ImageDiffAttachment, Label, Link, Parameter, ParameterMode, ParameterOptions, StatusDetails, StepResult, TestOrStepResult, TestResult, TestResultContainer, } from "./model.js";
|
|
4
4
|
export { ContentType, LabelName, LinkType, Severity, Stage, Status, StatusByPriority } from "./model.js";
|
|
@@ -8,6 +8,10 @@ export declare const links: (...linksList: Link[]) => void;
|
|
|
8
8
|
export declare const parameter: (name: string, value: string, options?: ParameterOptions) => void;
|
|
9
9
|
export declare const description: (markdown: string) => void;
|
|
10
10
|
export declare const descriptionHtml: (html: string) => void;
|
|
11
|
+
export declare const precondition: (markdown: string) => void;
|
|
12
|
+
export declare const preconditionHtml: (html: string) => void;
|
|
13
|
+
export declare const expectedResult: (markdown: string) => void;
|
|
14
|
+
export declare const expectedResultHtml: (html: string) => void;
|
|
11
15
|
export declare const displayName: (name: string) => void;
|
|
12
16
|
export declare const historyId: (value: string) => void;
|
|
13
17
|
export declare const testCaseId: (value: string) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure-js-commons",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "Allure JS Commons",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -93,11 +93,8 @@
|
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@babel/cli": "^8.0.1",
|
|
95
95
|
"@babel/core": "^7.28.0",
|
|
96
|
-
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
|
|
97
96
|
"@babel/preset-env": "^7.28.0",
|
|
98
97
|
"@babel/preset-typescript": "^7.27.1",
|
|
99
|
-
"@types/babel__core": "^7.20.5",
|
|
100
|
-
"@types/babel__preset-env": "^7.10.0",
|
|
101
98
|
"@types/md5": "^2",
|
|
102
99
|
"@types/node": "^26.0.1",
|
|
103
100
|
"npm-run-all2": "^9.0.2",
|
|
@@ -106,7 +103,7 @@
|
|
|
106
103
|
"vitest": "^4.1.11"
|
|
107
104
|
},
|
|
108
105
|
"peerDependencies": {
|
|
109
|
-
"allure-playwright": "3.
|
|
106
|
+
"allure-playwright": "3.15.0"
|
|
110
107
|
},
|
|
111
108
|
"peerDependenciesMeta": {
|
|
112
109
|
"allure-playwright": {
|