allure-cypress 3.14.0 → 3.16.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.
Files changed (49) hide show
  1. package/README.md +18 -4
  2. package/dist/cjs/browser/commandLog.js +44 -57
  3. package/dist/cjs/browser/commandLog.js.map +1 -1
  4. package/dist/cjs/browser/events/cypress.js +20 -9
  5. package/dist/cjs/browser/events/cypress.js.map +1 -1
  6. package/dist/cjs/browser/lifecycle.js +4 -1
  7. package/dist/cjs/browser/lifecycle.js.map +1 -1
  8. package/dist/cjs/browser/patching.js +16 -9
  9. package/dist/cjs/browser/patching.js.map +1 -1
  10. package/dist/cjs/browser/runtime.js +86 -10
  11. package/dist/cjs/browser/runtime.js.map +1 -1
  12. package/dist/cjs/browser/serialize.js +19 -23
  13. package/dist/cjs/browser/serialize.js.map +1 -1
  14. package/dist/cjs/browser/steps.js +15 -7
  15. package/dist/cjs/browser/steps.js.map +1 -1
  16. package/dist/cjs/browser/testplan.js +13 -11
  17. package/dist/cjs/browser/testplan.js.map +1 -1
  18. package/dist/cjs/browser/utils.js +9 -9
  19. package/dist/cjs/browser/utils.js.map +1 -1
  20. package/dist/cjs/index.js +2 -1
  21. package/dist/cjs/index.js.map +4 -4
  22. package/dist/cjs/reporter.js +123 -123
  23. package/dist/cjs/reporter.js.map +1 -1
  24. package/dist/esm/browser/commandLog.js +44 -57
  25. package/dist/esm/browser/commandLog.js.map +1 -1
  26. package/dist/esm/browser/events/cypress.js +20 -9
  27. package/dist/esm/browser/events/cypress.js.map +1 -1
  28. package/dist/esm/browser/lifecycle.js +3 -1
  29. package/dist/esm/browser/lifecycle.js.map +1 -1
  30. package/dist/esm/browser/patching.js +16 -9
  31. package/dist/esm/browser/patching.js.map +1 -1
  32. package/dist/esm/browser/runtime.js +85 -10
  33. package/dist/esm/browser/runtime.js.map +1 -1
  34. package/dist/esm/browser/serialize.js +19 -23
  35. package/dist/esm/browser/serialize.js.map +1 -1
  36. package/dist/esm/browser/steps.js +14 -7
  37. package/dist/esm/browser/steps.js.map +1 -1
  38. package/dist/esm/browser/testplan.js +13 -11
  39. package/dist/esm/browser/testplan.js.map +1 -1
  40. package/dist/esm/browser/utils.js +8 -9
  41. package/dist/esm/browser/utils.js.map +1 -1
  42. package/dist/esm/index.js +2 -1
  43. package/dist/esm/index.js.map +4 -4
  44. package/dist/esm/reporter.js +124 -124
  45. package/dist/esm/reporter.js.map +1 -1
  46. package/dist/types/browser/lifecycle.d.ts +1 -1
  47. package/dist/types/browser/runtime.d.ts +6 -2
  48. package/dist/types/reporter.d.ts +5 -0
  49. package/package.json +13 -12
