allure-cypress 3.13.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 +15 -1
- package/dist/cjs/browser/events/cypress.js +17 -5
- package/dist/cjs/browser/events/cypress.js.map +1 -1
- package/dist/cjs/browser/lifecycle.js +3 -1
- package/dist/cjs/browser/lifecycle.js.map +1 -1
- package/dist/cjs/browser/runtime.js +83 -14
- package/dist/cjs/browser/runtime.js.map +1 -1
- package/dist/cjs/browser/serialize.js +15 -17
- package/dist/cjs/browser/serialize.js.map +1 -1
- package/dist/cjs/browser/steps.js +4 -2
- package/dist/cjs/browser/steps.js.map +1 -1
- package/dist/cjs/browser/utils.js +3 -1
- package/dist/cjs/browser/utils.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/reporter.js +97 -56
- package/dist/cjs/reporter.js.map +1 -1
- package/dist/esm/browser/events/cypress.js +17 -5
- package/dist/esm/browser/events/cypress.js.map +1 -1
- package/dist/esm/browser/lifecycle.js +2 -1
- package/dist/esm/browser/lifecycle.js.map +1 -1
- package/dist/esm/browser/runtime.js +83 -15
- package/dist/esm/browser/runtime.js.map +1 -1
- package/dist/esm/browser/serialize.js +15 -17
- package/dist/esm/browser/serialize.js.map +1 -1
- package/dist/esm/browser/steps.js +3 -2
- package/dist/esm/browser/steps.js.map +1 -1
- package/dist/esm/browser/utils.js +2 -1
- package/dist/esm/browser/utils.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/reporter.js +98 -57
- package/dist/esm/reporter.js.map +1 -1
- package/dist/types/browser/runtime.d.ts +7 -2
- package/dist/types/browser/steps.d.ts +1 -1
- package/dist/types/reporter.d.ts +5 -0
- package/package.json +4 -7
package/dist/cjs/reporter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","names":["_allureJsCommons","require","_reporter","_utils","_excluded","_excluded2","_excluded3","_excluded4","_excluded5","_excluded6","_excluded7","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_objectWithoutProperties","i","_objectWithoutPropertiesLoose","n","indexOf","propertyIsEnumerable","call","hasOwnProperty","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","set","has","TypeError","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","String","Number","_classPrivateFieldGet","s","get","_assertClassBrand","_fixtureNames","WeakMap","_endAllSpecs","_applyAllureCypressMessages","_startRun","_startSuite","_pushNewSuiteScope","_stopSuite","_writeLastSuiteScope","_startHook","_stopHook","_startTest","_addNewTestResult","_failHookAndTest","_passTest","_skipTest","_addSkippedTest","_stopTest","_stopExistingTestResult","_fixTestStepStops","_fixFixtureStepStops","_fixStepStops","_startStep","_stopStep","_finalizeStep","_applyRuntimeApiMessages","_emitPreviousTestScope","_resolveRootUuid","_attachSpecVideo","_emitRemainingScopes","_initializeSpecContext","AllureCypress","constructor","config","undefined","Map","on","reportAllureCypressSpecMessages","args","reportFinalAllureCypressSpecMessages","isInteractive","endSpec","absolutePath","onAfterSpec","onAfterRun","spec","results","_results$video","absolute","video","endRun","allureRuntime","writeEnvironmentInfo","writeCategoriesDefinitions","specAbsolutePath","cypressVideoPath","specContext","specContextByAbsolutePath","delete","_ref","messages","message","type","context","data","_ref2","id","name","root","suiteNames","suiteId","scope","startScope","suiteScopes","suiteIdToScope","suiteScopeToId","_ref3","pop","writeScope","_ref4","scopeType","position","start","isEach","isAfterEach","testScope","last","fixture","startFixture","status","_ref5","duration","fixtureUuid","updateFixture","_fixture$status","Status","PASSED","stopFixture","_ref6","fullNameSuffix","testResultData","test","videoScope","_ref7","scopes","labels","metadataLabels","otherTestData","projectName","getProjectName","posixPath","getPosixPath","specPath","fullNameBase","concat","legacyFullName","titlePath","split","startTest","stage","Stage","RUNNING","getLanguageLabel","getFrameworkLabel","getSuiteLabels","getEnvironmentLabels","getHostLabel","getThreadLabel","getPackageLabel","getFallbackTestCaseIdLabel","md5","fullName","_ref8","statusDetails","setError","result","assign","_classPrivateFieldGet2","applyGlobalRuntimeMessages","toGlobalErrorMessage","testUuid","updateTest","failed","testResult","_ref9","SKIPPED","_ref0","suites","retries","map","Boolean","writeTest","_ref1","_ref10","parameters","toString","excluded","FINISHED","stopTest","_ref11","stop","steps","step","at","_ref12","properties","rootUuid","stepUuid","startStep","stepsByFrontEndId","_ref13","updateStep","stopStep","_ref14","applyRuntimeMessages","_context$fixture","shouldVideoBeAttached","videoOnFailOnly","writeAttachment","contentType","ContentType","MP4","getRelativePath","resultsDir","rest","ReporterRuntime","writer","createDefaultWriter","exports","createRuntimeState","allureConfig","getRuntimeConfigDefaults","initialized","testPlan","parseTestPlan","projectDir","getProjectRoot","stepStack","stepsToFinalize","nextApiStepId","stepsFromCommands","enabled","DEFAULT_RUNTIME_CONFIG","maxArgumentLength","maxArgumentDepth","initializeRuntimeState","cypressConfig","allureState","expose","allure","env","allureCypress","hasCypressConfig","allureCypressReporter","attachToCypress","details"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { ContentType, Stage, Status } from \"allure-js-commons\";\nimport type { FixtureResult, StatusDetails, TestResult } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport {\n ReporterRuntime,\n createDefaultWriter,\n getEnvironmentLabels,\n getFallbackTestCaseIdLabel,\n getFrameworkLabel,\n getHostLabel,\n getLanguageLabel,\n getPackageLabel,\n getPosixPath,\n getProjectName,\n getProjectRoot,\n getRelativePath,\n getSuiteLabels,\n getThreadLabel,\n md5,\n parseTestPlan,\n} from \"allure-js-commons/sdk/reporter\";\nimport type Cypress from \"cypress\";\n\nimport type {\n AllureCypressConfig,\n AllureCypressTaskArgs,\n AllureSpecState,\n CypressFailMessage,\n CypressHookEndMessage,\n CypressHookStartMessage,\n CypressSkippedTestMessage,\n CypressStepFinalizeMessage,\n CypressStepStartMessage,\n CypressStepStopMessage,\n CypressSuiteEndMessage,\n CypressSuiteStartMessage,\n CypressTestEndMessage,\n CypressTestSkipMessage,\n CypressTestStartMessage,\n SpecContext,\n} from \"./types.js\";\nimport { DEFAULT_RUNTIME_CONFIG, last } from \"./utils.js\";\n\nexport class AllureCypress {\n allureRuntime: ReporterRuntime;\n specContextByAbsolutePath = new Map<string, SpecContext>();\n #fixtureNames = new Map<string, string>();\n videoOnFailOnly: boolean = false;\n\n constructor(config: AllureCypressConfig = {}) {\n const { resultsDir, videoOnFailOnly = false, ...rest } = config;\n\n this.videoOnFailOnly = videoOnFailOnly;\n this.allureRuntime = new ReporterRuntime({\n writer: createDefaultWriter({ resultsDir }),\n ...rest,\n });\n }\n\n attachToCypress = (on: Cypress.PluginEvents) => {\n on(\"task\", {\n reportAllureCypressSpecMessages: (args: AllureCypressTaskArgs) => {\n this.#applyAllureCypressMessages(args);\n return null;\n },\n reportFinalAllureCypressSpecMessages: (args: AllureCypressTaskArgs) => {\n this.#applyAllureCypressMessages(args);\n if (args.isInteractive) {\n // In non-interactive mode the spec is ended via the 'after:spec' event instead\n // to get the spec's video.\n this.endSpec(args.absolutePath);\n }\n return null;\n },\n });\n\n // Emits the remaining fixtures and writes the video of the spec.\n // In interactive mode it's invoked through the `reportFinalAllureCypressSpecMessages` task.\n on(\"after:spec\", this.onAfterSpec);\n\n // Emits the categories and env info. Doesn't work in interactive mode unless\n // `experimentalInteractiveRunEvents` is set.\n on(\"after:run\", this.onAfterRun);\n };\n\n /**\n * Forward the `after:spec` event into Allure Cypress using this function if\n * you need to define your own handler or combine Allure Cypress with other\n * plugins. More info [here](https://github.com/allure-framework/allure-js/blob/main/packages/allure-cypress/README.md#setupnodeevents-limitations).\n * @param spec The first argument of the `after:spec` event.\n * @param results The second argument of the `after:spec` event. It's `undefined` in interactive mode.\n * @example\n * ```javascript\n * import { defineConfig } from \"cypress\";\n * import { allureCypress } from \"allure-cypress/reporter\";\n *\n * export default defineConfig({\n * setupNodeEvents: (on, config) => {\n * const allureReporter = allureCypress(on, config);\n * on(\"after:spec\", (spec, results) => {\n * allureReporter.onAfterSpec(spec, results);\n * });\n * return config;\n * }\n * // ...\n * });\n * ```\n */\n onAfterSpec = (spec: Cypress.Spec, results: CypressCommandLine.RunResult | undefined) => {\n this.endSpec(spec.absolute, results?.video ?? undefined);\n };\n\n /**\n * Forward the `after:run` event into Allure Cypress using this function if\n * you need to define your own handler or combine Allure Cypress with other\n * plugins. More info [here](https://github.com/allure-framework/allure-js/blob/main/packages/allure-cypress/README.md#setupnodeevents-limitations).\n * @param results The argument of the `after:run` event. It's `undefined` in interactive mode.\n * @example\n * ```javascript\n * import { defineConfig } from \"cypress\";\n * import { allureCypress } from \"allure-cypress/reporter\";\n *\n * export default defineConfig({\n * setupNodeEvents: (on, config) => {\n * const allureReporter = allureCypress(on, config);\n * on(\"after:run\", (results) => {\n * allureReporter.onAfterRun(results);\n * });\n * return config;\n * }\n * // ...\n * });\n * ```\n */\n onAfterRun = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n results: CypressCommandLine.CypressFailedRunResult | CypressCommandLine.CypressRunResult | undefined,\n ) => {\n this.endRun();\n };\n\n endRun = () => {\n this.#endAllSpecs();\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n };\n\n endSpec = (specAbsolutePath: string, cypressVideoPath?: string) => {\n const specContext = this.specContextByAbsolutePath.get(specAbsolutePath);\n if (specContext) {\n this.#attachSpecVideo(specContext, cypressVideoPath);\n this.#emitRemainingScopes(specContext);\n this.specContextByAbsolutePath.delete(specAbsolutePath);\n }\n };\n\n #endAllSpecs = () => {\n for (const specAbsolutePath of this.specContextByAbsolutePath.keys()) {\n this.endSpec(specAbsolutePath);\n }\n };\n\n #applyAllureCypressMessages = ({ messages, absolutePath }: AllureCypressTaskArgs) => {\n messages.forEach((message) => {\n if (message.type === \"cypress_run_start\") {\n this.#startRun(absolutePath);\n return;\n }\n\n const context = this.specContextByAbsolutePath.get(absolutePath);\n if (!context) {\n return;\n }\n\n switch (message.type) {\n case \"cypress_suite_start\":\n this.#startSuite(context, message);\n break;\n case \"cypress_suite_end\":\n this.#stopSuite(context, message);\n break;\n case \"cypress_hook_start\":\n this.#startHook(context, message);\n break;\n case \"cypress_hook_end\":\n this.#stopHook(context, message);\n break;\n case \"cypress_test_start\":\n this.#startTest(context, message);\n break;\n case \"cypress_test_pass\":\n this.#passTest(context);\n break;\n case \"cypress_fail\":\n this.#failHookAndTest(context, message);\n break;\n case \"cypress_test_skip\":\n this.#skipTest(context, message);\n break;\n case \"cypress_skipped_test\":\n this.#addSkippedTest(context, message);\n break;\n case \"cypress_test_end\":\n this.#stopTest(context, message);\n break;\n case \"cypress_step_start\":\n this.#startStep(context, message.data);\n break;\n case \"cypress_step_stop\":\n this.#stopStep(context, message.data);\n break;\n case \"cypress_step_finalize\":\n this.#finalizeStep(context, message.data);\n break;\n default:\n this.#applyRuntimeApiMessages(context, message);\n break;\n }\n });\n };\n\n #startRun = (absolutePath: string) => {\n if (!this.specContextByAbsolutePath.has(absolutePath)) {\n this.#initializeSpecContext(absolutePath);\n }\n };\n\n #startSuite = (context: SpecContext, { data: { id, name, root } }: CypressSuiteStartMessage) => {\n this.#pushNewSuiteScope(context, id);\n if (!root) {\n this.#emitPreviousTestScope(context);\n context.suiteNames.push(name);\n }\n };\n\n #pushNewSuiteScope = (context: SpecContext, suiteId: string) => {\n const scope = this.allureRuntime.startScope();\n context.suiteScopes.push(scope);\n context.suiteIdToScope.set(suiteId, scope);\n context.suiteScopeToId.set(scope, suiteId);\n return scope;\n };\n\n #stopSuite = (context: SpecContext, { data: { root } }: CypressSuiteEndMessage) => {\n this.#emitPreviousTestScope(context);\n if (!root) {\n context.suiteNames.pop();\n }\n this.#writeLastSuiteScope(context);\n };\n\n #writeLastSuiteScope = (context: SpecContext) => {\n const scope = context.suiteScopes.pop();\n if (scope) {\n const suiteId = context.suiteScopeToId.get(scope);\n if (suiteId) {\n context.suiteScopeToId.delete(scope);\n context.suiteIdToScope.delete(suiteId);\n }\n this.allureRuntime.writeScope(scope);\n }\n };\n\n #startHook = (context: SpecContext, { data: { name, scopeType, position, start } }: CypressHookStartMessage) => {\n const isEach = scopeType === \"each\";\n const isAfterEach = position === \"after\" && isEach;\n if (!isAfterEach) {\n this.#emitPreviousTestScope(context);\n }\n\n const scope = isEach ? context.testScope : last(context.suiteScopes);\n if (scope) {\n context.fixture = this.allureRuntime.startFixture(scope, position, {\n name,\n start,\n status: undefined,\n });\n if (context.fixture) {\n this.#fixtureNames.set(context.fixture, name);\n }\n }\n };\n\n #stopHook = (context: SpecContext, { data: { duration } }: CypressHookEndMessage) => {\n const fixtureUuid = context.fixture;\n if (fixtureUuid) {\n this.allureRuntime.updateFixture(fixtureUuid, (fixture) => {\n fixture.status ??= Status.PASSED;\n });\n this.allureRuntime.stopFixture(fixtureUuid, { duration });\n this.#fixFixtureStepStops(fixtureUuid);\n this.#fixtureNames.delete(fixtureUuid);\n context.fixture = undefined;\n }\n };\n\n #startTest = (context: SpecContext, { data: { fullNameSuffix, ...testResultData } }: CypressTestStartMessage) => {\n this.#emitPreviousTestScope(context);\n const testScope = this.allureRuntime.startScope();\n context.testScope = testScope;\n context.test = this.#addNewTestResult(context, fullNameSuffix, testResultData, [\n context.videoScope,\n ...context.suiteScopes,\n testScope,\n ]);\n };\n\n #addNewTestResult = (\n context: SpecContext,\n fullNameSuffix: string,\n { labels: metadataLabels = [], ...otherTestData }: Partial<TestResult>,\n scopes: string[],\n ) => {\n const projectName = getProjectName();\n const posixPath = getPosixPath(context.specPath);\n const fullNameBase = projectName ? `${projectName}:${posixPath}` : posixPath;\n const legacyFullName = `${posixPath}#${fullNameSuffix}`;\n\n const titlePath = posixPath.split(\"/\").concat(context.suiteNames);\n\n return this.allureRuntime.startTest(\n {\n stage: Stage.RUNNING,\n labels: [\n getLanguageLabel(),\n getFrameworkLabel(\"cypress\"),\n ...getSuiteLabels(context.suiteNames),\n ...metadataLabels,\n ...getEnvironmentLabels(),\n getHostLabel(),\n getThreadLabel(),\n getPackageLabel(context.specPath),\n getFallbackTestCaseIdLabel(md5(legacyFullName)),\n ],\n fullName: `${fullNameBase}#${fullNameSuffix}`,\n titlePath: projectName ? [projectName, ...titlePath] : titlePath,\n ...otherTestData,\n },\n scopes,\n );\n };\n\n #failHookAndTest = (context: SpecContext, { data: { status, statusDetails } }: CypressFailMessage) => {\n const setError = (result: object) => Object.assign(result, { status, statusDetails });\n\n const fixtureUuid = context.fixture;\n if (fixtureUuid) {\n this.allureRuntime.updateFixture(fixtureUuid, setError);\n this.allureRuntime.applyGlobalRuntimeMessages([\n toGlobalErrorMessage(this.#fixtureNames.get(fixtureUuid) ?? \"hook\", statusDetails),\n ]);\n }\n\n const testUuid = context.test;\n if (testUuid) {\n this.allureRuntime.updateTest(testUuid, setError);\n }\n\n context.failed = true;\n };\n\n #passTest = (context: SpecContext) => {\n const testUuid = context.test;\n if (testUuid) {\n this.allureRuntime.updateTest(testUuid, (testResult) => {\n testResult.status = Status.PASSED;\n });\n }\n };\n\n #skipTest = (context: SpecContext, { data: { statusDetails } }: CypressTestSkipMessage) => {\n const testUuid = context.test;\n if (testUuid) {\n this.allureRuntime.updateTest(testUuid, (testResult) => {\n testResult.status = Status.SKIPPED;\n if (statusDetails) {\n testResult.statusDetails = statusDetails;\n }\n });\n }\n };\n\n #addSkippedTest = (\n context: SpecContext,\n { data: { fullNameSuffix, suites, duration, retries, ...testResultData } }: CypressSkippedTestMessage,\n ) => {\n // Tests skipped because of a hook error may share all suites of the current context\n // or just a part thereof (if it's from a sibling suite).\n const scopes = suites.map((s) => context.suiteIdToScope.get(s)).filter((s): s is string => Boolean(s));\n\n const testUuid = this.#addNewTestResult(context, fullNameSuffix, testResultData, [context.videoScope, ...scopes]);\n this.#stopExistingTestResult(testUuid, { duration, retries });\n this.allureRuntime.writeTest(testUuid);\n };\n\n #stopTest = (context: SpecContext, { data }: CypressTestEndMessage) => {\n const testUuid = context.test;\n if (testUuid) {\n this.#stopExistingTestResult(testUuid, data);\n this.allureRuntime.writeTest(testUuid);\n context.test = undefined;\n }\n };\n\n #stopExistingTestResult = (testUuid: string, { retries, duration }: CypressTestEndMessage[\"data\"]) => {\n this.allureRuntime.updateTest(testUuid, (testResult) => {\n if (retries > 0) {\n testResult.parameters.push({\n name: \"Retry\",\n value: retries.toString(),\n excluded: true,\n });\n }\n testResult.stage = Stage.FINISHED;\n });\n this.allureRuntime.stopTest(testUuid, { duration });\n this.#fixTestStepStops(testUuid);\n };\n\n #fixTestStepStops = (testUuid: string) => {\n this.allureRuntime.updateTest(testUuid, this.#fixStepStops);\n };\n\n #fixFixtureStepStops = (fixtureUuid: string) => {\n this.allureRuntime.updateFixture(fixtureUuid, this.#fixStepStops);\n };\n\n #fixStepStops = ({ stop, steps = [] }: TestResult | FixtureResult) => {\n if (stop) {\n // In some circumstances, steps becomes dangling and are stopped at the test end/hook end events, which happen\n // chronologically after the test or fixture ends. This leads to the steps' stop time being greater than the one\n // of the test/fixture.\n // The only steps that may be affected are the rightmost descendants of the test/fixture.\n for (let step = steps.at(-1); step; step = step.steps.at(-1)) {\n if (step.stop && step.stop > stop) {\n step.stop = stop;\n } else {\n // Steps are always stopped child-to-parent. If a step's stop time is OK, its substeps are also correct.\n return;\n }\n }\n }\n };\n\n #startStep = (context: SpecContext, { id, ...properties }: CypressStepStartMessage[\"data\"]) => {\n const rootUuid = this.#resolveRootUuid(context);\n if (rootUuid) {\n const stepUuid = this.allureRuntime.startStep(rootUuid, undefined, properties);\n if (stepUuid) {\n context.stepsByFrontEndId.set(id, stepUuid);\n }\n }\n };\n\n #stopStep = (context: SpecContext, { id, stop, ...properties }: CypressStepStopMessage[\"data\"]) => {\n const stepUuid = context.stepsByFrontEndId.get(id);\n if (stepUuid) {\n this.allureRuntime.updateStep(stepUuid, (r) => {\n Object.assign(r, properties);\n });\n this.allureRuntime.stopStep(stepUuid, { stop });\n }\n };\n\n #finalizeStep = (context: SpecContext, { id, ...properties }: CypressStepFinalizeMessage[\"data\"]) => {\n const stepUuid = context.stepsByFrontEndId.get(id);\n if (stepUuid) {\n this.allureRuntime.updateStep(stepUuid, (r) => {\n Object.assign(r, properties);\n });\n context.stepsByFrontEndId.delete(id);\n }\n };\n\n #applyRuntimeApiMessages = (context: SpecContext, message: RuntimeMessage) => {\n const rootUuid = this.#resolveRootUuid(context);\n if (rootUuid) {\n this.allureRuntime.applyRuntimeMessages(rootUuid, [message]);\n } else {\n this.allureRuntime.applyGlobalRuntimeMessages([message]);\n }\n };\n\n /**\n * We must defer emitting a test's scope until we receive all the test's `afterEach` hooks.\n * At the same time, we should report it as early as we can. That means we should call this\n * method in the following cases:\n * - when an `after` hook of the test starts (`after` hooks are called later than `afterEach`)\n * - when a `before` or `beforeEach` hook of the next test starts (in case the next test has `before`/`beforeEach` hooks)\n * - when the next test starts (in case the next test doesn't have `before`/`beforeEach` hooks)\n * - when the test's suite ends (in case the test is the last one in its suite, including the root suite of the spec)\n * - when a nested suite starts\n * - when the spec ends\n */\n #emitPreviousTestScope = (context: SpecContext) => {\n const testScope = context.testScope;\n\n // Checking the test allows us to tell `beforeEach` and `afterEach` apart.\n // Here we're interested in `afterEach` only.\n if (!context.test && testScope) {\n this.allureRuntime.writeScope(testScope);\n context.testScope = undefined;\n }\n };\n\n #resolveRootUuid = (context: SpecContext) => context.fixture ?? context.test;\n\n #attachSpecVideo = (context: SpecContext, cypressVideoPath?: string) => {\n const shouldVideoBeAttached = (!this.videoOnFailOnly || context.failed) && cypressVideoPath;\n if (shouldVideoBeAttached) {\n const fixtureUuid = this.allureRuntime.startFixture(context.videoScope, \"after\", {\n name: \"Cypress video\",\n status: Status.PASSED,\n stage: Stage.FINISHED,\n })!;\n this.allureRuntime.writeAttachment(fixtureUuid, undefined, \"Cypress video\", cypressVideoPath, {\n contentType: ContentType.MP4,\n });\n this.allureRuntime.stopFixture(fixtureUuid);\n this.allureRuntime.writeScope(context.videoScope);\n }\n };\n\n #emitRemainingScopes = (context: SpecContext) => {\n this.#emitPreviousTestScope(context);\n context.suiteScopes.forEach((scope) => {\n this.allureRuntime.writeScope(scope);\n });\n };\n\n #initializeSpecContext = (absolutePath: string) => {\n const specPath = getRelativePath(absolutePath);\n const context: SpecContext = {\n specPath,\n test: undefined,\n fixture: undefined,\n stepsByFrontEndId: new Map(),\n videoScope: this.allureRuntime.startScope(),\n suiteIdToScope: new Map(),\n suiteScopeToId: new Map(),\n suiteScopes: [],\n testScope: undefined,\n suiteNames: [],\n failed: false,\n };\n this.specContextByAbsolutePath.set(absolutePath, context);\n };\n}\n\nconst createRuntimeState = (allureConfig?: AllureCypressConfig): AllureSpecState => ({\n config: getRuntimeConfigDefaults(allureConfig),\n initialized: false,\n messages: [],\n testPlan: parseTestPlan(),\n projectDir: getProjectRoot(),\n projectName: getProjectName(),\n stepStack: [],\n stepsToFinalize: [],\n nextApiStepId: 0,\n});\n\nconst getRuntimeConfigDefaults = ({\n stepsFromCommands: {\n enabled = DEFAULT_RUNTIME_CONFIG.stepsFromCommands.enabled,\n maxArgumentLength = DEFAULT_RUNTIME_CONFIG.stepsFromCommands.maxArgumentLength,\n maxArgumentDepth = DEFAULT_RUNTIME_CONFIG.stepsFromCommands.maxArgumentDepth,\n } = DEFAULT_RUNTIME_CONFIG.stepsFromCommands,\n}: AllureCypressConfig = DEFAULT_RUNTIME_CONFIG): AllureSpecState[\"config\"] => ({\n stepsFromCommands: {\n enabled,\n maxArgumentDepth,\n maxArgumentLength,\n },\n});\n\nconst initializeRuntimeState = (cypressConfig: Cypress.PluginConfigOptions, allureConfig?: AllureCypressConfig) => {\n const allureState = createRuntimeState(allureConfig);\n if (cypressConfig.expose) {\n // Cypress 15.10+ uses `expose` instead of `env` to share data between the Node and browser contexts.\n cypressConfig.expose.allure = allureState;\n }\n if (cypressConfig.env) {\n // For legacy Cypress versions.\n cypressConfig.env.allure = allureState;\n }\n return cypressConfig;\n};\n\n/**\n * Sets up Allure Cypress.\n * @param on The function used to subscribe to Cypress Node events (it's the first argument of `setupNodeEvents`).\n * @param cypressConfig The Cypress configuration (the second argument of `setupNodeEvents`). If provided, the selective run feature will be enabled.\n * @param allureConfig An Allure configuration object (optional).\n * @example\n * ```javascript\n * import { defineConfig } from \"cypress\";\n * import { allureCypress } from \"allure-cypress/reporter\";\n *\n * export default defineConfig({\n * e2e: {\n * setupNodeEvents: (on, config) => {\n * allureCypress(on, config, { videoOnFailOnly: true });\n * return config;\n * },\n * // ...\n * }\n * });\n * ```\n */\nexport const allureCypress = (\n on: Cypress.PluginEvents,\n cypressConfig?: Cypress.PluginConfigOptions,\n allureConfig?: AllureCypressConfig,\n) => {\n // Backward compatibility; mainly for JS users who have no type hints\n if (!allureConfig && cypressConfig && !(\"env\" in cypressConfig)) {\n allureConfig = cypressConfig as AllureCypressConfig;\n }\n\n const hasCypressConfig = cypressConfig && \"env\" in cypressConfig;\n\n const allureCypressReporter = new AllureCypress(allureConfig);\n allureCypressReporter.attachToCypress(on);\n\n if (hasCypressConfig) {\n initializeRuntimeState(cypressConfig, allureConfig);\n }\n\n return allureCypressReporter;\n};\n\nconst toGlobalErrorMessage = (name: string, details: StatusDetails): RuntimeMessage => ({\n type: \"global_error\",\n data: {\n ...details,\n message: details.message ? `${name} failed: ${details.message}` : `${name} failed`,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAsCA,IAAAE,MAAA,GAAAF,OAAA;AAA0D,IAAAG,SAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;AAAA,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,C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ACI,GAAG,CAACD,MAAM,GAAGF,WAAW;EACxC;EACA,OAAOD,aAAa;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMK,aAAa,GAAGA,CAC3B/K,EAAwB,EACxB0K,aAA2C,EAC3ChB,YAAkC,KAC/B;EACH;EACA,IAAI,CAACA,YAAY,IAAIgB,aAAa,IAAI,EAAE,KAAK,IAAIA,aAAa,CAAC,EAAE;IAC/DhB,YAAY,GAAGgB,aAAoC;EACrD;EAEA,IAAMM,gBAAgB,GAAGN,aAAa,IAAI,KAAK,IAAIA,aAAa;EAEhE,IAAMO,qBAAqB,GAAG,IAAItL,aAAa,CAAC+J,YAAY,CAAC;EAC7DuB,qBAAqB,CAACC,eAAe,CAAClL,EAAE,CAAC;EAEzC,IAAIgL,gBAAgB,EAAE;IACpBP,sBAAsB,CAACC,aAAa,EAAEhB,YAAY,CAAC;EACrD;EAEA,OAAOuB,qBAAqB;AAC9B,CAAC;AAACzB,OAAA,CAAAuB,aAAA,GAAAA,aAAA;AAEF,IAAMxE,oBAAoB,GAAGA,CAACxE,IAAY,EAAEoJ,OAAsB,MAAsB;EACtFzJ,IAAI,EAAE,cAAc;EACpBE,IAAI,EAAAnG,aAAA,CAAAA,aAAA,KACC0P,OAAO;IACV1J,OAAO,EAAE0J,OAAO,CAAC1J,OAAO,MAAAqD,MAAA,CAAM/C,IAAI,eAAA+C,MAAA,CAAYqG,OAAO,CAAC1J,OAAO,OAAAqD,MAAA,CAAQ/C,IAAI;EAAS;AAEtF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"reporter.js","names":["_allureJsCommons","require","_sdk","_reporter","_utils","_excluded","_excluded2","_excluded3","_excluded4","_excluded5","_excluded6","_excluded7","_excluded8","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_objectWithoutProperties","i","_objectWithoutPropertiesLoose","n","indexOf","propertyIsEnumerable","call","hasOwnProperty","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","set","has","TypeError","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","String","Number","_classPrivateFieldGet","s","get","_assertClassBrand","_fixtureNames","WeakMap","_screenshotReferencesByPath","_endAllSpecs","_applyAllureCypressMessages","_startRun","_startSuite","_pushNewSuiteScope","_stopSuite","_writeLastSuiteScope","_startHook","_stopHook","_startTest","_addNewTestResult","_failHookAndTest","_passTest","_skipTest","_addSkippedTest","_stopTest","_stopExistingTestResult","_fixFixtureStepStops","_fixStepStops","_startStep","_stopStep","_finalizeStep","_applyRuntimeApiMessages","_emitPreviousTestScope","_resolveRootUuid","_attachSpecVideo","_emitRemainingScopes","_initializeSpecContext","AllureCypress","constructor","config","undefined","Map","on","reportAllureCypressSpecMessages","args","reportFinalAllureCypressSpecMessages","isInteractive","endSpec","absolutePath","onAfterScreenshot","onAfterSpec","onAfterRun","_ref","_classPrivateFieldGet2","path","reference","allureRuntime","emitAttachment","contentType","ContentType","PNG","references","spec","results","_results$video","absolute","video","endRun","writeEnvironmentInfo","writeCategoriesDefinitions","specAbsolutePath","cypressVideoPath","specContext","specContextByAbsolutePath","delete","clear","_ref2","messages","message","type","context","data","_ref3","id","name","root","suiteNames","suiteId","scope","startScope","suiteScopes","suiteIdToScope","suiteScopeToId","_ref4","pop","writeScope","_ref5","scopeType","position","start","isEach","isAfterEach","testScope","last","fixture","startFixture","status","_ref6","duration","fixtureUuid","updateFixture","_fixture$status","Status","PASSED","stopFixture","_ref7","fullNameSuffix","testResultData","test","videoScope","_ref8","scopes","labels","metadataLabels","otherTestData","projectName","getProjectName","posixPath","getPosixPath","specPath","fullNameBase","concat","legacyFullName","titlePath","split","startTest","stage","Stage","RUNNING","getLanguageLabel","getFrameworkLabel","getEnvironmentLabels","getHostLabel","getThreadLabel","getPackageLabel","getFallbackTestCaseIdLabel","md5","fullName","_ref9","statusDetails","setError","result","assign","_classPrivateFieldGet3","applyGlobalRuntimeMessages","toGlobalErrorMessage","details","testUuid","updateTest","failed","testResult","_ref0","SKIPPED","_ref1","suites","retries","map","Boolean","writeTest","_ref10","_ref11","parameters","toString","excluded","FINISHED","stopTest","getDefaultSuiteLabels","_ref12","stop","steps","step","at","_ref13","properties","rootUuid","stepUuid","startStep","stepsByFrontEndId","_ref14","updateStep","stopStep","_ref15","_message$data","options","shift","writeAttachment","applyRuntimeMessages","_context$fixture","shouldVideoBeAttached","videoOnFailOnly","MP4","getRelativePath","resultsDir","rest","ReporterRuntime","writer","createDefaultWriter","exports","createRuntimeState","allureConfig","getRuntimeConfigDefaults","initialized","testPlan","parseTestPlan","projectDir","getProjectRoot","stepStack","stepsToFinalize","nextApiStepId","stepsFromCommands","enabled","DEFAULT_RUNTIME_CONFIG","maxArgumentLength","maxArgumentDepth","initializeRuntimeState","cypressConfig","allureState","expose","allure","env","allureCypress","hasCypressConfig","allureCypressReporter","attachToCypress"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { ContentType, Stage, Status } from \"allure-js-commons\";\nimport type { FixtureResult, TestResult } from \"allure-js-commons\";\nimport type { RuntimeMessage } from \"allure-js-commons/sdk\";\nimport { toGlobalErrorMessage } from \"allure-js-commons/sdk\";\nimport {\n type AttachmentReference,\n ReporterRuntime,\n createDefaultWriter,\n getDefaultSuiteLabels,\n getEnvironmentLabels,\n getFallbackTestCaseIdLabel,\n getFrameworkLabel,\n getHostLabel,\n getLanguageLabel,\n getPackageLabel,\n getPosixPath,\n getProjectName,\n getProjectRoot,\n getRelativePath,\n getThreadLabel,\n md5,\n parseTestPlan,\n} from \"allure-js-commons/sdk/reporter\";\nimport type Cypress from \"cypress\";\n\nimport type {\n AllureCypressConfig,\n AllureCypressTaskArgs,\n AllureSpecState,\n CypressFailMessage,\n CypressHookEndMessage,\n CypressHookStartMessage,\n CypressSkippedTestMessage,\n CypressStepFinalizeMessage,\n CypressStepStartMessage,\n CypressStepStopMessage,\n CypressSuiteEndMessage,\n CypressSuiteStartMessage,\n CypressTestEndMessage,\n CypressTestSkipMessage,\n CypressTestStartMessage,\n SpecContext,\n} from \"./types.js\";\nimport { DEFAULT_RUNTIME_CONFIG, last } from \"./utils.js\";\n\nexport class AllureCypress {\n allureRuntime: ReporterRuntime;\n specContextByAbsolutePath = new Map<string, SpecContext>();\n #fixtureNames = new Map<string, string>();\n #screenshotReferencesByPath = new Map<string, AttachmentReference[]>();\n videoOnFailOnly: boolean = false;\n\n constructor(config: AllureCypressConfig = {}) {\n const { resultsDir, videoOnFailOnly = false, ...rest } = config;\n\n this.videoOnFailOnly = videoOnFailOnly;\n this.allureRuntime = new ReporterRuntime({\n writer: createDefaultWriter({ resultsDir }),\n ...rest,\n });\n }\n\n attachToCypress = (on: Cypress.PluginEvents) => {\n on(\"task\", {\n reportAllureCypressSpecMessages: (args: AllureCypressTaskArgs) => {\n this.#applyAllureCypressMessages(args);\n return null;\n },\n reportFinalAllureCypressSpecMessages: (args: AllureCypressTaskArgs) => {\n this.#applyAllureCypressMessages(args);\n if (args.isInteractive) {\n // In non-interactive mode the spec is ended via the 'after:spec' event instead\n // to get the spec's video.\n this.endSpec(args.absolutePath);\n }\n return null;\n },\n });\n\n on(\"after:screenshot\", this.onAfterScreenshot);\n\n // Emits the remaining fixtures and writes the video of the spec.\n // In interactive mode it's invoked through the `reportFinalAllureCypressSpecMessages` task.\n on(\"after:spec\", this.onAfterSpec);\n\n // Emits the categories and env info. Doesn't work in interactive mode unless\n // `experimentalInteractiveRunEvents` is set.\n on(\"after:run\", this.onAfterRun);\n };\n\n /**\n * Forward `after:screenshot` here if you define your own handler. Pass the\n * final screenshot path after any changes made by your handler.\n */\n onAfterScreenshot = ({ path }: Cypress.ScreenshotDetails) => {\n // Snapshot plugins can move or delete the file before the browser flushes\n // its attachment message. Preserve each capture, including overwritten paths.\n const reference = this.allureRuntime.emitAttachment(path, { contentType: ContentType.PNG });\n const references = this.#screenshotReferencesByPath.get(path) ?? [];\n references.push(reference);\n this.#screenshotReferencesByPath.set(path, references);\n };\n\n /**\n * Forward the `after:spec` event into Allure Cypress using this function if\n * you need to define your own handler or combine Allure Cypress with other\n * plugins. More info [here](https://github.com/allure-framework/allure-js/blob/main/packages/allure-cypress/README.md#setupnodeevents-limitations).\n * @param spec The first argument of the `after:spec` event.\n * @param results The second argument of the `after:spec` event. It's `undefined` in interactive mode.\n * @example\n * ```javascript\n * import { defineConfig } from \"cypress\";\n * import { allureCypress } from \"allure-cypress/reporter\";\n *\n * export default defineConfig({\n * setupNodeEvents: (on, config) => {\n * const allureReporter = allureCypress(on, config);\n * on(\"after:spec\", (spec, results) => {\n * allureReporter.onAfterSpec(spec, results);\n * });\n * return config;\n * }\n * // ...\n * });\n * ```\n */\n onAfterSpec = (spec: Cypress.Spec, results: CypressCommandLine.RunResult | undefined) => {\n this.endSpec(spec.absolute, results?.video ?? undefined);\n };\n\n /**\n * Forward the `after:run` event into Allure Cypress using this function if\n * you need to define your own handler or combine Allure Cypress with other\n * plugins. More info [here](https://github.com/allure-framework/allure-js/blob/main/packages/allure-cypress/README.md#setupnodeevents-limitations).\n * @param results The argument of the `after:run` event. It's `undefined` in interactive mode.\n * @example\n * ```javascript\n * import { defineConfig } from \"cypress\";\n * import { allureCypress } from \"allure-cypress/reporter\";\n *\n * export default defineConfig({\n * setupNodeEvents: (on, config) => {\n * const allureReporter = allureCypress(on, config);\n * on(\"after:run\", (results) => {\n * allureReporter.onAfterRun(results);\n * });\n * return config;\n * }\n * // ...\n * });\n * ```\n */\n onAfterRun = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n results: CypressCommandLine.CypressFailedRunResult | CypressCommandLine.CypressRunResult | undefined,\n ) => {\n this.endRun();\n };\n\n endRun = () => {\n this.#endAllSpecs();\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n };\n\n endSpec = (specAbsolutePath: string, cypressVideoPath?: string) => {\n const specContext = this.specContextByAbsolutePath.get(specAbsolutePath);\n if (specContext) {\n this.#attachSpecVideo(specContext, cypressVideoPath);\n this.#emitRemainingScopes(specContext);\n this.specContextByAbsolutePath.delete(specAbsolutePath);\n }\n this.#screenshotReferencesByPath.clear();\n };\n\n #endAllSpecs = () => {\n for (const specAbsolutePath of this.specContextByAbsolutePath.keys()) {\n this.endSpec(specAbsolutePath);\n }\n };\n\n #applyAllureCypressMessages = ({ messages, absolutePath }: AllureCypressTaskArgs) => {\n messages.forEach((message) => {\n if (message.type === \"cypress_run_start\") {\n this.#startRun(absolutePath);\n return;\n }\n\n const context = this.specContextByAbsolutePath.get(absolutePath);\n if (!context) {\n return;\n }\n\n switch (message.type) {\n case \"cypress_suite_start\":\n this.#startSuite(context, message);\n break;\n case \"cypress_suite_end\":\n this.#stopSuite(context, message);\n break;\n case \"cypress_hook_start\":\n this.#startHook(context, message);\n break;\n case \"cypress_hook_end\":\n this.#stopHook(context, message);\n break;\n case \"cypress_test_start\":\n this.#startTest(context, message);\n break;\n case \"cypress_test_pass\":\n this.#passTest(context);\n break;\n case \"cypress_fail\":\n this.#failHookAndTest(context, message);\n break;\n case \"cypress_test_skip\":\n this.#skipTest(context, message);\n break;\n case \"cypress_skipped_test\":\n this.#addSkippedTest(context, message);\n break;\n case \"cypress_test_end\":\n this.#stopTest(context, message);\n break;\n case \"cypress_step_start\":\n this.#startStep(context, message.data);\n break;\n case \"cypress_step_stop\":\n this.#stopStep(context, message.data);\n break;\n case \"cypress_step_finalize\":\n this.#finalizeStep(context, message.data);\n break;\n default:\n this.#applyRuntimeApiMessages(context, message);\n break;\n }\n });\n };\n\n #startRun = (absolutePath: string) => {\n if (!this.specContextByAbsolutePath.has(absolutePath)) {\n this.#initializeSpecContext(absolutePath);\n }\n };\n\n #startSuite = (context: SpecContext, { data: { id, name, root } }: CypressSuiteStartMessage) => {\n this.#pushNewSuiteScope(context, id);\n if (!root) {\n this.#emitPreviousTestScope(context);\n context.suiteNames.push(name);\n }\n };\n\n #pushNewSuiteScope = (context: SpecContext, suiteId: string) => {\n const scope = this.allureRuntime.startScope();\n context.suiteScopes.push(scope);\n context.suiteIdToScope.set(suiteId, scope);\n context.suiteScopeToId.set(scope, suiteId);\n return scope;\n };\n\n #stopSuite = (context: SpecContext, { data: { root } }: CypressSuiteEndMessage) => {\n this.#emitPreviousTestScope(context);\n if (!root) {\n context.suiteNames.pop();\n }\n this.#writeLastSuiteScope(context);\n };\n\n #writeLastSuiteScope = (context: SpecContext) => {\n const scope = context.suiteScopes.pop();\n if (scope) {\n const suiteId = context.suiteScopeToId.get(scope);\n if (suiteId) {\n context.suiteScopeToId.delete(scope);\n context.suiteIdToScope.delete(suiteId);\n }\n this.allureRuntime.writeScope(scope);\n }\n };\n\n #startHook = (context: SpecContext, { data: { name, scopeType, position, start } }: CypressHookStartMessage) => {\n const isEach = scopeType === \"each\";\n const isAfterEach = position === \"after\" && isEach;\n if (!isAfterEach) {\n this.#emitPreviousTestScope(context);\n }\n\n const scope = isEach ? context.testScope : last(context.suiteScopes);\n if (scope) {\n context.fixture = this.allureRuntime.startFixture(scope, position, {\n name,\n start,\n status: undefined,\n });\n if (context.fixture) {\n this.#fixtureNames.set(context.fixture, name);\n }\n }\n };\n\n #stopHook = (context: SpecContext, { data: { duration } }: CypressHookEndMessage) => {\n const fixtureUuid = context.fixture;\n if (fixtureUuid) {\n this.allureRuntime.updateFixture(fixtureUuid, (fixture) => {\n fixture.status ??= Status.PASSED;\n });\n this.allureRuntime.stopFixture(fixtureUuid, { duration });\n this.#fixFixtureStepStops(fixtureUuid);\n this.#fixtureNames.delete(fixtureUuid);\n context.fixture = undefined;\n }\n };\n\n #startTest = (context: SpecContext, { data: { fullNameSuffix, ...testResultData } }: CypressTestStartMessage) => {\n this.#emitPreviousTestScope(context);\n const testScope = this.allureRuntime.startScope();\n context.testScope = testScope;\n context.test = this.#addNewTestResult(context, fullNameSuffix, testResultData, [\n context.videoScope,\n ...context.suiteScopes,\n testScope,\n ]);\n };\n\n #addNewTestResult = (\n context: SpecContext,\n fullNameSuffix: string,\n { labels: metadataLabels = [], ...otherTestData }: Partial<TestResult>,\n scopes: string[],\n ) => {\n const projectName = getProjectName();\n const posixPath = getPosixPath(context.specPath);\n const fullNameBase = projectName ? `${projectName}:${posixPath}` : posixPath;\n const legacyFullName = `${posixPath}#${fullNameSuffix}`;\n\n const titlePath = posixPath.split(\"/\").concat(context.suiteNames);\n\n return this.allureRuntime.startTest(\n {\n stage: Stage.RUNNING,\n labels: [\n getLanguageLabel(),\n getFrameworkLabel(\"cypress\"),\n ...metadataLabels,\n ...getEnvironmentLabels(),\n getHostLabel(),\n getThreadLabel(),\n getPackageLabel(context.specPath),\n getFallbackTestCaseIdLabel(md5(legacyFullName)),\n ],\n fullName: `${fullNameBase}#${fullNameSuffix}`,\n titlePath: projectName ? [projectName, ...titlePath] : titlePath,\n ...otherTestData,\n },\n scopes,\n );\n };\n\n #failHookAndTest = (context: SpecContext, { data: { status, statusDetails } }: CypressFailMessage) => {\n const setError = (result: object) => Object.assign(result, { status, statusDetails });\n\n const fixtureUuid = context.fixture;\n if (fixtureUuid) {\n this.allureRuntime.updateFixture(fixtureUuid, setError);\n this.allureRuntime.applyGlobalRuntimeMessages([\n toGlobalErrorMessage({\n name: this.#fixtureNames.get(fixtureUuid) ?? \"hook\",\n details: statusDetails,\n status,\n }),\n ]);\n }\n\n const testUuid = context.test;\n if (testUuid) {\n this.allureRuntime.updateTest(testUuid, setError);\n }\n\n context.failed = true;\n };\n\n #passTest = (context: SpecContext) => {\n const testUuid = context.test;\n if (testUuid) {\n this.allureRuntime.updateTest(testUuid, (testResult) => {\n testResult.status = Status.PASSED;\n });\n }\n };\n\n #skipTest = (context: SpecContext, { data: { statusDetails } }: CypressTestSkipMessage) => {\n const testUuid = context.test;\n if (testUuid) {\n this.allureRuntime.updateTest(testUuid, (testResult) => {\n testResult.status = Status.SKIPPED;\n if (statusDetails) {\n testResult.statusDetails = statusDetails;\n }\n });\n }\n };\n\n #addSkippedTest = (\n context: SpecContext,\n { data: { fullNameSuffix, suites, duration, retries, ...testResultData } }: CypressSkippedTestMessage,\n ) => {\n // Tests skipped because of a hook error may share all suites of the current context\n // or just a part thereof (if it's from a sibling suite).\n const scopes = suites.map((s) => context.suiteIdToScope.get(s)).filter((s): s is string => Boolean(s));\n\n const testUuid = this.#addNewTestResult(context, fullNameSuffix, testResultData, [context.videoScope, ...scopes]);\n this.#stopExistingTestResult(testUuid, { duration, retries }, context.suiteNames);\n this.allureRuntime.writeTest(testUuid);\n };\n\n #stopTest = (context: SpecContext, { data }: CypressTestEndMessage) => {\n const testUuid = context.test;\n if (testUuid) {\n this.#stopExistingTestResult(testUuid, data, context.suiteNames);\n this.allureRuntime.writeTest(testUuid);\n context.test = undefined;\n }\n };\n\n #stopExistingTestResult = (\n testUuid: string,\n { retries, duration }: CypressTestEndMessage[\"data\"],\n suiteNames: string[],\n ) => {\n this.allureRuntime.updateTest(testUuid, (testResult) => {\n if (retries > 0) {\n testResult.parameters.push({\n name: \"Retry\",\n value: retries.toString(),\n excluded: true,\n });\n }\n testResult.stage = Stage.FINISHED;\n });\n this.allureRuntime.stopTest(testUuid, { duration });\n // Hook metadata is merged by stopTest, so apply defaults only after it.\n this.allureRuntime.updateTest(testUuid, (testResult) => {\n testResult.labels.push(...getDefaultSuiteLabels(testResult, suiteNames));\n this.#fixStepStops(testResult);\n });\n };\n\n #fixFixtureStepStops = (fixtureUuid: string) => {\n this.allureRuntime.updateFixture(fixtureUuid, this.#fixStepStops);\n };\n\n #fixStepStops = ({ stop, steps = [] }: TestResult | FixtureResult) => {\n if (stop) {\n // In some circumstances, steps becomes dangling and are stopped at the test end/hook end events, which happen\n // chronologically after the test or fixture ends. This leads to the steps' stop time being greater than the one\n // of the test/fixture.\n // The only steps that may be affected are the rightmost descendants of the test/fixture.\n for (let step = steps.at(-1); step; step = step.steps.at(-1)) {\n if (step.stop && step.stop > stop) {\n step.stop = stop;\n } else {\n // Steps are always stopped child-to-parent. If a step's stop time is OK, its substeps are also correct.\n return;\n }\n }\n }\n };\n\n #startStep = (context: SpecContext, { id, ...properties }: CypressStepStartMessage[\"data\"]) => {\n const rootUuid = this.#resolveRootUuid(context);\n if (rootUuid) {\n const stepUuid = this.allureRuntime.startStep(rootUuid, undefined, properties);\n if (stepUuid) {\n context.stepsByFrontEndId.set(id, stepUuid);\n }\n }\n };\n\n #stopStep = (context: SpecContext, { id, stop, ...properties }: CypressStepStopMessage[\"data\"]) => {\n const stepUuid = context.stepsByFrontEndId.get(id);\n if (stepUuid) {\n this.allureRuntime.updateStep(stepUuid, (r) => {\n Object.assign(r, properties);\n });\n this.allureRuntime.stopStep(stepUuid, { stop });\n }\n };\n\n #finalizeStep = (context: SpecContext, { id, ...properties }: CypressStepFinalizeMessage[\"data\"]) => {\n const stepUuid = context.stepsByFrontEndId.get(id);\n if (stepUuid) {\n this.allureRuntime.updateStep(stepUuid, (r) => {\n Object.assign(r, properties);\n });\n context.stepsByFrontEndId.delete(id);\n }\n };\n\n #applyRuntimeApiMessages = (context: SpecContext, message: RuntimeMessage) => {\n const rootUuid = this.#resolveRootUuid(context);\n if (message.type === \"attachment_path\") {\n const { path, name, ...options } = message.data;\n const references = this.#screenshotReferencesByPath.get(path);\n const reference = references?.shift();\n if (reference) {\n if (!references?.length) {\n this.#screenshotReferencesByPath.delete(path);\n }\n if (rootUuid) {\n this.allureRuntime.writeAttachment(rootUuid, undefined, name, reference, options);\n }\n return;\n }\n }\n\n if (rootUuid) {\n this.allureRuntime.applyRuntimeMessages(rootUuid, [message]);\n } else {\n this.allureRuntime.applyGlobalRuntimeMessages([message]);\n }\n };\n\n /**\n * We must defer emitting a test's scope until we receive all the test's `afterEach` hooks.\n * At the same time, we should report it as early as we can. That means we should call this\n * method in the following cases:\n * - when an `after` hook of the test starts (`after` hooks are called later than `afterEach`)\n * - when a `before` or `beforeEach` hook of the next test starts (in case the next test has `before`/`beforeEach` hooks)\n * - when the next test starts (in case the next test doesn't have `before`/`beforeEach` hooks)\n * - when the test's suite ends (in case the test is the last one in its suite, including the root suite of the spec)\n * - when a nested suite starts\n * - when the spec ends\n */\n #emitPreviousTestScope = (context: SpecContext) => {\n const testScope = context.testScope;\n\n // Checking the test allows us to tell `beforeEach` and `afterEach` apart.\n // Here we're interested in `afterEach` only.\n if (!context.test && testScope) {\n this.allureRuntime.writeScope(testScope);\n context.testScope = undefined;\n }\n };\n\n #resolveRootUuid = (context: SpecContext) => context.fixture ?? context.test;\n\n #attachSpecVideo = (context: SpecContext, cypressVideoPath?: string) => {\n const shouldVideoBeAttached = (!this.videoOnFailOnly || context.failed) && cypressVideoPath;\n if (shouldVideoBeAttached) {\n const fixtureUuid = this.allureRuntime.startFixture(context.videoScope, \"after\", {\n name: \"Cypress video\",\n status: Status.PASSED,\n stage: Stage.FINISHED,\n })!;\n this.allureRuntime.writeAttachment(fixtureUuid, undefined, \"Cypress video\", cypressVideoPath, {\n contentType: ContentType.MP4,\n });\n this.allureRuntime.stopFixture(fixtureUuid);\n this.allureRuntime.writeScope(context.videoScope);\n }\n };\n\n #emitRemainingScopes = (context: SpecContext) => {\n this.#emitPreviousTestScope(context);\n context.suiteScopes.forEach((scope) => {\n this.allureRuntime.writeScope(scope);\n });\n };\n\n #initializeSpecContext = (absolutePath: string) => {\n const specPath = getRelativePath(absolutePath);\n const context: SpecContext = {\n specPath,\n test: undefined,\n fixture: undefined,\n stepsByFrontEndId: new Map(),\n videoScope: this.allureRuntime.startScope(),\n suiteIdToScope: new Map(),\n suiteScopeToId: new Map(),\n suiteScopes: [],\n testScope: undefined,\n suiteNames: [],\n failed: false,\n };\n this.specContextByAbsolutePath.set(absolutePath, context);\n };\n}\n\nconst createRuntimeState = (allureConfig?: AllureCypressConfig): AllureSpecState => ({\n config: getRuntimeConfigDefaults(allureConfig),\n initialized: false,\n messages: [],\n testPlan: parseTestPlan(),\n projectDir: getProjectRoot(),\n projectName: getProjectName(),\n stepStack: [],\n stepsToFinalize: [],\n nextApiStepId: 0,\n});\n\nconst getRuntimeConfigDefaults = ({\n stepsFromCommands: {\n enabled = DEFAULT_RUNTIME_CONFIG.stepsFromCommands.enabled,\n maxArgumentLength = DEFAULT_RUNTIME_CONFIG.stepsFromCommands.maxArgumentLength,\n maxArgumentDepth = DEFAULT_RUNTIME_CONFIG.stepsFromCommands.maxArgumentDepth,\n } = DEFAULT_RUNTIME_CONFIG.stepsFromCommands,\n}: AllureCypressConfig = DEFAULT_RUNTIME_CONFIG): AllureSpecState[\"config\"] => ({\n stepsFromCommands: {\n enabled,\n maxArgumentDepth,\n maxArgumentLength,\n },\n});\n\nconst initializeRuntimeState = (cypressConfig: Cypress.PluginConfigOptions, allureConfig?: AllureCypressConfig) => {\n const allureState = createRuntimeState(allureConfig);\n if (cypressConfig.expose) {\n // Cypress 15.10+ uses `expose` instead of `env` to share data between the Node and browser contexts.\n cypressConfig.expose.allure = allureState;\n }\n if (cypressConfig.env) {\n // For legacy Cypress versions.\n cypressConfig.env.allure = allureState;\n }\n return cypressConfig;\n};\n\n/**\n * Sets up Allure Cypress.\n * @param on The function used to subscribe to Cypress Node events (it's the first argument of `setupNodeEvents`).\n * @param cypressConfig The Cypress configuration (the second argument of `setupNodeEvents`). If provided, the selective run feature will be enabled.\n * @param allureConfig An Allure configuration object (optional).\n * @example\n * ```javascript\n * import { defineConfig } from \"cypress\";\n * import { allureCypress } from \"allure-cypress/reporter\";\n *\n * export default defineConfig({\n * e2e: {\n * setupNodeEvents: (on, config) => {\n * allureCypress(on, config, { videoOnFailOnly: true });\n * return config;\n * },\n * // ...\n * }\n * });\n * ```\n */\nexport const allureCypress = (\n on: Cypress.PluginEvents,\n cypressConfig?: Cypress.PluginConfigOptions,\n allureConfig?: AllureCypressConfig,\n) => {\n // Backward compatibility; mainly for JS users who have no type hints\n if (!allureConfig && cypressConfig && !(\"env\" in cypressConfig)) {\n allureConfig = cypressConfig as AllureCypressConfig;\n }\n\n const hasCypressConfig = cypressConfig && \"env\" in cypressConfig;\n\n const allureCypressReporter = new AllureCypress(allureConfig);\n allureCypressReporter.attachToCypress(on);\n\n if (hasCypressConfig) {\n initializeRuntimeState(cypressConfig, allureConfig);\n }\n\n return allureCypressReporter;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAGA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAuCA,IAAAG,MAAA,GAAAH,OAAA;AAA0D,IAAAI,SAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;AAAA,SAAAC,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,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,C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,YAAkC,KAC/B;EACH;EACA,IAAI,CAACA,YAAY,IAAIgB,aAAa,IAAI,EAAE,KAAK,IAAIA,aAAa,CAAC,EAAE;IAC/DhB,YAAY,GAAGgB,aAAoC;EACrD;EAEA,IAAMM,gBAAgB,GAAGN,aAAa,IAAI,KAAK,IAAIA,aAAa;EAEhE,IAAMO,qBAAqB,GAAG,IAAInM,aAAa,CAAC4K,YAAY,CAAC;EAC7DuB,qBAAqB,CAACC,eAAe,CAAC/L,EAAE,CAAC;EAEzC,IAAI6L,gBAAgB,EAAE;IACpBP,sBAAsB,CAACC,aAAa,EAAEhB,YAAY,CAAC;EACrD;EAEA,OAAOuB,qBAAqB;AAC9B,CAAC;AAACzB,OAAA,CAAAuB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -3,12 +3,24 @@ import { reportScreenshot } from "../lifecycle.js";
|
|
|
3
3
|
import { reportStepError } from "../steps.js";
|
|
4
4
|
import { getFileNameFromPath } from "../utils.js";
|
|
5
5
|
export var registerCypressEventListeners = () => Cypress.on("fail", onFail).on("log:added", onLogAdded);
|
|
6
|
-
export var enableReportingOfCypressScreenshots = () =>
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export var enableReportingOfCypressScreenshots = () => {
|
|
7
|
+
// Observe the dispatcher, so later defaults() calls cannot replace Allure's reporting.
|
|
8
|
+
var screenshot = Cypress.Screenshot;
|
|
9
|
+
var original = screenshot.onAfterScreenshot;
|
|
10
|
+
screenshot.onAfterScreenshot = function () {
|
|
11
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12
|
+
args[_key] = arguments[_key];
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
return original.apply(this, args);
|
|
16
|
+
} finally {
|
|
17
|
+
onAfterScreenshot(...args);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
9
21
|
var onAfterScreenshot = function onAfterScreenshot() {
|
|
10
|
-
for (var
|
|
11
|
-
_ref[
|
|
22
|
+
for (var _len2 = arguments.length, _ref = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
23
|
+
_ref[_key2] = arguments[_key2];
|
|
12
24
|
}
|
|
13
25
|
var [, {
|
|
14
26
|
name: originalName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.js","names":["setupScreenshotAttachmentStep","shouldCreateStepFromCommandLogEntry","startCommandLogStep","reportScreenshot","reportStepError","getFileNameFromPath","registerCypressEventListeners","Cypress","on","onFail","onLogAdded","enableReportingOfCypressScreenshots","Screenshot","
|
|
1
|
+
{"version":3,"file":"cypress.js","names":["setupScreenshotAttachmentStep","shouldCreateStepFromCommandLogEntry","startCommandLogStep","reportScreenshot","reportStepError","getFileNameFromPath","registerCypressEventListeners","Cypress","on","onFail","onLogAdded","enableReportingOfCypressScreenshots","screenshot","Screenshot","original","onAfterScreenshot","_len","arguments","length","args","Array","_key","apply","_len2","_ref","_key2","name","originalName","path","_","entry","error","noSubsequentFailListeners","Object","is","listeners","at"],"sources":["../../../../src/browser/events/cypress.ts"],"sourcesContent":["import type { CypressLogEntry } from \"../../types.js\";\nimport {\n setupScreenshotAttachmentStep,\n shouldCreateStepFromCommandLogEntry,\n startCommandLogStep,\n} from \"../commandLog.js\";\nimport { reportScreenshot } from \"../lifecycle.js\";\nimport { reportStepError } from \"../steps.js\";\nimport { getFileNameFromPath } from \"../utils.js\";\n\nexport const registerCypressEventListeners = () => Cypress.on(\"fail\", onFail).on(\"log:added\", onLogAdded);\n\nexport const enableReportingOfCypressScreenshots = () => {\n // Observe the dispatcher, so later defaults() calls cannot replace Allure's reporting.\n const screenshot = Cypress.Screenshot as unknown as {\n onAfterScreenshot: Cypress.ScreenshotDefaultsOptions[\"onAfterScreenshot\"];\n };\n const original = screenshot.onAfterScreenshot;\n screenshot.onAfterScreenshot = function (...args) {\n try {\n return original.apply(this, args);\n } finally {\n onAfterScreenshot(...args);\n }\n };\n};\n\nconst onAfterScreenshot = (\n ...[, { name: originalName, path }]: Parameters<Cypress.ScreenshotDefaultsOptions[\"onAfterScreenshot\"]>\n) => {\n const name = originalName ?? getFileNameFromPath(path);\n\n reportScreenshot(path, name);\n setupScreenshotAttachmentStep(originalName, name);\n};\n\nconst onLogAdded = (_: Cypress.ObjectLike, entry: CypressLogEntry) => {\n if (shouldCreateStepFromCommandLogEntry(entry)) {\n startCommandLogStep(entry);\n }\n};\n\nconst onFail = (error: Cypress.CypressError) => {\n reportStepError(error);\n\n // If there are more \"fail\" handlers yet to run, it's not our responsibility to throw.\n // Otherwise, we won't give them any chance to do their job (EventEmitter stops executing handlers as soon\n // as one of them throws - that is also true for eventemitter2, which is used by the browser-side of Cypress).\n if (noSubsequentFailListeners()) {\n throw error;\n }\n};\n\nconst noSubsequentFailListeners = () => Object.is(Cypress.listeners(\"fail\").at(-1), onFail);\n"],"mappings":"AACA,SACEA,6BAA6B,EAC7BC,mCAAmC,EACnCC,mBAAmB,QACd,kBAAkB;AACzB,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,eAAe,QAAQ,aAAa;AAC7C,SAASC,mBAAmB,QAAQ,aAAa;AAEjD,OAAO,IAAMC,6BAA6B,GAAGA,CAAA,KAAMC,OAAO,CAACC,EAAE,CAAC,MAAM,EAAEC,MAAM,CAAC,CAACD,EAAE,CAAC,WAAW,EAAEE,UAAU,CAAC;AAEzG,OAAO,IAAMC,mCAAmC,GAAGA,CAAA,KAAM;EACvD;EACA,IAAMC,UAAU,GAAGL,OAAO,CAACM,UAE1B;EACD,IAAMC,QAAQ,GAAGF,UAAU,CAACG,iBAAiB;EAC7CH,UAAU,CAACG,iBAAiB,GAAG,YAAmB;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAANC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA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
|
@@ -6,6 +6,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
6
6
|
import { ContentType, Status } from "allure-js-commons";
|
|
7
7
|
import { getMessageAndTraceFromError, getStatusFromError } from "allure-js-commons/sdk";
|
|
8
8
|
import { getTestRuntime } from "./runtime.js";
|
|
9
|
+
import serializeValue from "./serialize.js";
|
|
9
10
|
import { dropCurrentTest, enqueueRuntimeMessage, getCurrentTest, setCurrentTest } from "./state.js";
|
|
10
11
|
import { finalizeSteps, stopAllSteps } from "./steps.js";
|
|
11
12
|
import { getStatusDataOfTestSkippedByHookError, getStepStopData, getSuitePath, getTestSkipData, getTestStartData, getTestStopData, isAllureHook, isLastRootAfterHook, isTestReported, iterateTests, markTestAsReported } from "./utils.js";
|
|
@@ -88,7 +89,7 @@ export var reportTestPass = () => {
|
|
|
88
89
|
};
|
|
89
90
|
export var reportTestOrHookFail = err => {
|
|
90
91
|
var status = getStatusFromError(err);
|
|
91
|
-
var statusDetails = getMessageAndTraceFromError(err);
|
|
92
|
+
var statusDetails = getMessageAndTraceFromError(err, serializeValue);
|
|
92
93
|
stopAllSteps(status, statusDetails);
|
|
93
94
|
enqueueRuntimeMessage({
|
|
94
95
|
type: "cypress_fail",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.js","names":["ContentType","Status","getMessageAndTraceFromError","getStatusFromError","getTestRuntime","dropCurrentTest","enqueueRuntimeMessage","getCurrentTest","setCurrentTest","finalizeSteps","stopAllSteps","getStatusDataOfTestSkippedByHookError","getStepStopData","getSuitePath","getTestSkipData","getTestStartData","getTestStopData","isAllureHook","isLastRootAfterHook","isTestReported","iterateTests","markTestAsReported","reportRunStart","type","data","reportSuiteStart","suite","id","name","title","root","start","Date","now","reportSuiteEnd","stop","reportHookStart","hook","scopeType","hookName","includes","position","reportHookEnd","_hook$duration","duration","reportTestStart","test","reportStepStart","reportStepStop","step","status","statusDetails","reportTestPass","reportTestOrHookFail","err","completeHookErrorReporting","isEachHook","parent","testFailData","reportCurrentTestIfAny","reportRemainingTests","reportTestSkip","SKIPPED","message","reportTestEnd","_test$duration","_retries","retries","reportScreenshot","path","contentType","PNG","completeSpecIfNoAfterHookLeft","context","completeSpecAsync","completeSpecOnAfterHookFailure","hookError","allureError","logAllureRootAfterError","throwAfterSpecCompletion","_completeSpecOnAfterH","chain","then","flushRuntimeMessages","flushAllureMessagesToTask","flushAllureMessagesToTaskAsync","currentTest","reportTestsSkippedByHookError","pending","_objectSpread","suites","map","s","_context$test$title","_context$test","console","error","concat","_unused"],"sources":["../../../src/browser/lifecycle.ts"],"sourcesContent":["import { ContentType, Status } from \"allure-js-commons\";\nimport type { StatusDetails } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\n\nimport type { CypressFailMessage, CypressHook, CypressSuite, CypressTest, StepDescriptor } from \"../types.js\";\nimport { getTestRuntime } from \"./runtime.js\";\nimport { dropCurrentTest, enqueueRuntimeMessage, getCurrentTest, setCurrentTest } from \"./state.js\";\nimport { finalizeSteps, stopAllSteps } from \"./steps.js\";\nimport {\n getStatusDataOfTestSkippedByHookError,\n getStepStopData,\n getSuitePath,\n getTestSkipData,\n getTestStartData,\n getTestStopData,\n isAllureHook,\n isLastRootAfterHook,\n isTestReported,\n iterateTests,\n markTestAsReported,\n} from \"./utils.js\";\n\nexport const reportRunStart = () => {\n enqueueRuntimeMessage({\n type: \"cypress_run_start\",\n data: {},\n });\n};\n\nexport const reportSuiteStart = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_start\",\n data: {\n id: suite.id,\n name: suite.title,\n root: suite.root,\n start: Date.now(),\n },\n });\n};\n\nexport const reportSuiteEnd = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_end\",\n data: {\n root: suite.root,\n stop: Date.now(),\n },\n });\n};\n\nexport const reportHookStart = (hook: CypressHook, start?: number) => {\n enqueueRuntimeMessage({\n type: \"cypress_hook_start\",\n data: {\n name: hook.title,\n scopeType: hook.hookName.includes(\"each\") ? \"each\" : \"all\",\n position: hook.hookName.includes(\"before\") ? \"before\" : \"after\",\n start: start ?? Date.now(),\n },\n });\n};\n\nexport const reportHookEnd = (hook: CypressHook) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_hook_end\",\n data: {\n duration: hook.duration ?? 0,\n },\n });\n};\n\nexport const reportTestStart = (test: CypressTest) => {\n setCurrentTest(test);\n enqueueRuntimeMessage({\n type: \"cypress_test_start\",\n data: getTestStartData(test),\n });\n markTestAsReported(test);\n};\n\nexport const reportStepStart = (id: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_start\",\n data: {\n id,\n name,\n start: Date.now(),\n },\n });\n};\n\nexport const reportStepStop = (step: StepDescriptor, status?: Status, statusDetails?: StatusDetails) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_stop\",\n data: getStepStopData(step, status, statusDetails),\n });\n};\n\nexport const reportTestPass = () => {\n enqueueRuntimeMessage({\n type: \"cypress_test_pass\",\n data: {},\n });\n};\n\nexport const reportTestOrHookFail = (err: Error) => {\n const status = getStatusFromError(err);\n const statusDetails = getMessageAndTraceFromError(err);\n\n stopAllSteps(status, statusDetails);\n\n enqueueRuntimeMessage({\n type: \"cypress_fail\",\n data: {\n status,\n statusDetails,\n },\n });\n};\n\nexport const completeHookErrorReporting = (hook: CypressHook, err: Error) => {\n const isEachHook = hook.hookName.includes(\"each\");\n const suite = hook.parent!;\n const testFailData = getStatusDataOfTestSkippedByHookError(hook.title, isEachHook, err, suite);\n\n // Cypress doens't emit 'hook end' if the hook has failed.\n reportHookEnd(hook);\n\n // Cypress doens't emit 'test end' if the hook has failed.\n // We must report the test's end manualy in case of a 'before each' hook.\n reportCurrentTestIfAny();\n\n // Cypress skips the remaining tests in the suite of a failed hook.\n // We should include them to the report manually.\n reportRemainingTests(suite, testFailData);\n};\n\nexport const reportTestSkip = (test: CypressTest) => {\n if (isTestReported(test)) {\n // Ignore pending events for retry attempts that already ended.\n if (getCurrentTest() !== test) {\n return;\n }\n\n stopAllSteps(Status.SKIPPED, {\n message: \"The test was skipped before the command was completed\",\n });\n } else {\n reportTestStart(test);\n }\n\n enqueueRuntimeMessage({\n type: \"cypress_test_skip\",\n data: getTestSkipData(),\n });\n};\n\nexport const reportTestEnd = (test: CypressTest) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_test_end\",\n data: {\n duration: test.duration ?? 0,\n retries: (test as any)._retries ?? 0,\n },\n });\n dropCurrentTest();\n};\n\nexport const reportScreenshot = (path: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"attachment_path\",\n data: { path, name, contentType: ContentType.PNG },\n });\n};\n\nexport const completeSpecIfNoAfterHookLeft = (context: Mocha.Context) => {\n if (isLastRootAfterHook(context)) {\n const hook = context.test as CypressHook;\n if (!isAllureHook(hook)) {\n reportHookEnd(hook);\n }\n return completeSpecAsync();\n }\n};\n\nexport const completeSpecOnAfterHookFailure = (\n context: Mocha.Context,\n hookError: Error,\n): Cypress.Chainable<unknown> | undefined => {\n try {\n reportTestOrHookFail(hookError);\n completeHookErrorReporting(context.test as CypressHook, hookError);\n\n // cy.task's then doesn't have onrejected, that's why we don't log async Allure errors here.\n return completeSpecAsync();\n } catch (allureError) {\n logAllureRootAfterError(context, allureError);\n }\n};\n\nexport const throwAfterSpecCompletion = (context: Mocha.Context, err: any) => {\n const chain = completeSpecOnAfterHookFailure(context, err as Error)?.then(() => {\n throw err;\n });\n if (!chain) {\n throw err;\n }\n};\n\nexport const flushRuntimeMessages = () => getTestRuntime().flushAllureMessagesToTask(\"reportAllureCypressSpecMessages\");\n\nexport const completeSpecAsync = () =>\n getTestRuntime().flushAllureMessagesToTaskAsync(\"reportFinalAllureCypressSpecMessages\");\n\nconst reportCurrentTestIfAny = () => {\n const currentTest = getCurrentTest();\n if (currentTest) {\n reportTestEnd(currentTest);\n }\n};\n\nconst reportRemainingTests = (suite: CypressSuite, testFailData: CypressFailMessage[\"data\"]) => {\n for (const test of iterateTests(suite)) {\n // Some tests in the suite might've been already reported.\n if (!isTestReported(test)) {\n reportTestsSkippedByHookError(\n test,\n test.pending ? { ...getTestSkipData(), status: Status.SKIPPED } : testFailData,\n );\n }\n }\n};\n\nconst reportTestsSkippedByHookError = (test: CypressTest, testFailData: CypressFailMessage[\"data\"]) => {\n enqueueRuntimeMessage({\n type: \"cypress_skipped_test\",\n data: {\n ...getTestStartData(test),\n ...testFailData,\n ...getTestStopData(test),\n suites: getSuitePath(test).map((s) => s.id),\n },\n });\n markTestAsReported(test);\n};\n\nconst logAllureRootAfterError = (context: Mocha.Context, err: unknown) => {\n // We play safe and swallow errors here to keep the original 'after all' error.\n try {\n // eslint-disable-next-line no-console\n console.error(`Unexpected error when reporting the failure of ${context.test?.title ?? \"'after all'\"}`);\n // eslint-disable-next-line no-console\n console.error(err);\n } catch {}\n};\n"],"mappings":";;;;;AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,mBAAmB;AAEvD,SAASC,2BAA2B,EAAEC,kBAAkB,QAAQ,uBAAuB;AAGvF,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,eAAe,EAAEC,qBAAqB,EAAEC,cAAc,EAAEC,cAAc,QAAQ,YAAY;AACnG,SAASC,aAAa,EAAEC,YAAY,QAAQ,YAAY;AACxD,SACEC,qCAAqC,EACrCC,eAAe,EACfC,YAAY,EACZC,eAAe,EACfC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,mBAAmB,EACnBC,cAAc,EACdC,YAAY,EACZC,kBAAkB,QACb,YAAY;AAEnB,OAAO,IAAMC,cAAc,GAAGA,CAAA,KAAM;EAClChB,qBAAqB,CAAC;IACpBiB,IAAI,EAAE,mBAAmB;IACzBC,IAAI,EAAE,CAAC;EACT,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,IAAMC,gBAAgB,GAAIC,KAAmB,IAAK;EACvDpB,qBAAqB,CAAC;IACpBiB,IAA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AAK;EACxE;EACA,IAAI;IAAA,IAAAuC,mBAAA,EAAAC,aAAA;IACF;IACAC,OAAO,CAACC,KAAK,mDAAAC,MAAA,EAAAJ,mBAAA,IAAAC,aAAA,GAAmDrB,OAAO,CAAC3B,IAAI,cAAAgD,aAAA,uBAAZA,aAAA,CAAcjE,KAAK,cAAAgE,mBAAA,cAAAA,mBAAA,GAAI,aAAa,CAAE,CAAC;IACvG;IACAE,OAAO,CAACC,KAAK,CAAC1C,GAAG,CAAC;EACpB,CAAC,CAAC,OAAA4C,OAAA,EAAM,CAAC;AACX,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"lifecycle.js","names":["ContentType","Status","getMessageAndTraceFromError","getStatusFromError","getTestRuntime","serializeValue","dropCurrentTest","enqueueRuntimeMessage","getCurrentTest","setCurrentTest","finalizeSteps","stopAllSteps","getStatusDataOfTestSkippedByHookError","getStepStopData","getSuitePath","getTestSkipData","getTestStartData","getTestStopData","isAllureHook","isLastRootAfterHook","isTestReported","iterateTests","markTestAsReported","reportRunStart","type","data","reportSuiteStart","suite","id","name","title","root","start","Date","now","reportSuiteEnd","stop","reportHookStart","hook","scopeType","hookName","includes","position","reportHookEnd","_hook$duration","duration","reportTestStart","test","reportStepStart","reportStepStop","step","status","statusDetails","reportTestPass","reportTestOrHookFail","err","completeHookErrorReporting","isEachHook","parent","testFailData","reportCurrentTestIfAny","reportRemainingTests","reportTestSkip","SKIPPED","message","reportTestEnd","_test$duration","_retries","retries","reportScreenshot","path","contentType","PNG","completeSpecIfNoAfterHookLeft","context","completeSpecAsync","completeSpecOnAfterHookFailure","hookError","allureError","logAllureRootAfterError","throwAfterSpecCompletion","_completeSpecOnAfterH","chain","then","flushRuntimeMessages","flushAllureMessagesToTask","flushAllureMessagesToTaskAsync","currentTest","reportTestsSkippedByHookError","pending","_objectSpread","suites","map","s","_context$test$title","_context$test","console","error","concat","_unused"],"sources":["../../../src/browser/lifecycle.ts"],"sourcesContent":["import { ContentType, Status } from \"allure-js-commons\";\nimport type { StatusDetails } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\n\nimport type { CypressFailMessage, CypressHook, CypressSuite, CypressTest, StepDescriptor } from \"../types.js\";\nimport { getTestRuntime } from \"./runtime.js\";\nimport serializeValue from \"./serialize.js\";\nimport { dropCurrentTest, enqueueRuntimeMessage, getCurrentTest, setCurrentTest } from \"./state.js\";\nimport { finalizeSteps, stopAllSteps } from \"./steps.js\";\nimport {\n getStatusDataOfTestSkippedByHookError,\n getStepStopData,\n getSuitePath,\n getTestSkipData,\n getTestStartData,\n getTestStopData,\n isAllureHook,\n isLastRootAfterHook,\n isTestReported,\n iterateTests,\n markTestAsReported,\n} from \"./utils.js\";\n\nexport const reportRunStart = () => {\n enqueueRuntimeMessage({\n type: \"cypress_run_start\",\n data: {},\n });\n};\n\nexport const reportSuiteStart = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_start\",\n data: {\n id: suite.id,\n name: suite.title,\n root: suite.root,\n start: Date.now(),\n },\n });\n};\n\nexport const reportSuiteEnd = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_end\",\n data: {\n root: suite.root,\n stop: Date.now(),\n },\n });\n};\n\nexport const reportHookStart = (hook: CypressHook, start?: number) => {\n enqueueRuntimeMessage({\n type: \"cypress_hook_start\",\n data: {\n name: hook.title,\n scopeType: hook.hookName.includes(\"each\") ? \"each\" : \"all\",\n position: hook.hookName.includes(\"before\") ? \"before\" : \"after\",\n start: start ?? Date.now(),\n },\n });\n};\n\nexport const reportHookEnd = (hook: CypressHook) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_hook_end\",\n data: {\n duration: hook.duration ?? 0,\n },\n });\n};\n\nexport const reportTestStart = (test: CypressTest) => {\n setCurrentTest(test);\n enqueueRuntimeMessage({\n type: \"cypress_test_start\",\n data: getTestStartData(test),\n });\n markTestAsReported(test);\n};\n\nexport const reportStepStart = (id: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_start\",\n data: {\n id,\n name,\n start: Date.now(),\n },\n });\n};\n\nexport const reportStepStop = (step: StepDescriptor, status?: Status, statusDetails?: StatusDetails) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_stop\",\n data: getStepStopData(step, status, statusDetails),\n });\n};\n\nexport const reportTestPass = () => {\n enqueueRuntimeMessage({\n type: \"cypress_test_pass\",\n data: {},\n });\n};\n\nexport const reportTestOrHookFail = (err: Error) => {\n const status = getStatusFromError(err);\n const statusDetails = getMessageAndTraceFromError(err, serializeValue);\n\n stopAllSteps(status, statusDetails);\n\n enqueueRuntimeMessage({\n type: \"cypress_fail\",\n data: {\n status,\n statusDetails,\n },\n });\n};\n\nexport const completeHookErrorReporting = (hook: CypressHook, err: Error) => {\n const isEachHook = hook.hookName.includes(\"each\");\n const suite = hook.parent!;\n const testFailData = getStatusDataOfTestSkippedByHookError(hook.title, isEachHook, err, suite);\n\n // Cypress doens't emit 'hook end' if the hook has failed.\n reportHookEnd(hook);\n\n // Cypress doens't emit 'test end' if the hook has failed.\n // We must report the test's end manualy in case of a 'before each' hook.\n reportCurrentTestIfAny();\n\n // Cypress skips the remaining tests in the suite of a failed hook.\n // We should include them to the report manually.\n reportRemainingTests(suite, testFailData);\n};\n\nexport const reportTestSkip = (test: CypressTest) => {\n if (isTestReported(test)) {\n // Ignore pending events for retry attempts that already ended.\n if (getCurrentTest() !== test) {\n return;\n }\n\n stopAllSteps(Status.SKIPPED, {\n message: \"The test was skipped before the command was completed\",\n });\n } else {\n reportTestStart(test);\n }\n\n enqueueRuntimeMessage({\n type: \"cypress_test_skip\",\n data: getTestSkipData(),\n });\n};\n\nexport const reportTestEnd = (test: CypressTest) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_test_end\",\n data: {\n duration: test.duration ?? 0,\n retries: (test as any)._retries ?? 0,\n },\n });\n dropCurrentTest();\n};\n\nexport const reportScreenshot = (path: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"attachment_path\",\n data: { path, name, contentType: ContentType.PNG },\n });\n};\n\nexport const completeSpecIfNoAfterHookLeft = (context: Mocha.Context) => {\n if (isLastRootAfterHook(context)) {\n const hook = context.test as CypressHook;\n if (!isAllureHook(hook)) {\n reportHookEnd(hook);\n }\n return completeSpecAsync();\n }\n};\n\nexport const completeSpecOnAfterHookFailure = (\n context: Mocha.Context,\n hookError: Error,\n): Cypress.Chainable<unknown> | undefined => {\n try {\n reportTestOrHookFail(hookError);\n completeHookErrorReporting(context.test as CypressHook, hookError);\n\n // cy.task's then doesn't have onrejected, that's why we don't log async Allure errors here.\n return completeSpecAsync();\n } catch (allureError) {\n logAllureRootAfterError(context, allureError);\n }\n};\n\nexport const throwAfterSpecCompletion = (context: Mocha.Context, err: any) => {\n const chain = completeSpecOnAfterHookFailure(context, err as Error)?.then(() => {\n throw err;\n });\n if (!chain) {\n throw err;\n }\n};\n\nexport const flushRuntimeMessages = () => getTestRuntime().flushAllureMessagesToTask(\"reportAllureCypressSpecMessages\");\n\nexport const completeSpecAsync = () =>\n getTestRuntime().flushAllureMessagesToTaskAsync(\"reportFinalAllureCypressSpecMessages\");\n\nconst reportCurrentTestIfAny = () => {\n const currentTest = getCurrentTest();\n if (currentTest) {\n reportTestEnd(currentTest);\n }\n};\n\nconst reportRemainingTests = (suite: CypressSuite, testFailData: CypressFailMessage[\"data\"]) => {\n for (const test of iterateTests(suite)) {\n // Some tests in the suite might've been already reported.\n if (!isTestReported(test)) {\n reportTestsSkippedByHookError(\n test,\n test.pending ? { ...getTestSkipData(), status: Status.SKIPPED } : testFailData,\n );\n }\n }\n};\n\nconst reportTestsSkippedByHookError = (test: CypressTest, testFailData: CypressFailMessage[\"data\"]) => {\n enqueueRuntimeMessage({\n type: \"cypress_skipped_test\",\n data: {\n ...getTestStartData(test),\n ...testFailData,\n ...getTestStopData(test),\n suites: getSuitePath(test).map((s) => s.id),\n },\n });\n markTestAsReported(test);\n};\n\nconst logAllureRootAfterError = (context: Mocha.Context, err: unknown) => {\n // We play safe and swallow errors here to keep the original 'after all' error.\n try {\n // eslint-disable-next-line no-console\n console.error(`Unexpected error when reporting the failure of ${context.test?.title ?? \"'after all'\"}`);\n // eslint-disable-next-line no-console\n console.error(err);\n } catch {}\n};\n"],"mappings":";;;;;AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,mBAAmB;AAEvD,SAASC,2BAA2B,EAAEC,kBAAkB,QAAQ,uBAAuB;AAGvF,SAASC,cAAc,QAAQ,cAAc;AAC7C,OAAOC,cAAc,MAAM,gBAAgB;AAC3C,SAASC,eAAe,EAAEC,qBAAqB,EAAEC,cAAc,EAAEC,cAAc,QAAQ,YAAY;AACnG,SAASC,aAAa,EAAEC,YAAY,QAAQ,YAAY;AACxD,SACEC,qCAAqC,EACrCC,eAAe,EACfC,YAAY,EACZC,eAAe,EACfC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,mBAAmB,EACnBC,cAAc,EACdC,YAAY,EACZC,kBAAkB,QACb,YAAY;AAEnB,OAAO,IAAMC,cAAc,GAAGA,CAAA,KAAM;EAClChB,qBAAqB,CAAC;IACpBiB,IAAI,EAAE,mBAAmB;IACzBC,IAAI,EAAE,CAAC;EACT,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,IAAMC,gBAAgB,GAAIC,KAAmB,IAAK;EACvDpB,qBAAqB,CAAC;IACpBiB,IAAI,EAAE,qBAAqB;IAC3BC,IAAI,EAAE;MACJG,EAAE,EAAED,KAAK,CAACC,EAAE;MACZC,IAAI,EAAEF,KAAK,CAACG,KAAK;MACjBC,IAAI,EAAEJ,KAAK,CAACI,IAAI;MAChBC,KAAK,EAAEC,IAAI,CAACC,GAAG,CAAC;IAClB;EACF,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,IAAMC,cAAc,GAAIR,KAAmB,IAAK;EACrDpB,qBAAqB,CAAC;IACpBiB,IAAI,EAAE,mBAAmB;IACzBC,IAAI,EAAE;M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AA,EAAM,CAAC;AACX,CAAC","ignoreList":[]}
|
|
@@ -7,8 +7,9 @@ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a
|
|
|
7
7
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
8
8
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
9
9
|
import { Status } from "allure-js-commons";
|
|
10
|
-
import { getMessageAndTraceFromError, getStatusFromError, isPromise } from "allure-js-commons/sdk";
|
|
10
|
+
import { getGlobalErrorDetails, getMessageAndTraceFromError, getStatusFromError, isPromise } from "allure-js-commons/sdk";
|
|
11
11
|
import { getGlobalTestRuntime, setGlobalTestRuntime } from "allure-js-commons/sdk/runtime";
|
|
12
|
+
import serializeValue from "./serialize.js";
|
|
12
13
|
import { enqueueRuntimeMessage, getRuntimeMessages, setRuntimeMessages } from "./state.js";
|
|
13
14
|
import { ALLURE_STEP_CMD_SUBJECT, startAllureApiStep, stopCurrentAllureApiStep } from "./steps.js";
|
|
14
15
|
import { uint8ArrayToBase64 } from "./utils.js";
|
|
@@ -73,6 +74,38 @@ class AllureCypressTestRuntime {
|
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
}
|
|
77
|
+
precondition(markdown) {
|
|
78
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
79
|
+
type: "metadata",
|
|
80
|
+
data: {
|
|
81
|
+
precondition: markdown
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
preconditionHtml(html) {
|
|
86
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
87
|
+
type: "metadata",
|
|
88
|
+
data: {
|
|
89
|
+
preconditionHtml: html
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
expectedResult(markdown) {
|
|
94
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
95
|
+
type: "metadata",
|
|
96
|
+
data: {
|
|
97
|
+
expectedResult: markdown
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
expectedResultHtml(html) {
|
|
102
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
103
|
+
type: "metadata",
|
|
104
|
+
data: {
|
|
105
|
+
expectedResultHtml: html
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
76
109
|
displayName(name) {
|
|
77
110
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
78
111
|
type: "metadata",
|
|
@@ -145,10 +178,19 @@ class AllureCypressTestRuntime {
|
|
|
145
178
|
}
|
|
146
179
|
});
|
|
147
180
|
}
|
|
148
|
-
globalError(
|
|
181
|
+
globalError() {
|
|
149
182
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
150
183
|
type: "global_error",
|
|
151
|
-
data:
|
|
184
|
+
data: getGlobalErrorDetails(...arguments)
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
metrics() {
|
|
188
|
+
for (var _len3 = arguments.length, results = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
189
|
+
results[_key3] = arguments[_key3];
|
|
190
|
+
}
|
|
191
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
192
|
+
type: "metric_result",
|
|
193
|
+
data: results
|
|
152
194
|
});
|
|
153
195
|
}
|
|
154
196
|
logStep(name) {
|
|
@@ -156,7 +198,7 @@ class AllureCypressTestRuntime {
|
|
|
156
198
|
var error = arguments.length > 2 ? arguments[2] : undefined;
|
|
157
199
|
if (_assertClassBrand(_AllureCypressTestRuntime_brand, this, _isInOriginContext).call(this)) {
|
|
158
200
|
startAllureApiStep(name);
|
|
159
|
-
stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error) : undefined);
|
|
201
|
+
stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error, serializeValue) : undefined);
|
|
160
202
|
return Cypress.Promise.resolve();
|
|
161
203
|
}
|
|
162
204
|
return cy.wrap(ALLURE_STEP_CMD_SUBJECT, {
|
|
@@ -165,7 +207,7 @@ class AllureCypressTestRuntime {
|
|
|
165
207
|
startAllureApiStep(name);
|
|
166
208
|
return Cypress.Promise.resolve();
|
|
167
209
|
}).then(() => {
|
|
168
|
-
stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error) : undefined);
|
|
210
|
+
stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error, serializeValue) : undefined);
|
|
169
211
|
return Cypress.Promise.resolve();
|
|
170
212
|
});
|
|
171
213
|
}
|
|
@@ -293,8 +335,8 @@ function _isInOriginContext() {
|
|
|
293
335
|
function _createSyncRuntime() {
|
|
294
336
|
return {
|
|
295
337
|
labels: function labels() {
|
|
296
|
-
for (var
|
|
297
|
-
_labels[
|
|
338
|
+
for (var _len4 = arguments.length, _labels = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
339
|
+
_labels[_key4] = arguments[_key4];
|
|
298
340
|
}
|
|
299
341
|
return enqueueRuntimeMessage({
|
|
300
342
|
type: "metadata",
|
|
@@ -304,8 +346,8 @@ function _createSyncRuntime() {
|
|
|
304
346
|
});
|
|
305
347
|
},
|
|
306
348
|
links: function links() {
|
|
307
|
-
for (var
|
|
308
|
-
_links[
|
|
349
|
+
for (var _len5 = arguments.length, _links = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
350
|
+
_links[_key5] = arguments[_key5];
|
|
309
351
|
}
|
|
310
352
|
return enqueueRuntimeMessage({
|
|
311
353
|
type: "metadata",
|
|
@@ -335,6 +377,30 @@ function _createSyncRuntime() {
|
|
|
335
377
|
descriptionHtml: html
|
|
336
378
|
}
|
|
337
379
|
}),
|
|
380
|
+
precondition: markdown => enqueueRuntimeMessage({
|
|
381
|
+
type: "metadata",
|
|
382
|
+
data: {
|
|
383
|
+
precondition: markdown
|
|
384
|
+
}
|
|
385
|
+
}),
|
|
386
|
+
preconditionHtml: html => enqueueRuntimeMessage({
|
|
387
|
+
type: "metadata",
|
|
388
|
+
data: {
|
|
389
|
+
preconditionHtml: html
|
|
390
|
+
}
|
|
391
|
+
}),
|
|
392
|
+
expectedResult: markdown => enqueueRuntimeMessage({
|
|
393
|
+
type: "metadata",
|
|
394
|
+
data: {
|
|
395
|
+
expectedResult: markdown
|
|
396
|
+
}
|
|
397
|
+
}),
|
|
398
|
+
expectedResultHtml: html => enqueueRuntimeMessage({
|
|
399
|
+
type: "metadata",
|
|
400
|
+
data: {
|
|
401
|
+
expectedResultHtml: html
|
|
402
|
+
}
|
|
403
|
+
}),
|
|
338
404
|
displayName: name => enqueueRuntimeMessage({
|
|
339
405
|
type: "metadata",
|
|
340
406
|
data: {
|
|
@@ -397,15 +463,17 @@ function _createSyncRuntime() {
|
|
|
397
463
|
fileExtension: options.fileExtension
|
|
398
464
|
}
|
|
399
465
|
}),
|
|
400
|
-
globalError:
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
466
|
+
globalError: function globalError() {
|
|
467
|
+
return enqueueRuntimeMessage({
|
|
468
|
+
type: "global_error",
|
|
469
|
+
data: getGlobalErrorDetails(...arguments)
|
|
470
|
+
});
|
|
471
|
+
},
|
|
404
472
|
logStep: function logStep(name) {
|
|
405
473
|
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Status.PASSED;
|
|
406
474
|
var error = arguments.length > 2 ? arguments[2] : undefined;
|
|
407
475
|
startAllureApiStep(name);
|
|
408
|
-
stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error) : undefined);
|
|
476
|
+
stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error, serializeValue) : undefined);
|
|
409
477
|
},
|
|
410
478
|
step: (name, body) => {
|
|
411
479
|
startAllureApiStep(name);
|
|
@@ -420,7 +488,7 @@ function _createSyncRuntime() {
|
|
|
420
488
|
return result;
|
|
421
489
|
} catch (err) {
|
|
422
490
|
var error = err;
|
|
423
|
-
stopCurrentAllureApiStep(getStatusFromError(error), getMessageAndTraceFromError(error));
|
|
491
|
+
stopCurrentAllureApiStep(getStatusFromError(error), getMessageAndTraceFromError(error, serializeValue));
|
|
424
492
|
throw err;
|
|
425
493
|
}
|
|
426
494
|
},
|