allure-cucumberjs 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.
package/README.md CHANGED
@@ -37,7 +37,7 @@ npm install -D allure-cucumberjs
37
37
 
38
38
  Install Allure Report separately when you want to render the generated `allure-results`:
39
39
 
40
- - follow the [Allure Report 2 installation guide](https://allurereport.org/docs/install/) to use the `allure` CLI
40
+ - follow the [Allure Report 2 installation guide](https://allurereport.org/docs/v2/install/) to use the `allure` CLI
41
41
  - or install Allure Report 3 with `npm install -D allure` to use `npx allure`
42
42
 
43
43
  ## Supported versions and platforms
@@ -45,7 +45,7 @@ Install Allure Report separately when you want to render the generated `allure-r
45
45
  - `@cucumber/cucumber >= 10.8.0`
46
46
  - `@cucumber/messages >= 24.1.0`
47
47
  - Linux, macOS, and Windows wherever Cucumber.js supports Node.js
48
- - this repository is validated in CI on Node.js 20 and 22
48
+ - this repository is validated in CI on Node.js 24 and 26
49
49
 
50
50
  ## Usage
51
51
 
package/dist/cjs/index.js CHANGED
@@ -27,7 +27,9 @@ var _utils = require("./utils.js");
27
27
  (0, _cucumber.Before)({
28
28
  name: "ALLURE_FIXTURE_IGNORE"
29
29
  }, scenario => {
30
- var testPlan = (0, _reporter.parseTestPlan)();
30
+ var testPlan = (0, _reporter.parseTestPlan)({
31
+ enableExcludedTests: true
32
+ });
31
33
  if (!testPlan) {
32
34
  return;
33
35
  }
@@ -39,6 +41,8 @@ var _utils = require("./utils.js");
39
41
  if (!(0, _reporter.includedInTestPlan)(testPlan, {
40
42
  fullName,
41
43
  tags
44
+ }, {
45
+ enableExcludedTests: true
42
46
  })) {
43
47
  // we can't use regular message or Allure facade since we need label to be added
44
48
  // to test, not fixture
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_cucumber","require","_reporter","_runtime","_legacy","_runtime2","_utils","BeforeAll","setGlobalTestRuntime","AllureCucumberTestRuntime","Before","name","scenario","testPlan","parseTestPlan","pickle","posixPath","getPosixPathRelativeToProjectRoot","projectName","getProjectName","fullName","concat","tags","map","tag","includedInTestPlan","world","attach","Buffer","from"],"sources":["../../src/index.ts"],"sourcesContent":["import { Before, BeforeAll, world } from \"@cucumber/cucumber\";\nimport { getProjectName, includedInTestPlan, parseTestPlan } from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport { AllureCucumberWorld } from \"./legacy.js\";\nimport { AllureCucumberTestRuntime } from \"./runtime.js\";\nimport { getPosixPathRelativeToProjectRoot } from \"./utils.js\";\n\nBeforeAll(() => {\n setGlobalTestRuntime(new AllureCucumberTestRuntime());\n});\n\nBefore({ name: \"ALLURE_FIXTURE_IGNORE\" }, (scenario) => {\n const testPlan = parseTestPlan();\n if (!testPlan) {\n return;\n }\n const pickle = scenario.pickle;\n const posixPath = getPosixPathRelativeToProjectRoot(pickle);\n const projectName = getProjectName();\n const fullName = `${projectName ? `${projectName}:${posixPath}` : posixPath}#${pickle.name}`;\n const tags = pickle.tags.map((tag) => tag.name);\n\n if (!includedInTestPlan(testPlan, { fullName, tags })) {\n // we can't use regular message or Allure facade since we need label to be added\n // to test, not fixture\n world.attach(Buffer.from(\"allure-skip\"), \"application/vnd.allure.skipcucumber+json\");\n return \"skipped\";\n }\n});\n\nexport { AllureCucumberTestRuntime, AllureCucumberWorld };\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,mBAAS,EAAC,MAAM;EACd,IAAAC,6BAAoB,EAAC,IAAIC,mCAAyB,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,IAAAC,gBAAM,EAAC;EAAEC,IAAI,EAAE;AAAwB,CAAC,EAAGC,QAAQ,IAAK;EACtD,IAAMC,QAAQ,GAAG,IAAAC,uBAAa,EAAC,CAAC;EAChC,IAAI,CAACD,QAAQ,EAAE;IACb;EACF;EACA,IAAME,MAAM,GAAGH,QAAQ,CAACG,MAAM;EAC9B,IAAMC,SAAS,GAAG,IAAAC,wCAAiC,EAACF,MAAM,CAAC;EAC3D,IAAMG,WAAW,GAAG,IAAAC,wBAAc,EAAC,CAAC;EACpC,IAAMC,QAAQ,MAAAC,MAAA,CAAMH,WAAW,MAAAG,MAAA,CAAMH,WAAW,OAAAG,MAAA,CAAIL,SAAS,IAAKA,SAAS,OAAAK,MAAA,CAAIN,MAAM,CAACJ,IAAI,CAAE;EAC5F,IAAMW,IAAI,GAAGP,MAAM,CAACO,IAAI,CAACC,GAAG,CAAEC,GAAG,IAAKA,GAAG,CAACb,IAAI,CAAC;EAE/C,IAAI,CAAC,IAAAc,4BAAkB,EAACZ,QAAQ,EAAE;IAAEO,QAAQ;IAAEE;EAAK,CAAC,CAAC,EAAE;IACrD;IACA;IACAI,eAAK,CAACC,MAAM,CAACC,MAAM,CAACC,IAAI,CAAC,aAAa,CAAC,EAAE,0CAA0C,CAAC;IACpF,OAAO,SAAS;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_cucumber","require","_reporter","_runtime","_legacy","_runtime2","_utils","BeforeAll","setGlobalTestRuntime","AllureCucumberTestRuntime","Before","name","scenario","testPlan","parseTestPlan","enableExcludedTests","pickle","posixPath","getPosixPathRelativeToProjectRoot","projectName","getProjectName","fullName","concat","tags","map","tag","includedInTestPlan","world","attach","Buffer","from"],"sources":["../../src/index.ts"],"sourcesContent":["import { Before, BeforeAll, world } from \"@cucumber/cucumber\";\nimport { getProjectName, includedInTestPlan, parseTestPlan } from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport { AllureCucumberWorld } from \"./legacy.js\";\nimport { AllureCucumberTestRuntime } from \"./runtime.js\";\nimport { getPosixPathRelativeToProjectRoot } from \"./utils.js\";\n\nBeforeAll(() => {\n setGlobalTestRuntime(new AllureCucumberTestRuntime());\n});\n\nBefore({ name: \"ALLURE_FIXTURE_IGNORE\" }, (scenario) => {\n const testPlan = parseTestPlan({ enableExcludedTests: true });\n if (!testPlan) {\n return;\n }\n const pickle = scenario.pickle;\n const posixPath = getPosixPathRelativeToProjectRoot(pickle);\n const projectName = getProjectName();\n const fullName = `${projectName ? `${projectName}:${posixPath}` : posixPath}#${pickle.name}`;\n const tags = pickle.tags.map((tag) => tag.name);\n\n if (!includedInTestPlan(testPlan, { fullName, tags }, { enableExcludedTests: true })) {\n // we can't use regular message or Allure facade since we need label to be added\n // to test, not fixture\n world.attach(Buffer.from(\"allure-skip\"), \"application/vnd.allure.skipcucumber+json\");\n return \"skipped\";\n }\n});\n\nexport { AllureCucumberTestRuntime, AllureCucumberWorld };\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,mBAAS,EAAC,MAAM;EACd,IAAAC,6BAAoB,EAAC,IAAIC,mCAAyB,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,IAAAC,gBAAM,EAAC;EAAEC,IAAI,EAAE;AAAwB,CAAC,EAAGC,QAAQ,IAAK;EACtD,IAAMC,QAAQ,GAAG,IAAAC,uBAAa,EAAC;IAAEC,mBAAmB,EAAE;EAAK,CAAC,CAAC;EAC7D,IAAI,CAACF,QAAQ,EAAE;IACb;EACF;EACA,IAAMG,MAAM,GAAGJ,QAAQ,CAACI,MAAM;EAC9B,IAAMC,SAAS,GAAG,IAAAC,wCAAiC,EAACF,MAAM,CAAC;EAC3D,IAAMG,WAAW,GAAG,IAAAC,wBAAc,EAAC,CAAC;EACpC,IAAMC,QAAQ,MAAAC,MAAA,CAAMH,WAAW,MAAAG,MAAA,CAAMH,WAAW,OAAAG,MAAA,CAAIL,SAAS,IAAKA,SAAS,OAAAK,MAAA,CAAIN,MAAM,CAACL,IAAI,CAAE;EAC5F,IAAMY,IAAI,GAAGP,MAAM,CAACO,IAAI,CAACC,GAAG,CAAEC,GAAG,IAAKA,GAAG,CAACd,IAAI,CAAC;EAE/C,IAAI,CAAC,IAAAe,4BAAkB,EAACb,QAAQ,EAAE;IAAEQ,QAAQ;IAAEE;EAAK,CAAC,EAAE;IAAER,mBAAmB,EAAE;EAAK,CAAC,CAAC,EAAE;IACpF;IACA;IACAY,eAAK,CAACC,MAAM,CAACC,MAAM,CAACC,IAAI,CAAC,aAAa,CAAC,EAAE,0CAA0C,CAAC;IACpF,OAAO,SAAS;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -27,6 +27,7 @@ class AllureCucumberWorld extends _cucumber.World {
27
27
  /**
28
28
  * @deprecated please use import { link } from "allure-js-commons" instead.
29
29
  */
30
+ // @ts-ignore cucumber >= 10.9 declares World.link as (text: string) => void
30
31
  _defineProperty(this, "link", (type, url, name) => Promise.resolve(allure.link(url, name, type)));
31
32
  /**
32
33
  * @deprecated please use import { parameter } from "allure-js-commons" instead.
@@ -1 +1 @@
1
- {"version":3,"file":"legacy.js","names":["_cucumber","require","allure","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","AllureCucumberWorld","World","constructor","arguments","name","Promise","resolve","label","type","url","link","options","parameter","description","html","descriptionHtml","id","testCaseId","historyId","allureId","displayName","content","attachment","contentType","issue","tms","epic","feature","story","suite","parentSuite","subSuite","owner","severity","layer","tag","body","step","exports"],"sources":["../../src/legacy.ts"],"sourcesContent":["import { World } from \"@cucumber/cucumber\";\nimport * as allure from \"allure-js-commons\";\nimport type { ParameterOptions } from \"allure-js-commons\";\n\n/**\n * @deprecated please use api exported by \"allure-js-commons\" instead.\n */\nexport interface AllureCucumberLegacyApi {\n label: (name: string, value: string) => Promise<void>;\n link: (type: string, url: string, name?: string) => Promise<void>;\n parameter: (name: string, value: string, options?: ParameterOptions) => Promise<void>;\n description: (markdown: string) => Promise<void>;\n descriptionHtml: (html: string) => Promise<void>;\n testCaseId: (id: string) => Promise<void>;\n historyId: (id: string) => Promise<void>;\n allureId: (id: string) => Promise<void>;\n displayName: (name: string) => Promise<void>;\n attachment: (name: string, content: Buffer | string, type: string) => Promise<void>;\n issue: (name: string, url: string) => Promise<void>;\n tms: (name: string, url: string) => Promise<void>;\n epic: (name: string) => Promise<void>;\n feature: (name: string) => Promise<void>;\n story: (name: string) => Promise<void>;\n suite: (name: string) => Promise<void>;\n parentSuite: (name: string) => Promise<void>;\n subSuite: (name: string) => Promise<void>;\n owner: (name: string) => Promise<void>;\n severity: (name: string) => Promise<void>;\n layer: (name: string) => Promise<void>;\n tag: (name: string) => Promise<void>;\n step: (name: string, body: () => Promise<void>) => Promise<void>;\n}\n\n/**\n * @deprecated please use api exported by \"allure-js-commons\" instead.\n */\nexport class AllureCucumberWorld extends World implements AllureCucumberLegacyApi {\n /**\n * @deprecated please use import { label } from \"allure-js-commons\" instead.\n */\n label = (name: string, value: string) => Promise.resolve(allure.label(name, value));\n /**\n * @deprecated please use import { link } from \"allure-js-commons\" instead.\n */\n link = (type: string, url: string, name?: string) => Promise.resolve(allure.link(url, name, type));\n /**\n * @deprecated please use import { parameter } from \"allure-js-commons\" instead.\n */\n parameter = (name: string, value: string, options?: ParameterOptions) =>\n Promise.resolve(allure.parameter(name, value, options));\n /**\n * @deprecated please use import { description } from \"allure-js-commons\" instead.\n */\n description = (value: string) => Promise.resolve(allure.description(value));\n /**\n * @deprecated please use import { descriptionHtml } from \"allure-js-commons\" instead.\n */\n descriptionHtml = (html: string) => Promise.resolve(allure.descriptionHtml(html));\n /**\n * @deprecated please use import { testCaseId } from \"allure-js-commons\" instead.\n */\n testCaseId = (id: string) => Promise.resolve(allure.testCaseId(id));\n /**\n * @deprecated please use import { historyId } from \"allure-js-commons\" instead.\n */\n historyId = (id: string) => Promise.resolve(allure.historyId(id));\n /**\n * @deprecated please use import { allureId } from \"allure-js-commons\" instead.\n */\n allureId = (id: string) => Promise.resolve(allure.allureId(id));\n /**\n * @deprecated please use import { displayName } from \"allure-js-commons\" instead.\n */\n displayName = (name: string) => Promise.resolve(allure.displayName(name));\n /**\n * @deprecated please use import { attachment } from \"allure-js-commons\" instead.\n */\n attachment = (name: string, content: Buffer | string, type: string) =>\n Promise.resolve(allure.attachment(name, content, { contentType: type }));\n /**\n * @deprecated please use import { issue } from \"allure-js-commons\" instead.\n */\n issue = (name: string, url: string) => Promise.resolve(allure.issue(url, name));\n /**\n * @deprecated please use import { tms } from \"allure-js-commons\" instead.\n */\n tms = (name: string, url: string) => Promise.resolve(allure.tms(url, name));\n /**\n * @deprecated please use import { epic } from \"allure-js-commons\" instead.\n */\n epic = (name: string) => Promise.resolve(allure.epic(name));\n /**\n * @deprecated please use import { feature } from \"allure-js-commons\" instead.\n */\n feature = (name: string) => Promise.resolve(allure.feature(name));\n /**\n * @deprecated please use import { story } from \"allure-js-commons\" instead.\n */\n story = (name: string) => Promise.resolve(allure.story(name));\n /**\n * @deprecated please use import { suite } from \"allure-js-commons\" instead.\n */\n suite = (name: string) => Promise.resolve(allure.suite(name));\n /**\n * @deprecated please use import { parentSuite } from \"allure-js-commons\" instead.\n */\n parentSuite = (name: string) => Promise.resolve(allure.parentSuite(name));\n /**\n * @deprecated please use import { subSuite } from \"allure-js-commons\" instead.\n */\n subSuite = (name: string) => Promise.resolve(allure.subSuite(name));\n /**\n * @deprecated please use import { owner } from \"allure-js-commons\" instead.\n */\n owner = (name: string) => Promise.resolve(allure.owner(name));\n /**\n * @deprecated please use import { severity } from \"allure-js-commons\" instead.\n */\n severity = (name: string) => Promise.resolve(allure.severity(name));\n /**\n * @deprecated please use import { layer } from \"allure-js-commons\" instead.\n */\n layer = (name: string) => Promise.resolve(allure.layer(name));\n /**\n * @deprecated please use import { tag } from \"allure-js-commons\" instead.\n */\n tag = (name: string) => Promise.resolve(allure.tag(name));\n /**\n * @deprecated please use import { step } from \"allure-js-commons\" instead.\n */\n step = (name: string, body: () => any) => Promise.resolve(allure.step(name, body));\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA4C,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,wBAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAA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C,MAAM,CAACmE,QAAQ,CAAC7B,IAAI,CAAC,CAAC;IACnE;AACF;AACA;IAFEhB,eAAA,gBAGSgB,IAAY,IAAKC,OAAO,CAACC,OAAO,CAACxC,MAAM,CAACoE,KAAK,CAAC9B,IAAI,CAAC,CAAC;IAC7D;AACF;AACA;IAFEhB,eAAA,cAGOgB,IAAY,IAAKC,OAAO,CAACC,OAAO,CAACxC,MAAM,CAACqE,GAAG,CAAC/B,IAAI,CAAC,CAAC;IACzD;AACF;AACA;IAFEhB,eAAA,eAGO,CAACgB,IAAY,EAAEgC,IAAe,KAAK/B,OAAO,CAACC,OAAO,CAACxC,MAAM,CAACuE,IAAI,CAACjC,IAAI,EAAEgC,IAAI,CAAC,CAAC;EAAA;AACpF;AAACE,OAAA,CAAAtC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"file":"legacy.js","names":["_cucumber","require","allure","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","AllureCucumberWorld","World","constructor","arguments","name","Promise","resolve","label","type","url","link","options","parameter","description","html","descriptionHtml","id","testCaseId","historyId","allureId","displayName","content","attachment","contentType","issue","tms","epic","feature","story","suite","parentSuite","subSuite","owner","severity","layer","tag","body","step","exports"],"sources":["../../src/legacy.ts"],"sourcesContent":["import { World } from \"@cucumber/cucumber\";\nimport * as allure from \"allure-js-commons\";\nimport type { ParameterOptions } from \"allure-js-commons\";\n\n/**\n * @deprecated please use api exported by \"allure-js-commons\" instead.\n */\nexport interface AllureCucumberLegacyApi {\n label: (name: string, value: string) => Promise<void>;\n link: (type: string, url: string, name?: string) => Promise<void>;\n parameter: (name: string, value: string, options?: ParameterOptions) => Promise<void>;\n description: (markdown: string) => Promise<void>;\n descriptionHtml: (html: string) => Promise<void>;\n testCaseId: (id: string) => Promise<void>;\n historyId: (id: string) => Promise<void>;\n allureId: (id: string) => Promise<void>;\n displayName: (name: string) => Promise<void>;\n attachment: (name: string, content: Buffer | string, type: string) => Promise<void>;\n issue: (name: string, url: string) => Promise<void>;\n tms: (name: string, url: string) => Promise<void>;\n epic: (name: string) => Promise<void>;\n feature: (name: string) => Promise<void>;\n story: (name: string) => Promise<void>;\n suite: (name: string) => Promise<void>;\n parentSuite: (name: string) => Promise<void>;\n subSuite: (name: string) => Promise<void>;\n owner: (name: string) => Promise<void>;\n severity: (name: string) => Promise<void>;\n layer: (name: string) => Promise<void>;\n tag: (name: string) => Promise<void>;\n step: (name: string, body: () => Promise<void>) => Promise<void>;\n}\n\n/**\n * @deprecated please use api exported by \"allure-js-commons\" instead.\n */\nexport class AllureCucumberWorld extends World implements AllureCucumberLegacyApi {\n /**\n * @deprecated please use import { label } from \"allure-js-commons\" instead.\n */\n label = (name: string, value: string) => Promise.resolve(allure.label(name, value));\n /**\n * @deprecated please use import { link } from \"allure-js-commons\" instead.\n */\n // @ts-ignore cucumber >= 10.9 declares World.link as (text: string) => void\n link = (type: string, url: string, name?: string) => Promise.resolve(allure.link(url, name, type));\n /**\n * @deprecated please use import { parameter } from \"allure-js-commons\" instead.\n */\n parameter = (name: string, value: string, options?: ParameterOptions) =>\n Promise.resolve(allure.parameter(name, value, options));\n /**\n * @deprecated please use import { description } from \"allure-js-commons\" instead.\n */\n description = (value: string) => Promise.resolve(allure.description(value));\n /**\n * @deprecated please use import { descriptionHtml } from \"allure-js-commons\" instead.\n */\n descriptionHtml = (html: string) => Promise.resolve(allure.descriptionHtml(html));\n /**\n * @deprecated please use import { testCaseId } from \"allure-js-commons\" instead.\n */\n testCaseId = (id: string) => Promise.resolve(allure.testCaseId(id));\n /**\n * @deprecated please use import { historyId } from \"allure-js-commons\" instead.\n */\n historyId = (id: string) => Promise.resolve(allure.historyId(id));\n /**\n * @deprecated please use import { allureId } from \"allure-js-commons\" instead.\n */\n allureId = (id: string) => Promise.resolve(allure.allureId(id));\n /**\n * @deprecated please use import { displayName } from \"allure-js-commons\" instead.\n */\n displayName = (name: string) => Promise.resolve(allure.displayName(name));\n /**\n * @deprecated please use import { attachment } from \"allure-js-commons\" instead.\n */\n attachment = (name: string, content: Buffer | string, type: string) =>\n Promise.resolve(allure.attachment(name, content, { contentType: type }));\n /**\n * @deprecated please use import { issue } from \"allure-js-commons\" instead.\n */\n issue = (name: string, url: string) => Promise.resolve(allure.issue(url, name));\n /**\n * @deprecated please use import { tms } from \"allure-js-commons\" instead.\n */\n tms = (name: string, url: string) => Promise.resolve(allure.tms(url, name));\n /**\n * @deprecated please use import { epic } from \"allure-js-commons\" instead.\n */\n epic = (name: string) => Promise.resolve(allure.epic(name));\n /**\n * @deprecated please use import { feature } from \"allure-js-commons\" instead.\n */\n feature = (name: string) => Promise.resolve(allure.feature(name));\n /**\n * @deprecated please use import { story } from \"allure-js-commons\" instead.\n */\n story = (name: string) => Promise.resolve(allure.story(name));\n /**\n * @deprecated please use import { suite } from \"allure-js-commons\" instead.\n */\n suite = (name: string) => Promise.resolve(allure.suite(name));\n /**\n * @deprecated please use import { parentSuite } from \"allure-js-commons\" instead.\n */\n parentSuite = (name: string) => Promise.resolve(allure.parentSuite(name));\n /**\n * @deprecated please use import { subSuite } from \"allure-js-commons\" instead.\n */\n subSuite = (name: string) => Promise.resolve(allure.subSuite(name));\n /**\n * @deprecated please use import { owner } from \"allure-js-commons\" instead.\n */\n owner = (name: string) => Promise.resolve(allure.owner(name));\n /**\n * @deprecated please use import { severity } from \"allure-js-commons\" instead.\n */\n severity = (name: string) => Promise.resolve(allure.severity(name));\n /**\n * @deprecated please use import { layer } from \"allure-js-commons\" instead.\n */\n layer = (name: string) => Promise.resolve(allure.layer(name));\n /**\n * @deprecated please use import { tag } from \"allure-js-commons\" instead.\n */\n tag = (name: string) => Promise.resolve(allure.tag(name));\n /**\n * @deprecated please use import { step } from \"allure-js-commons\" instead.\n */\n step = (name: string, body: () => any)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AACF;AACA;IAFEhB,eAAA,eAGO,CAACgB,IAAY,EAAEgC,IAAe,KAAK/B,OAAO,CAACC,OAAO,CAACxC,MAAM,CAACuE,IAAI,CAACjC,IAAI,EAAEgC,IAAI,CAAC,CAAC;EAAA;AACpF;AAACE,OAAA,CAAAtC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -13,6 +13,14 @@ var _reporter = require("allure-js-commons/sdk/reporter");
13
13
  var _legacy = require("./legacy.js");
14
14
  var _utils = require("./utils.js");
15
15
  var _excluded = ["resultsDir", "links", "labels"];
16
+ function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
17
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
18
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
19
+ 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."); }
20
+ 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; } }
21
+ 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; }
22
+ 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; } }
23
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
16
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
26
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
@@ -36,19 +44,23 @@ class AllureCucumberReporter extends _cucumber.Formatter {
36
44
  _defineProperty(this, "scenarioMap", new Map());
37
45
  _defineProperty(this, "stepMap", new Map());
38
46
  _defineProperty(this, "testStepMap", new Map());
47
+ _defineProperty(this, "stepDefinitionMap", new Map());
39
48
  _defineProperty(this, "pickleStepMap", new Map());
40
49
  _defineProperty(this, "pickleMap", new Map());
41
50
  _defineProperty(this, "testCaseMap", new Map());
42
- _defineProperty(this, "testCaseStartedMap", new Map());
51
+ _defineProperty(this, "featureNamesByTestCaseStartedId", new Map());
43
52
  _defineProperty(this, "testResultUuids", new Map());
44
53
  _defineProperty(this, "scopeUuids", new Map());
45
54
  _defineProperty(this, "fixtureUuids", new Map());
55
+ _defineProperty(this, "testRunHookTypes", new Map());
56
+ _defineProperty(this, "testRunHookStartedMap", new Map());
57
+ // executions of test run hooks running in this process, by hook id
58
+ _defineProperty(this, "runningTestRunHooks", new Map());
59
+ _defineProperty(this, "reportedTestRunHookStartedIds", new Set());
46
60
  var _ref = options.parsedArgvOptions,
47
- {
48
- resultsDir,
49
- links,
50
- labels
51
- } = _ref,
61
+ resultsDir = _ref.resultsDir,
62
+ links = _ref.links,
63
+ labels = _ref.labels,
52
64
  rest = _objectWithoutProperties(_ref, _excluded);
53
65
  this.allureRuntime = new _reporter.ReporterRuntime(_objectSpread({
54
66
  writer: (0, _reporter.createDefaultWriter)({
@@ -75,24 +87,21 @@ class AllureCucumberReporter extends _cucumber.Formatter {
75
87
  }
76
88
  }
77
89
  get tagsIgnorePatterns() {
78
- var {
79
- labelsConfigs,
80
- linksConfigs
81
- } = this;
90
+ var labelsConfigs = this.labelsConfigs,
91
+ linksConfigs = this.linksConfigs;
82
92
  var linkConfigEntries = Object.entries(linksConfigs).map(_ref2 => {
83
- var [, v] = _ref2;
93
+ var _ref3 = _slicedToArray(_ref2, 2),
94
+ v = _ref3[1];
84
95
  return v;
85
96
  });
86
- return [...labelsConfigs, ...linkConfigEntries].flatMap(_ref3 => {
87
- var {
88
- pattern
89
- } = _ref3;
97
+ return [...labelsConfigs, ...linkConfigEntries].flatMap(_ref4 => {
98
+ var pattern = _ref4.pattern;
90
99
  return pattern;
91
100
  });
92
101
  }
93
102
  getHookName(hookId) {
94
- var _ref4, _this$beforeHooks$hoo, _this$beforeHooks$hoo2, _this$afterHooks$hook;
95
- return (_ref4 = (_this$beforeHooks$hoo = (_this$beforeHooks$hoo2 = this.beforeHooks[hookId]) === null || _this$beforeHooks$hoo2 === void 0 ? void 0 : _this$beforeHooks$hoo2.name) !== null && _this$beforeHooks$hoo !== void 0 ? _this$beforeHooks$hoo : (_this$afterHooks$hook = this.afterHooks[hookId]) === null || _this$afterHooks$hook === void 0 ? void 0 : _this$afterHooks$hook.name) !== null && _ref4 !== void 0 ? _ref4 : "hook";
103
+ var _ref5, _this$beforeHooks$hoo, _this$beforeHooks$hoo2, _this$afterHooks$hook;
104
+ return (_ref5 = (_this$beforeHooks$hoo = (_this$beforeHooks$hoo2 = this.beforeHooks[hookId]) === null || _this$beforeHooks$hoo2 === void 0 ? void 0 : _this$beforeHooks$hoo2.name) !== null && _this$beforeHooks$hoo !== void 0 ? _this$beforeHooks$hoo : (_this$afterHooks$hook = this.afterHooks[hookId]) === null || _this$afterHooks$hook === void 0 ? void 0 : _this$afterHooks$hook.name) !== null && _ref5 !== void 0 ? _ref5 : "hook";
96
105
  }
97
106
  installTestRunHookGlobalErrorSupport(hooks, type) {
98
107
  hooks.forEach(hook => {
@@ -101,34 +110,34 @@ class AllureCucumberReporter extends _cucumber.Formatter {
101
110
  var runTestRunHook = this.runTestRunHook.bind(this);
102
111
  var runCallbackTestRunHook = this.runCallbackTestRunHook.bind(this);
103
112
  hook.code = originalCode.length > 0 ? function (callback) {
104
- return runCallbackTestRunHook(hookName, originalCode, this, callback);
113
+ return runCallbackTestRunHook(hook.id, hookName, originalCode, this, callback);
105
114
  } : function () {
106
- return runTestRunHook(hookName, () => originalCode.call(this));
115
+ return runTestRunHook(hook.id, hookName, () => originalCode.call(this));
107
116
  };
108
117
  });
109
118
  }
110
- runTestRunHook(name, runHook) {
119
+ runTestRunHook(hookId, name, runHook) {
111
120
  try {
112
121
  var result = runHook();
113
122
  if (isPromiseLike(result)) {
114
123
  return result.then(value => value, error => {
115
- this.emitTestRunHookGlobalError(name, error);
124
+ this.emitTestRunHookGlobalError(hookId, name, error);
116
125
  return deferReject(error);
117
126
  });
118
127
  }
119
128
  return result;
120
129
  } catch (error) {
121
- this.emitTestRunHookGlobalError(name, error);
130
+ this.emitTestRunHookGlobalError(hookId, name, error);
122
131
  return deferReject(error);
123
132
  }
124
133
  }
125
- runCallbackTestRunHook(name, originalCode, thisArg, callback) {
134
+ runCallbackTestRunHook(hookId, name, originalCode, thisArg, callback) {
126
135
  var finished = false;
127
136
  var finish = (error, result) => {
128
137
  if (!finished) {
129
138
  finished = true;
130
139
  if (error) {
131
- this.emitTestRunHookGlobalError(name, error);
140
+ this.emitTestRunHookGlobalError(hookId, name, error);
132
141
  }
133
142
  }
134
143
  if (error) {
@@ -148,7 +157,12 @@ class AllureCucumberReporter extends _cucumber.Formatter {
148
157
  throw error;
149
158
  }
150
159
  }
151
- emitTestRunHookGlobalError(name, error) {
160
+ emitTestRunHookGlobalError(hookId, name, error) {
161
+ // the same execution is reported again with the testRunHookFinished message (Cucumber 12.3+)
162
+ var testRunHookStartedId = this.runningTestRunHooks.get(hookId);
163
+ if (testRunHookStartedId) {
164
+ this.reportedTestRunHookStartedIds.add(testRunHookStartedId);
165
+ }
152
166
  this.allureRuntime.applyGlobalRuntimeMessages([(0, _sdk.toGlobalErrorMessage)({
153
167
  name,
154
168
  details: (0, _sdk.getMessageAndTraceFromError)(this.toError(error)),
@@ -163,6 +177,19 @@ class AllureCucumberReporter extends _cucumber.Formatter {
163
177
  }
164
178
  parseEnvelope(envelope) {
165
179
  switch (true) {
180
+ case !!envelope.stepDefinition:
181
+ this.stepDefinitionMap.set(envelope.stepDefinition.id, envelope.stepDefinition);
182
+ break;
183
+ case !!envelope.hook:
184
+ this.testRunHookTypes.set(envelope.hook.id, envelope.hook.type);
185
+ break;
186
+ case !!envelope.testRunHookStarted:
187
+ this.testRunHookStartedMap.set(envelope.testRunHookStarted.id, envelope.testRunHookStarted.hookId);
188
+ this.runningTestRunHooks.set(envelope.testRunHookStarted.hookId, envelope.testRunHookStarted.id);
189
+ break;
190
+ case !!envelope.testRunHookFinished:
191
+ this.onTestRunHookFinished(envelope.testRunHookFinished);
192
+ break;
166
193
  case !!envelope.gherkinDocument:
167
194
  this.onGherkinDocument(envelope.gherkinDocument);
168
195
  break;
@@ -222,14 +249,23 @@ class AllureCucumberReporter extends _cucumber.Formatter {
222
249
  if (Object.keys(this.linksConfigs).length === 0) {
223
250
  return links;
224
251
  }
225
- Object.entries(this.linksConfigs).forEach(_ref5 => {
226
- var [type, matcher] = _ref5;
252
+ Object.entries(this.linksConfigs).forEach(_ref6 => {
253
+ var _ref7 = _slicedToArray(_ref6, 2),
254
+ type = _ref7[0],
255
+ matcher = _ref7[1];
227
256
  var matchedTags = tags.filter(tag => matcher.pattern.some(pattern => pattern.test(tag.name)));
228
257
  var matchedLinks = matchedTags.map(tag => {
229
258
  var tagValue = tag.name.replace(tagKeyRe, "");
259
+ if ((0, _reporter.isUrl)(tagValue)) {
260
+ return {
261
+ url: tagValue,
262
+ type
263
+ };
264
+ }
230
265
  return {
231
266
  url: (0, _reporter.applyLinkTemplate)(matcher.urlTemplate, tagValue) || tagValue,
232
- type
267
+ type,
268
+ name: matcher.nameTemplate !== undefined ? (0, _reporter.applyLinkTemplate)(matcher.nameTemplate, tagValue) : undefined
233
269
  };
234
270
  });
235
271
  links.push(...matchedLinks);
@@ -302,7 +338,9 @@ class AllureCucumberReporter extends _cucumber.Formatter {
302
338
  var testCase = this.testCaseMap.get(data.testCaseId);
303
339
  var pickle = this.pickleMap.get(testCase.pickleId);
304
340
  var doc = this.documentMap.get(pickle.uri);
305
- var [scenarioId, ...astIds] = pickle.astNodeIds;
341
+ var _pickle$astNodeIds = _toArray(pickle.astNodeIds),
342
+ scenarioId = _pickle$astNodeIds[0],
343
+ astIds = _arrayLikeToArray(_pickle$astNodeIds).slice(1);
306
344
  var scenario = this.scenarioMap.get(scenarioId);
307
345
  var projectName = (0, _reporter.getProjectName)();
308
346
  var posixPath = (0, _utils.getPosixPathRelativeToProjectRoot)(pickle);
@@ -321,12 +359,6 @@ class AllureCucumberReporter extends _cucumber.Formatter {
321
359
  };
322
360
  result.labels.push(...(0, _reporter.getEnvironmentLabels)());
323
361
  result.labels.push((0, _reporter.getLanguageLabel)(), (0, _reporter.getFrameworkLabel)("cucumberjs"), (0, _reporter.getPackageLabel)((0, _utils.getPathRelativeToProjectRoot)(pickle)), (0, _reporter.getFallbackTestCaseIdLabel)(legacyTestCaseId), (0, _reporter.getHostLabel)(), (0, _reporter.getThreadLabel)(data.workerId));
324
- if (doc !== null && doc !== void 0 && doc.feature) {
325
- result.labels.push({
326
- name: _allureJsCommons.LabelName.FEATURE,
327
- value: doc.feature.name
328
- });
329
- }
330
362
  var pickleLabels = this.parsePickleTags(pickle.tags || []);
331
363
  var featureLabels = this.parseTagsLabels((doc === null || doc === void 0 || (_doc$feature2 = doc.feature) === null || _doc$feature2 === void 0 ? void 0 : _doc$feature2.tags) || []);
332
364
  var featureLinks = this.parseTagsLinks((doc === null || doc === void 0 || (_doc$feature3 = doc.feature) === null || _doc$feature3 === void 0 ? void 0 : _doc$feature3.tags) || []);
@@ -342,7 +374,9 @@ class AllureCucumberReporter extends _cucumber.Formatter {
342
374
  this.scopeUuids.set(data.id, scopeUuid);
343
375
  var testUuid = this.allureRuntime.startTest(result, [scopeUuid]);
344
376
  this.testResultUuids.set(data.id, testUuid);
345
- this.testCaseStartedMap.set(data.id, data);
377
+ if (doc !== null && doc !== void 0 && doc.feature) {
378
+ this.featureNamesByTestCaseStartedId.set(data.id, doc.feature.name);
379
+ }
346
380
  if (!(scenario !== null && scenario !== void 0 && scenario.examples)) {
347
381
  return;
348
382
  }
@@ -350,7 +384,7 @@ class AllureCucumberReporter extends _cucumber.Formatter {
350
384
  var _example$tableHeader, _example$tableBody;
351
385
  var exampleName = example !== null && example !== void 0 && example.name ? "Examples: ".concat(example.name) : "Examples";
352
386
  var parameterNames = example === null || example === void 0 || (_example$tableHeader = example.tableHeader) === null || _example$tableHeader === void 0 ? void 0 : _example$tableHeader.cells.map(cell => cell.value);
353
- var csvDataTableHeader = (parameterNames === null || parameterNames === void 0 ? void 0 : parameterNames.join(",")) || "";
387
+ var csvDataTableHeader = parameterNames ? (0, _utils.serializeCsvRow)(parameterNames) : "";
354
388
  var currentRow = example === null || example === void 0 || (_example$tableBody = example.tableBody) === null || _example$tableBody === void 0 ? void 0 : _example$tableBody.find(tb => astIds.includes(tb.id));
355
389
  if (currentRow) {
356
390
  var parameters = currentRow.cells.map((cell, index) => {
@@ -363,7 +397,7 @@ class AllureCucumberReporter extends _cucumber.Formatter {
363
397
  });
364
398
  _this.allureRuntime.updateTest(testUuid, tr => tr.parameters = [...tr.parameters, ...parameters]);
365
399
  }
366
- var csvDataTableBody = (example === null || example === void 0 ? void 0 : example.tableBody.map(row => row.cells.map(cell => cell.value).join(",")).join("\n")) || "";
400
+ var csvDataTableBody = (example === null || example === void 0 ? void 0 : example.tableBody.map(row => (0, _utils.serializeCsvRow)(row.cells.map(cell => cell.value))).join("\n")) || "";
367
401
  if (!csvDataTableHeader && !csvDataTableBody) {
368
402
  return 1; // continue
369
403
  }
@@ -405,6 +439,19 @@ class AllureCucumberReporter extends _cucumber.Formatter {
405
439
  this.allureRuntime.stopTest(testUuid, {
406
440
  stop: _messages.TimeConversion.timestampToMillisecondsSinceEpoch(data.timestamp)
407
441
  });
442
+ var featureName = this.featureNamesByTestCaseStartedId.get(data.testCaseStartedId);
443
+ if (featureName !== undefined) {
444
+ this.featureNamesByTestCaseStartedId.delete(data.testCaseStartedId);
445
+ // Runtime and global metadata can supply the feature before the result is written.
446
+ this.allureRuntime.updateTest(testUuid, result => {
447
+ if (!(0, _sdk.hasLabel)(result, _allureJsCommons.LabelName.FEATURE)) {
448
+ result.labels.push({
449
+ name: _allureJsCommons.LabelName.FEATURE,
450
+ value: featureName
451
+ });
452
+ }
453
+ });
454
+ }
408
455
  this.allureRuntime.writeTest(testUuid);
409
456
  this.testResultUuids.delete(data.testCaseStartedId);
410
457
  var scopeUuid = this.scopeUuids.get(data.testCaseStartedId);
@@ -457,7 +504,7 @@ class AllureCucumberReporter extends _cucumber.Formatter {
457
504
  if (!((_stepPickle$argument = stepPickle.argument) !== null && _stepPickle$argument !== void 0 && _stepPickle$argument.dataTable)) {
458
505
  return;
459
506
  }
460
- var csvDataTable = stepPickle.argument.dataTable.rows.reduce((acc, row) => "".concat(acc + row.cells.map(cell => cell.value).join(","), "\n"), "");
507
+ var csvDataTable = stepPickle.argument.dataTable.rows.reduce((acc, row) => "".concat(acc + (0, _utils.serializeCsvRow)(row.cells.map(cell => cell.value)), "\n"), "");
461
508
  this.allureRuntime.writeAttachment(testUuid, stepUuid, "Data table", Buffer.from(csvDataTable, "utf-8"), {
462
509
  contentType: _allureJsCommons.ContentType.CSV,
463
510
  fileExtension: ".csv"
@@ -520,7 +567,7 @@ class AllureCucumberReporter extends _cucumber.Formatter {
520
567
  if (data.testStepResult.status === _messages.TestStepResultStatus.AMBIGUOUS) {
521
568
  var _data$testStepResult$2;
522
569
  r.statusDetails = {
523
- message: (_data$testStepResult$2 = data.testStepResult.message) !== null && _data$testStepResult$2 !== void 0 ? _data$testStepResult$2 : AMBIGUOUS_STEP_MESSAGE
570
+ message: (_data$testStepResult$2 = data.testStepResult.message) !== null && _data$testStepResult$2 !== void 0 ? _data$testStepResult$2 : this.getAmbiguousStepMessage(step)
524
571
  };
525
572
  return;
526
573
  }
@@ -588,10 +635,54 @@ class AllureCucumberReporter extends _cucumber.Formatter {
588
635
  this.allureRuntime.applyGlobalRuntimeMessages(runtimeMessages);
589
636
  }
590
637
  }
638
+
639
+ // Cucumber 12.3+ reports test run hooks with messages. In parallel mode they run in workers,
640
+ // where the patched hook code isn't used, so the messages are the only source of their errors
641
+ onTestRunHookFinished(data) {
642
+ var _this$exceptionToErro, _data$result$exceptio, _data$result$message;
643
+ var hookId = this.testRunHookStartedMap.get(data.testRunHookStartedId);
644
+ if (hookId && this.runningTestRunHooks.get(hookId) === data.testRunHookStartedId) {
645
+ this.runningTestRunHooks.delete(hookId);
646
+ }
647
+
648
+ // dry runs report every test run hook as skipped
649
+ if (!hookId || data.result.status !== _messages.TestStepResultStatus.FAILED || this.reportedTestRunHookStartedIds.has(data.testRunHookStartedId)) {
650
+ return;
651
+ }
652
+ var name = this.testRunHookTypes.get(hookId) === "AFTER_TEST_RUN" ? "AfterAll hook" : "BeforeAll hook";
653
+ var error = (_this$exceptionToErro = this.exceptionToError((_data$result$exceptio = data.result.exception) === null || _data$result$exceptio === void 0 ? void 0 : _data$result$exceptio.message, data.result.exception)) !== null && _this$exceptionToErro !== void 0 ? _this$exceptionToErro : {
654
+ name: "Error",
655
+ message: (_data$result$message = data.result.message) !== null && _data$result$message !== void 0 ? _data$result$message : ""
656
+ };
657
+ this.allureRuntime.applyGlobalRuntimeMessages([(0, _sdk.toGlobalErrorMessage)({
658
+ name,
659
+ details: (0, _sdk.getMessageAndTraceFromError)(error),
660
+ status: (0, _sdk.getStatusFromError)(error)
661
+ })]);
662
+ }
591
663
  onTestRunFinished() {
592
664
  this.allureRuntime.writeCategoriesDefinitions();
593
665
  this.allureRuntime.writeEnvironmentInfo();
594
666
  }
667
+
668
+ // Cucumber 13+ no longer puts the matching step definitions into the ambiguous step result
669
+ getAmbiguousStepMessage(step) {
670
+ var _step$stepDefinitionI;
671
+ var stepDefinitions = ((_step$stepDefinitionI = step.stepDefinitionIds) !== null && _step$stepDefinitionI !== void 0 ? _step$stepDefinitionI : []).map(id => this.stepDefinitionMap.get(id)).filter(stepDefinition => stepDefinition !== undefined);
672
+ if (stepDefinitions.length === 0) {
673
+ return AMBIGUOUS_STEP_MESSAGE;
674
+ }
675
+ var matches = stepDefinitions.map(_ref8 => {
676
+ var _sourceReference$loca;
677
+ var pattern = _ref8.pattern,
678
+ sourceReference = _ref8.sourceReference;
679
+ var patternText = pattern.type === _messages.StepDefinitionPatternType.REGULAR_EXPRESSION ? "/".concat(pattern.source, "/") : pattern.source;
680
+ var line = (_sourceReference$loca = sourceReference.location) === null || _sourceReference$loca === void 0 ? void 0 : _sourceReference$loca.line;
681
+ var location = sourceReference.uri ? "".concat(sourceReference.uri).concat(line !== undefined ? ":".concat(line) : "") : "";
682
+ return location ? " ".concat(patternText, " - ").concat(location) : " ".concat(patternText);
683
+ });
684
+ return ["Multiple step definitions match:", ...matches].join("\n");
685
+ }
595
686
  exceptionToError(message, exception) {
596
687
  if (!exception) {
597
688
  return;