@@ -1 +1 @@
1
- {"version":3,"file":"reporter.js","names":["_allureJsCommons","require","_sdk","_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","details","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"],"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 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({\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 });\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 all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JsCommons","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","_ref3$data","id","name","root","suiteNames","suiteId","scope","startScope","suiteScopes","suiteIdToScope","suiteScopeToId","_ref4","pop","writeScope","_ref5","_ref5$data","scopeType","position","start","isEach","isAfterEach","testScope","last","fixture","startFixture","status","_ref6","duration","fixtureUuid","updateFixture","_fixture$status","Status","PASSED","stopFixture","_ref7","_ref7$data","fullNameSuffix","testResultData","test","videoScope","_ref8","scopes","_ref8$labels","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","_ref9$data","statusDetails","setError","result","assign","_classPrivateFieldGet3","applyGlobalRuntimeMessages","toGlobalErrorMessage","details","testUuid","updateTest","failed","testResult","_ref0","SKIPPED","_ref1","_ref1$data","suites","retries","map","Boolean","writeTest","_ref10","_ref11","parameters","toString","excluded","FINISHED","stopTest","getDefaultSuiteLabels","_ref12","stop","_ref12$steps","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","_config$videoOnFailOn","rest","ReporterRuntime","writer","createDefaultWriter","exports","createRuntimeState","allureConfig","getRuntimeConfigDefaults","initialized","testPlan","parseTestPlan","enableExcludedTests","projectDir","getProjectRoot","stepStack","stepsToFinalize","nextApiStepId","_ref16","DEFAULT_RUNTIME_CONFIG","_ref16$stepsFromComma","stepsFromCommands","_ref16$stepsFromComma2","_ref16$stepsFromComma3","enabled","_ref16$stepsFromComma4","maxArgumentLength","_ref16$stepsFromComma5","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({ enableExcludedTests: true }),\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,CAA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AA2C,EAC3CvB,YAAkC,KAC/B;EACH;EACA,IAAI,CAACA,YAAY,IAAIuB,aAAa,IAAI,EAAE,KAAK,IAAIA,aAAa,CAAC,EAAE;IAC/DvB,YAAY,GAAGuB,aAAoC;EACrD;EAEA,IAAMM,gBAAgB,GAAGN,aAAa,IAAI,KAAK,IAAIA,aAAa;EAEhE,IAAMO,qBAAqB,GAAG,IAAIlN,aAAa,CAACoL,YAAY,CAAC;EAC7D8B,qBAAqB,CAACC,eAAe,CAAC9M,EAAE,CAAC;EAEzC,IAAI4M,gBAAgB,EAAE;IACpBP,sBAAsB,CAACC,aAAa,EAAEvB,YAAY,CAAC;EACrD;EAEA,OAAO8B,qBAAqB;AAC9B,CAAC;AAAChC,OAAA,CAAA8B,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  import { isDefined } from "../utils.js";
2
8
  import { reportStepStart } from "./lifecycle.js";
3
9
  import serializePropValue from "./serialize.js";
@@ -9,10 +15,9 @@ export var shouldCreateStepFromCommandLogEntry = entry => {
9
15
  // The user has turned the automatic steps off. Only the steps created via the Allure API are reported.
10
16
  return false;
11
17
  }
12
- var {
13
- event,
14
- instrument
15
- } = entry.attributes;
18
+ var _entry$attributes = entry.attributes,
19
+ event = _entry$attributes.event,
20
+ instrument = _entry$attributes.instrument;
16
21
  if (instrument !== "command") {
17
22
  // We are interested in the "TEST BODY" panel only for now.
18
23
  // Other instruments are logged in separate panels.
@@ -41,12 +46,9 @@ export var shouldCreateStepFromCommandLogEntry = entry => {
41
46
  export var setupScreenshotAttachmentStep = (originalName, name) => {
42
47
  var step = getCurrentStep();
43
48
  if (step && isLogStep(step)) {
44
- var {
45
- name: commandName,
46
- props: {
47
- name: nameFromProps
48
- }
49
- } = resolveConsoleProps(step.log);
49
+ var _resolveConsoleProps = resolveConsoleProps(step.log),
50
+ commandName = _resolveConsoleProps.name,
51
+ nameFromProps = _resolveConsoleProps.props.name;
50
52
  if (commandName === "screenshot" && nameFromProps === originalName) {
51
53
  step.attachmentName = name;
52
54
  }
@@ -62,9 +64,7 @@ export var startCommandLogStep = entry => {
62
64
  scheduleCommandLogStepStop(entry);
63
65
  };
64
66
  export var stopCommandLogStep = entryId => findAndStopStepWithSubsteps(_ref => {
65
- var {
66
- id
67
- } = _ref;
67
+ var id = _ref.id;
68
68
  return id === entryId;
69
69
  });
70
70
  var pushLogEntry = entry => {
@@ -88,11 +88,10 @@ var pushLogEntry = entry => {
88
88
  });
89
89
  };
90
90
  var scheduleCommandLogStepStop = entry => {
91
- var {
92
- groupStart,
93
- end,
94
- id
95
- } = entry.attributes;
91
+ var _entry$attributes2 = entry.attributes,
92
+ groupStart = _entry$attributes2.groupStart,
93
+ end = _entry$attributes2.end,
94
+ id = _entry$attributes2.id;
96
95
  if (end) {
97
96
  // Some entries are already completed (this is similar to the idea behind allure.logStep).
98
97
  // Cypress won't call entry.end() in such a case, so we need to stop such a step now.
@@ -118,25 +117,24 @@ var scheduleCommandLogStepStop = entry => {
118
117
  }
119
118
  };
120
119
  var isApiStepErrorLogEntry = entry => {
121
- var {
122
- name
123
- } = entry.attributes;
120
+ var name = entry.attributes.name;
124
121
  return name === "then" && Object.is(resolveConsoleProps(entry).props["Applied To"], ALLURE_STEP_CMD_SUBJECT);
125
122
  };
126
123
  var getCommandLogStepName = entry => {
127
124
  var _ref2, _ref3, _maybeGetAssertionLog;
128
- var {
129
- name,
130
- message,
131
- displayName
132
- } = entry.attributes;
125
+ var _entry$attributes3 = entry.attributes,
126
+ name = _entry$attributes3.name,
127
+ message = _entry$attributes3.message,
128
+ displayName = _entry$attributes3.displayName;
133
129
  var resolvedName = (displayName !== null && displayName !== void 0 ? displayName : name).trim();
134
130
  var resolvedMessage = ((_ref2 = (_ref3 = (_maybeGetAssertionLog = maybeGetAssertionLogMessage(entry)) !== null && _maybeGetAssertionLog !== void 0 ? _maybeGetAssertionLog : maybeGetCucumberLogMessage(entry)) !== null && _ref3 !== void 0 ? _ref3 : resolveRenderProps(entry).message) !== null && _ref2 !== void 0 ? _ref2 : message).trim();
135
131
  var stepName = [resolvedName, resolvedMessage].filter(Boolean).join(" ");
136
132
  return stepName;
137
133
  };
138
134
  var getCommandLogStepParameters = entry => getLogProps(entry).map(_ref4 => {
139
- var [k, v] = _ref4;
135
+ var _ref5 = _slicedToArray(_ref4, 2),
136
+ k = _ref5[0],
137
+ v = _ref5[1];
140
138
  return {
141
139
  name: k.toString(),
142
140
  value: serializePropValue(v)
@@ -144,22 +142,18 @@ var getCommandLogStepParameters = entry => getLogProps(entry).map(_ref4 => {
144
142
  }).filter(getPropValueSetFilter(entry));
145
143
  var WELL_KNOWN_CUCUMBER_LOG_NAMES = ["Given", "When", "Then", "And"];
146
144
  var maybeGetCucumberLogMessage = entry => {
147
- var {
148
- attributes: {
149
- name,
150
- message
151
- }
152
- } = entry;
145
+ var _entry$attributes4 = entry.attributes,
146
+ name = _entry$attributes4.name,
147
+ message = _entry$attributes4.message;
153
148
  if (WELL_KNOWN_CUCUMBER_LOG_NAMES.includes(name.trim()) && message.startsWith("**") && message.endsWith("**")) {
154
149
  return message.substring(2, message.length - 2);
155
150
  }
156
151
  };
157
152
  var getLogProps = entry => {
158
153
  var isAssertionWithMessage = !!maybeGetAssertionLogMessage(entry);
159
- var {
160
- props,
161
- name
162
- } = resolveConsoleProps(entry);
154
+ var _resolveConsoleProps2 = resolveConsoleProps(entry),
155
+ props = _resolveConsoleProps2.props,
156
+ name = _resolveConsoleProps2.name;
163
157
 
164
158
  // accessing LocalStorage after the page reload can stick the test runner
165
159
  // to avoid the issue, we just need to log the command manually
@@ -173,8 +167,10 @@ var getLogProps = entry => {
173
167
  // For assertion logs, we interpolate the 'Message' property, which contains unformatted assertion description,
174
168
  // directly into the step's name.
175
169
  // No need to keep the exact same information in the step's parameters.
176
- return Object.entries(props).filter(_ref5 => {
177
- var [k, v] = _ref5;
170
+ return Object.entries(props).filter(_ref6 => {
171
+ var _ref7 = _slicedToArray(_ref6, 2),
172
+ k = _ref7[0],
173
+ v = _ref7[1];
178
174
  return isDefined(v) && !(isAssertionWithMessage && k === "Message");
179
175
  });
180
176
  };
@@ -186,30 +182,21 @@ var maybeGetAssertionLogMessage = entry => {
186
182
  }
187
183
  }
188
184
  };
189
- var isAssertLog = _ref6 => {
190
- var {
191
- attributes: {
192
- name
193
- }
194
- } = _ref6;
185
+ var isAssertLog = _ref8 => {
186
+ var name = _ref8.attributes.name;
195
187
  return name === "assert";
196
188
  };
197
189
  var getCurrentLogEntry = () => getStepStack().findLast(isLogStep);
198
190
  var shouldStopCurrentLogStep = (currentLogEntry, newLogEntry) => {
199
- var {
200
- groupStart: currentEntryIsGroup,
201
- type: currentEntryType
202
- } = currentLogEntry.attributes;
203
- var {
204
- type: newEntryType
205
- } = newLogEntry.attributes;
191
+ var _currentLogEntry$attr = currentLogEntry.attributes,
192
+ currentEntryIsGroup = _currentLogEntry$attr.groupStart,
193
+ currentEntryType = _currentLogEntry$attr.type;
194
+ var newEntryType = newLogEntry.attributes.type;
206
195
  return !currentEntryIsGroup && (currentEntryType === "child" || newEntryType !== "child");
207
196
  };
208
- var getPropValueSetFilter = entry => entry.attributes.name === "wrap" ? () => true : _ref7 => {
209
- var {
210
- name,
211
- value
212
- } = _ref7;
197
+ var getPropValueSetFilter = entry => entry.attributes.name === "wrap" ? () => true : _ref9 => {
198
+ var name = _ref9.name,
199
+ value = _ref9.value;
213
200
  return name !== "Yielded" || value !== "{}";
214
201
  };
215
202
  //# sourceMappingURL=commandLog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commandLog.js","names":["isDefined","reportStepStart","serializePropValue","getConfig","getCurrentStep","getStepStack","pushStep","setupStepFinalization","ALLURE_STEP_CMD_SUBJECT","findAndStopStepWithSubsteps","isLogStep","resolveConsoleProps","resolveRenderProps","shouldCreateStepFromCommandLogEntry","entry","stepsFromCommands","enabled","event","instrument","attributes","isApiStepErrorLogEntry","setupScreenshotAttachmentStep","originalName","name","step","commandName","props","nameFromProps","log","attachmentName","startCommandLogStep","currentLogEntry","getCurrentLogEntry","shouldStopCurrentLogStep","stopCommandLogStep","id","pushLogEntry","getCommandLogStepName","scheduleCommandLogStepStop","entryId","_ref","stepDescriptor","type","data","parameters","getCommandLogStepParameters","groupStart","end","originalEndGroup","endGroup","call","originalEnd","Object","is","_ref2","_ref3","_maybeGetAssertionLog","message","displayName","resolvedName","trim","resolvedMessage","maybeGetAssertionLogMessage","maybeGetCucumberLogMessage","stepName","filter","Boolean","join","getLogProps","map","_ref4","k","v","toString","value","getPropValueSetFilter","WELL_KNOWN_CUCUMBER_LOG_NAMES","includes","startsWith","endsWith","substring","length","isAssertionWithMessage","entries","_ref5","isAssertLog","Message","_ref6","findLast","newLogEntry","currentEntryIsGroup","currentEntryType","newEntryType","_ref7"],"sources":["../../../src/browser/commandLog.ts"],"sourcesContent":["import type { Parameter } from \"allure-js-commons\";\n\nimport type { CypressLogEntry, LogStepDescriptor } from \"../types.js\";\nimport { isDefined } from \"../utils.js\";\nimport { reportStepStart } from \"./lifecycle.js\";\nimport serializePropValue from \"./serialize.js\";\nimport { getConfig, getCurrentStep, getStepStack, pushStep, setupStepFinalization } from \"./state.js\";\nimport { ALLURE_STEP_CMD_SUBJECT, findAndStopStepWithSubsteps, isLogStep } from \"./steps.js\";\nimport { resolveConsoleProps, resolveRenderProps } from \"./utils.js\";\n\nexport const shouldCreateStepFromCommandLogEntry = (entry: CypressLogEntry) => {\n if (!getConfig().stepsFromCommands.enabled) {\n // The user has turned the automatic steps off. Only the steps created via the Allure API are reported.\n return false;\n }\n\n const { event, instrument } = entry.attributes;\n if (instrument !== \"command\") {\n // We are interested in the \"TEST BODY\" panel only for now.\n // Other instruments are logged in separate panels.\n return false;\n }\n\n if (event) {\n // Events are tricky to report as they may span across commands and even leave the test's scope.\n // We ignore them for now.\n return false;\n }\n\n if (isApiStepErrorLogEntry(entry)) {\n // Cypress don't create a log message for 'cy.then' except when it throws an error.\n // This is in particularly happens when the function passed to 'allure.step' throws. In such a case however,\n // creating an extra step from the log entry is redundant because the error is already included in the report as\n // a part of the step.\n return false;\n }\n\n return true;\n};\n\n/**\n * Checks if the current step represents a cy.screenshot command log entry. If this is the case, associates the name\n * of the screenshot with the step. Later, that will allow converting the step with the attachment into the attachment\n * step.\n */\nexport const setupScreenshotAttachmentStep = (originalName: string | undefined, name: string) => {\n const step = getCurrentStep();\n if (step && isLogStep(step)) {\n const {\n name: commandName,\n props: { name: nameFromProps },\n } = resolveConsoleProps(step.log);\n if (commandName === \"screenshot\" && nameFromProps === originalName) {\n step.attachmentName = name;\n }\n }\n};\n\nexport const startCommandLogStep = (entry: CypressLogEntry) => {\n const currentLogEntry = getCurrentLogEntry();\n\n if (typeof currentLogEntry !== \"undefined\" && shouldStopCurrentLogStep(currentLogEntry.log, entry)) {\n stopCommandLogStep(currentLogEntry.log.attributes.id);\n }\n\n pushLogEntry(entry);\n reportStepStart(entry.attributes.id, getCommandLogStepName(entry));\n scheduleCommandLogStepStop(entry);\n};\n\nexport const stopCommandLogStep = (entryId: string) => findAndStopStepWithSubsteps(({ id }) => id === entryId);\n\nconst pushLogEntry = (entry: CypressLogEntry) => {\n const id = entry.attributes.id;\n const stepDescriptor: LogStepDescriptor = { id, type: \"log\", log: entry };\n\n pushStep(stepDescriptor);\n\n // Some properties of some Command Log entries are undefined at the time the entry is stopped. An example is the\n // Yielded property of some queries. We defer converting them to Allure step parameters until the test/hook ends.\n setupStepFinalization(stepDescriptor, (data) => {\n data.parameters = getCommandLogStepParameters(entry);\n\n if (stepDescriptor.attachmentName) {\n // Rename the step to match the attachment name. Once the names are the same, Allure will render the\n // attachment in the place of the step.\n data.name = stepDescriptor.attachmentName;\n }\n });\n};\n\nconst scheduleCommandLogStepStop = (entry: CypressLogEntry) => {\n const { groupStart, end, id } = entry.attributes;\n if (end) {\n // Some entries are already completed (this is similar to the idea behind allure.logStep).\n // Cypress won't call entry.end() in such a case, so we need to stop such a step now.\n // Example: cy.log\n stopCommandLogStep(id);\n } else if (groupStart) {\n // A logging group must be stopped be the user via the Cypress.Log.endGroup() call.\n // If the call is missing, the corresponding step will be stopped either at the test's (the hook's) end.\n const originalEndGroup = entry.endGroup;\n entry.endGroup = function () {\n stopCommandLogStep(id);\n return originalEndGroup.call(this);\n };\n } else {\n // Regular log entries are finalized by Cypress via the Cypress.Log.end() call. We're hooking into this function\n // to complete the step at the same time.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalEnd = entry.end;\n entry.end = function () {\n stopCommandLogStep(id);\n return originalEnd.call(this);\n };\n }\n};\n\nconst isApiStepErrorLogEntry = (entry: CypressLogEntry) => {\n const { name } = entry.attributes;\n return name === \"then\" && Object.is(resolveConsoleProps(entry).props[\"Applied To\"], ALLURE_STEP_CMD_SUBJECT);\n};\n\nconst getCommandLogStepName = (entry: CypressLogEntry) => {\n const { name, message, displayName } = entry.attributes;\n const resolvedName = (displayName ?? name).trim();\n const resolvedMessage = (\n maybeGetAssertionLogMessage(entry) ??\n maybeGetCucumberLogMessage(entry) ??\n resolveRenderProps(entry).message ??\n message\n ).trim();\n const stepName = [resolvedName, resolvedMessage].filter(Boolean).join(\" \");\n return stepName;\n};\n\nconst getCommandLogStepParameters = (entry: CypressLogEntry) =>\n getLogProps(entry)\n .map(([k, v]) => ({\n name: k.toString(),\n value: serializePropValue(v),\n }))\n .filter(getPropValueSetFilter(entry));\n\nconst WELL_KNOWN_CUCUMBER_LOG_NAMES = [\"Given\", \"When\", \"Then\", \"And\"];\n\nconst maybeGetCucumberLogMessage = (entry: CypressLogEntry) => {\n const {\n attributes: { name, message },\n } = entry;\n if (WELL_KNOWN_CUCUMBER_LOG_NAMES.includes(name.trim()) && message.startsWith(\"**\") && message.endsWith(\"**\")) {\n return message.substring(2, message.length - 2);\n }\n};\n\nconst getLogProps = (entry: CypressLogEntry) => {\n const isAssertionWithMessage = !!maybeGetAssertionLogMessage(entry);\n const { props, name } = resolveConsoleProps(entry);\n\n // accessing LocalStorage after the page reload can stick the test runner\n // to avoid the issue, we just need to log the command manually\n // the problem potentially can happen with other storage related commands, like `clearAllLocalStorage`, `clearAllSessionStorage`, `getAllLocalStorage`, `getAllSessionStorage`, `setLocalStorage`, `setSessionStorage`\n // but probably, we don't need to silent them all at this moment\n // the context: https://github.com/allure-framework/allure-js/issues/1222\n if ([\"clearLocalStorage\"].includes(name)) {\n return [] as [string, unknown][];\n }\n\n // For assertion logs, we interpolate the 'Message' property, which contains unformatted assertion description,\n // directly into the step's name.\n // No need to keep the exact same information in the step's parameters.\n return Object.entries(props).filter(([k, v]) => isDefined(v) && !(isAssertionWithMessage && k === \"Message\"));\n};\n\nconst maybeGetAssertionLogMessage = (entry: CypressLogEntry) => {\n if (isAssertLog(entry)) {\n const message = resolveConsoleProps(entry).props.Message;\n\n if (message && typeof message === \"string\") {\n return message;\n }\n }\n};\n\nconst isAssertLog = ({ attributes: { name } }: CypressLogEntry) => name === \"assert\";\n\nconst getCurrentLogEntry = () => getStepStack().findLast(isLogStep);\n\nconst shouldStopCurrentLogStep = (currentLogEntry: CypressLogEntry, newLogEntry: CypressLogEntry) => {\n const { groupStart: currentEntryIsGroup, type: currentEntryType } = currentLogEntry.attributes;\n const { type: newEntryType } = newLogEntry.attributes;\n\n return !currentEntryIsGroup && (currentEntryType === \"child\" || newEntryType !== \"child\");\n};\n\nconst getPropValueSetFilter = (entry: CypressLogEntry) =>\n entry.attributes.name === \"wrap\" ? () => true : ({ name, value }: Parameter) => name !== \"Yielded\" || value !== \"{}\";\n"],"mappings":"AAGA,SAASA,SAAS,QAAQ,aAAa;AACvC,SAASC,eAAe,QAAQ,gBAAgB;AAChD,OAAOC,kBAAkB,MAAM,gBAAgB;AAC/C,SAASC,SAAS,EAAEC,cAAc,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,qBAAqB,QAAQ,YAAY;AACrG,SAASC,uBAAuB,EAAEC,2BAA2B,EAAEC,SAAS,QAAQ,YAAY;AAC5F,SAASC,mBAAmB,EAAEC,kBAAkB,QAAQ,YAAY;AAEpE,OAAO,IAAMC,mCAAmC,GAAIC,KAAsB,IAAK;EAC7E,IAAI,CAACX,SAAS,CAAC,CAAC,CAACY,iBAAiB,CAACC,OAAO,EAAE;IAC1C;IACA,OAAO,KAAK;EACd;EAEA,IAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGJ,KAAK,CAACK,UAAU;EAC9C,IAAID,UAAU,KAAK,SAAS,EAAE;IAC5B;IACA;IACA,OAAO,KAAK;EACd;EAEA,IAAID,KAAK,EAAE;IACT;IACA;IACA,OAAO,KAAK;EACd;EAEA,IAAIG,sBAAsB,CAACN,KAAK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AExD,IAAI7B,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC1C,OAAOA,OAAO;IAChB;EACF;AACF,CAAC;AAED,IAAM4B,WAAW,GAAGE,KAAA;EAAA,IAAC;IAAEpE,UAAU,EAAE;MAAEI;IAAK;EAAmB,CAAC,GAAAgE,KAAA;EAAA,OAAKhE,IAAI,KAAK,QAAQ;AAAA;AAEpF,IAAMS,kBAAkB,GAAGA,CAAA,KAAM3B,YAAY,CAAC,CAAC,CAACmF,QAAQ,CAAC9E,SAAS,CAAC;AAEnE,IAAMuB,wBAAwB,GAAGA,CAACF,eAAgC,EAAE0D,WAA4B,KAAK;EACnG,IAAM;IAAE3C,UAAU,EAAE4C,mBAAmB;IAAEhD,IAAI,EAAEiD;EAAiB,CAAC,GAAG5D,eAAe,CAACZ,UAAU;EAC9F,IAAM;IAAEuB,IAAI,EAAEkD;EAAa,CAAC,GAAGH,WAAW,CAACtE,UAAU;EAErD,OAAO,CAACuE,mBAAmB,KAAKC,gBAAgB,KAAK,OAAO,IAAIC,YAAY,KAAK,OAAO,CAAC;AAC3F,CAAC;AAED,IAAMjB,qBAAqB,GAAI7D,KAAsB,IACnDA,KAAK,CAACK,UAAU,CAACI,IAAI,KAAK,MAAM,GAAG,MAAM,IAAI,GAAGsE,KAAA;EAAA,IAAC;IAAEtE,IAAI;IAAEmD;EAAiB,CAAC,GAAAmB,KAAA;EAAA,OAAKtE,IAAI,KAAK,SAAS,IAAImD,KAAK,KAAK,IAAI;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"commandLog.js","names":["isDefined","reportStepStart","serializePropValue","getConfig","getCurrentStep","getStepStack","pushStep","setupStepFinalization","ALLURE_STEP_CMD_SUBJECT","findAndStopStepWithSubsteps","isLogStep","resolveConsoleProps","resolveRenderProps","shouldCreateStepFromCommandLogEntry","entry","stepsFromCommands","enabled","_entry$attributes","attributes","event","instrument","isApiStepErrorLogEntry","setupScreenshotAttachmentStep","originalName","name","step","_resolveConsoleProps","log","commandName","nameFromProps","props","attachmentName","startCommandLogStep","currentLogEntry","getCurrentLogEntry","shouldStopCurrentLogStep","stopCommandLogStep","id","pushLogEntry","getCommandLogStepName","scheduleCommandLogStepStop","entryId","_ref","stepDescriptor","type","data","parameters","getCommandLogStepParameters","_entry$attributes2","groupStart","end","originalEndGroup","endGroup","call","originalEnd","Object","is","_ref2","_ref3","_maybeGetAssertionLog","_entry$attributes3","message","displayName","resolvedName","trim","resolvedMessage","maybeGetAssertionLogMessage","maybeGetCucumberLogMessage","stepName","filter","Boolean","join","getLogProps","map","_ref4","_ref5","_slicedToArray","k","v","toString","value","getPropValueSetFilter","WELL_KNOWN_CUCUMBER_LOG_NAMES","_entry$attributes4","includes","startsWith","endsWith","substring","length","isAssertionWithMessage","_resolveConsoleProps2","entries","_ref6","_ref7","isAssertLog","Message","_ref8","findLast","newLogEntry","_currentLogEntry$attr","currentEntryIsGroup","currentEntryType","newEntryType","_ref9"],"sources":["../../../src/browser/commandLog.ts"],"sourcesContent":["import type { Parameter } from \"allure-js-commons\";\n\nimport type { CypressLogEntry, LogStepDescriptor } from \"../types.js\";\nimport { isDefined } from \"../utils.js\";\nimport { reportStepStart } from \"./lifecycle.js\";\nimport serializePropValue from \"./serialize.js\";\nimport { getConfig, getCurrentStep, getStepStack, pushStep, setupStepFinalization } from \"./state.js\";\nimport { ALLURE_STEP_CMD_SUBJECT, findAndStopStepWithSubsteps, isLogStep } from \"./steps.js\";\nimport { resolveConsoleProps, resolveRenderProps } from \"./utils.js\";\n\nexport const shouldCreateStepFromCommandLogEntry = (entry: CypressLogEntry) => {\n if (!getConfig().stepsFromCommands.enabled) {\n // The user has turned the automatic steps off. Only the steps created via the Allure API are reported.\n return false;\n }\n\n const { event, instrument } = entry.attributes;\n if (instrument !== \"command\") {\n // We are interested in the \"TEST BODY\" panel only for now.\n // Other instruments are logged in separate panels.\n return false;\n }\n\n if (event) {\n // Events are tricky to report as they may span across commands and even leave the test's scope.\n // We ignore them for now.\n return false;\n }\n\n if (isApiStepErrorLogEntry(entry)) {\n // Cypress don't create a log message for 'cy.then' except when it throws an error.\n // This is in particularly happens when the function passed to 'allure.step' throws. In such a case however,\n // creating an extra step from the log entry is redundant because the error is already included in the report as\n // a part of the step.\n return false;\n }\n\n return true;\n};\n\n/**\n * Checks if the current step represents a cy.screenshot command log entry. If this is the case, associates the name\n * of the screenshot with the step. Later, that will allow converting the step with the attachment into the attachment\n * step.\n */\nexport const setupScreenshotAttachmentStep = (originalName: string | undefined, name: string) => {\n const step = getCurrentStep();\n if (step && isLogStep(step)) {\n const {\n name: commandName,\n props: { name: nameFromProps },\n } = resolveConsoleProps(step.log);\n if (commandName === \"screenshot\" && nameFromProps === originalName) {\n step.attachmentName = name;\n }\n }\n};\n\nexport const startCommandLogStep = (entry: CypressLogEntry) => {\n const currentLogEntry = getCurrentLogEntry();\n\n if (typeof currentLogEntry !== \"undefined\" && shouldStopCurrentLogStep(currentLogEntry.log, entry)) {\n stopCommandLogStep(currentLogEntry.log.attributes.id);\n }\n\n pushLogEntry(entry);\n reportStepStart(entry.attributes.id, getCommandLogStepName(entry));\n scheduleCommandLogStepStop(entry);\n};\n\nexport const stopCommandLogStep = (entryId: string) => findAndStopStepWithSubsteps(({ id }) => id === entryId);\n\nconst pushLogEntry = (entry: CypressLogEntry) => {\n const id = entry.attributes.id;\n const stepDescriptor: LogStepDescriptor = { id, type: \"log\", log: entry };\n\n pushStep(stepDescriptor);\n\n // Some properties of some Command Log entries are undefined at the time the entry is stopped. An example is the\n // Yielded property of some queries. We defer converting them to Allure step parameters until the test/hook ends.\n setupStepFinalization(stepDescriptor, (data) => {\n data.parameters = getCommandLogStepParameters(entry);\n\n if (stepDescriptor.attachmentName) {\n // Rename the step to match the attachment name. Once the names are the same, Allure will render the\n // attachment in the place of the step.\n data.name = stepDescriptor.attachmentName;\n }\n });\n};\n\nconst scheduleCommandLogStepStop = (entry: CypressLogEntry) => {\n const { groupStart, end, id } = entry.attributes;\n if (end) {\n // Some entries are already completed (this is similar to the idea behind allure.logStep).\n // Cypress won't call entry.end() in such a case, so we need to stop such a step now.\n // Example: cy.log\n stopCommandLogStep(id);\n } else if (groupStart) {\n // A logging group must be stopped be the user via the Cypress.Log.endGroup() call.\n // If the call is missing, the corresponding step will be stopped either at the test's (the hook's) end.\n const originalEndGroup = entry.endGroup;\n entry.endGroup = function () {\n stopCommandLogStep(id);\n return originalEndGroup.call(this);\n };\n } else {\n // Regular log entries are finalized by Cypress via the Cypress.Log.end() call. We're hooking into this function\n // to complete the step at the same time.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalEnd = entry.end;\n entry.end = function () {\n stopCommandLogStep(id);\n return originalEnd.call(this);\n };\n }\n};\n\nconst isApiStepErrorLogEntry = (entry: CypressLogEntry) => {\n const { name } = entry.attributes;\n return name === \"then\" && Object.is(resolveConsoleProps(entry).props[\"Applied To\"], ALLURE_STEP_CMD_SUBJECT);\n};\n\nconst getCommandLogStepName = (entry: CypressLogEntry) => {\n const { name, message, displayName } = entry.attributes;\n const resolvedName = (displayName ?? name).trim();\n const resolvedMessage = (\n maybeGetAssertionLogMessage(entry) ??\n maybeGetCucumberLogMessage(entry) ??\n resolveRenderProps(entry).message ??\n message\n ).trim();\n const stepName = [resolvedName, resolvedMessage].filter(Boolean).join(\" \");\n return stepName;\n};\n\nconst getCommandLogStepParameters = (entry: CypressLogEntry) =>\n getLogProps(entry)\n .map(([k, v]) => ({\n name: k.toString(),\n value: serializePropValue(v),\n }))\n .filter(getPropValueSetFilter(entry));\n\nconst WELL_KNOWN_CUCUMBER_LOG_NAMES = [\"Given\", \"When\", \"Then\", \"And\"];\n\nconst maybeGetCucumberLogMessage = (entry: CypressLogEntry) => {\n const {\n attributes: { name, message },\n } = entry;\n if (WELL_KNOWN_CUCUMBER_LOG_NAMES.includes(name.trim()) && message.startsWith(\"**\") && message.endsWith(\"**\")) {\n return message.substring(2, message.length - 2);\n }\n};\n\nconst getLogProps = (entry: CypressLogEntry) => {\n const isAssertionWithMessage = !!maybeGetAssertionLogMessage(entry);\n const { props, name } = resolveConsoleProps(entry);\n\n // accessing LocalStorage after the page reload can stick the test runner\n // to avoid the issue, we just need to log the command manually\n // the problem potentially can happen with other storage related commands, like `clearAllLocalStorage`, `clearAllSessionStorage`, `getAllLocalStorage`, `getAllSessionStorage`, `setLocalStorage`, `setSessionStorage`\n // but probably, we don't need to silent them all at this moment\n // the context: https://github.com/allure-framework/allure-js/issues/1222\n if ([\"clearLocalStorage\"].includes(name)) {\n return [] as [string, unknown][];\n }\n\n // For assertion logs, we interpolate the 'Message' property, which contains unformatted assertion description,\n // directly into the step's name.\n // No need to keep the exact same information in the step's parameters.\n return Object.entries(props).filter(([k, v]) => isDefined(v) && !(isAssertionWithMessage && k === \"Message\"));\n};\n\nconst maybeGetAssertionLogMessage = (entry: CypressLogEntry) => {\n if (isAssertLog(entry)) {\n const message = resolveConsoleProps(entry).props.Message;\n\n if (message && typeof message === \"string\") {\n return message;\n }\n }\n};\n\nconst isAssertLog = ({ attributes: { name } }: CypressLogEntry) => name === \"assert\";\n\nconst getCurrentLogEntry = () => getStepStack().findLast(isLogStep);\n\nconst shouldStopCurrentLogStep = (currentLogEntry: CypressLogEntry, newLogEntry: CypressLogEntry) => {\n const { groupStart: currentEntryIsGroup, type: currentEntryType } = currentLogEntry.attributes;\n const { type: newEntryType } = newLogEntry.attributes;\n\n return !currentEntryIsGroup && (currentEntryType === \"child\" || newEntryType !== \"child\");\n};\n\nconst getPropValueSetFilter = (entry: CypressLogEntry) =>\n entry.attributes.name === \"wrap\" ? () => true : ({ name, value }: Parameter) => name !== \"Yielded\" || value !== \"{}\";\n"],"mappings":";;;;;;AAGA,SAASA,SAAS,QAAQ,aAAa;AACvC,SAASC,eAAe,QAAQ,gBAAgB;AAChD,OAAOC,kBAAkB,MAAM,gBAAgB;AAC/C,SAASC,SAAS,EAAEC,cAAc,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,qBAAqB,QAAQ,YAAY;AACrG,SAAS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A,CAAA,KAAM7B,YAAY,CAAC,CAAC,CAAC4F,QAAQ,CAACvF,SAAS,CAAC;AAEnE,IAAMyB,wBAAwB,GAAGA,CAACF,eAAgC,EAAEiE,WAA4B,KAAK;EACnG,IAAAC,qBAAA,GAAoElE,eAAe,CAACf,UAAU;IAA1EkF,mBAAmB,GAAAD,qBAAA,CAA/BlD,UAAU;IAA6BoD,gBAAgB,GAAAF,qBAAA,CAAtBvD,IAAI;EAC7C,IAAc0D,YAAY,GAAKJ,WAAW,CAAChF,UAAU,CAA7C0B,IAAI;EAEZ,OAAO,CAACwD,mBAAmB,KAAKC,gBAAgB,KAAK,OAAO,IAAIC,YAAY,KAAK,OAAO,CAAC;AAC3F,CAAC;AAED,IAAMrB,qBAAqB,GAAInE,KAAsB,IACnDA,KAAK,CAACI,UAAU,CAACM,IAAI,KAAK,MAAM,GAAG,MAAM,IAAI,GAAG+E,KAAA;EAAA,IAAG/E,IAAI,GAAA+E,KAAA,CAAJ/E,IAAI;IAAEwD,KAAK,GAAAuB,KAAA,CAALvB,KAAK;EAAA,OAAkBxD,IAAI,KAAK,SAAS,IAAIwD,KAAK,KAAK,IAAI;AAAA","ignoreList":[]}
@@ -3,17 +3,28 @@ 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 = () => Cypress.Screenshot.defaults({
7
- onAfterScreenshot
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 _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) {
11
- _ref[_key] = arguments[_key];
22
+ for (var _len2 = arguments.length, _ref = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
23
+ _ref[_key2] = arguments[_key2];
12
24
  }
13
- var [, {
14
- name: originalName,
15
- path
16
- }] = _ref;
25
+ var _ref$ = _ref[1],
26
+ originalName = _ref$.name,
27
+ path = _ref$.path;
17
28
  var name = originalName !== null && originalName !== void 0 ? originalName : getFileNameFromPath(path);
18
29
  reportScreenshot(path, name);
19
30
  setupScreenshotAttachmentStep(originalName, name);
@@ -1 +1 @@
1
- {"version":3,"file":"cypress.js","names":["setupScreenshotAttachmentStep","shouldCreateStepFromCommandLogEntry","startCommandLogStep","reportScreenshot","reportStepError","getFileNameFromPath","registerCypressEventListeners","Cypress","on","onFail","onLogAdded","enableReportingOfCypressScreenshots","Screenshot","defaults","onAfterScreenshot","_len","arguments","length","_ref","Array","_key","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 = () => Cypress.Screenshot.defaults({ onAfterScreenshot });\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,KAAMJ,OAAO,CAACK,UAAU,CAACC,QAAQ,CAAC;EAAEC;AAAkB,CAAC,CAAC;AAE3G,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAA,EAElB;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EAAA;EAAA,IADA,GAAG;IAAEC,IAAI,EAAEC,YAAY;IAAEC;EAAK,CAAC,CAAC,GAAAL,IAAA;EAEnC,IAAMG,IAAI,GAAGC,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIjB,mBAAmB,CAACkB,IAAI,CAAC;EAEtDpB,gBAAgB,CAACoB,IAAI,EAAEF,IAAI,CAAC;EAC5BrB,6BAA6B,CAACsB,YAAY,EAAED,IAAI,CAAC;AACnD,CAAC;AAED,IAAMX,UAAU,GAAGA,CAACc,CAAqB,EAAEC,KAAsB,KAAK;EACpE,IAAIxB,mCAAmC,CAACwB,KAAK,CAAC,EAAE;IAC9CvB,mBAAmB,CAACuB,KAAK,CAAC;EAC5B;AACF,CAAC;AAED,IAAMhB,MAAM,GAAIiB,KAA2B,IAAK;EAC9CtB,eAAe,CAACsB,KAAK,CAAC;;EAEtB;EACA;EACA;EACA,IAAIC,yBAAyB,CAAC,CAAC,EAAE;IAC/B,MAAMD,KAAK;EACb;AACF,CAAC;AAED,IAAMC,yBAAyB,GAAGA,CAAA,KAAMC,MAAM,CAACC,EAAE,CAACtB,OAAO,CAACuB,SAAS,CAAC,MAAM,CAAC,CAACC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAEtB,MAAM,CAAC","ignoreList":[]}
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","_ref$","originalName","name","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,GA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MtB,MAAM,GAAIuB,KAA2B,IAAK;EAC9C5B,eAAe,CAAC4B,KAAK,CAAC;;EAEtB;EACA;EACA;EACA,IAAIC,yBAAyB,CAAC,CAAC,EAAE;IAC/B,MAAMD,KAAK;EACb;AACF,CAAC;AAED,IAAMC,yBAAyB,GAAGA,CAAA,KAAMC,MAAM,CAACC,EAAE,CAAC5B,OAAO,CAAC6B,SAAS,CAAC,MAAM,CAAC,CAACC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE5B,MAAM,CAAC","ignoreList":[]}
@@ -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",
@@ -181,6 +182,7 @@ export var throwAfterSpecCompletion = (context, err) => {
181
182
  if (!chain) {
182
183
  throw err;
183
184
  }
185
+ return chain;
184
186
  };
185
187
  export var flushRuntimeMessages = () => getTestRuntime().flushAllureMessagesToTask("reportAllureCypressSpecMessages");
186
188
  export var completeSpecAsync = () => getTestRuntime().flushAllureMessagesToTaskAsync("reportFinalAllureCypressSpecMessages");