allure-cucumberjs 2.0.0-beta.23 → 2.0.0-beta.25

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 (2) hide show
  1. package/README.md +64 -42
  2. package/package.json +6 -11
package/README.md CHANGED
@@ -19,39 +19,35 @@ Create the reporter file:
19
19
 
20
20
  ```js
21
21
  // reporter.js
22
- import { AllureRuntime } from "allure-js-commons"
22
+ import { AllureRuntime } from "allure-js-commons";
23
23
  import { CucumberJSAllureFormatter } from "allure-cucumberjs";
24
24
 
25
25
  export default class extends CucumberJSAllureFormatter {
26
26
  constructor(options) {
27
- super(
28
- options,
29
- new AllureRuntime({ resultsDir: "./allure-results" }),
30
- {
31
- labels: [
32
- {
33
- pattern: [/@feature:(.*)/],
34
- name: "epic"
35
- },
36
- {
37
- pattern: [/@severity:(.*)/],
38
- name: "severity"
39
- }
40
- ],
41
- links: [
42
- {
43
- pattern: [/@issue=(.*)/],
44
- type: "issue",
45
- urlTemplate: "http://localhost:8080/issue/%s"
46
- },
47
- {
48
- pattern: [/@tms=(.*)/],
49
- type: "tms",
50
- urlTemplate: "http://localhost:8080/tms/%s"
51
- }
52
- ]
53
- }
54
- );
27
+ super(options, new AllureRuntime({ resultsDir: "./allure-results" }), {
28
+ labels: [
29
+ {
30
+ pattern: [/@feature:(.*)/],
31
+ name: "epic",
32
+ },
33
+ {
34
+ pattern: [/@severity:(.*)/],
35
+ name: "severity",
36
+ },
37
+ ],
38
+ links: [
39
+ {
40
+ pattern: [/@issue=(.*)/],
41
+ type: "issue",
42
+ urlTemplate: "http://localhost:8080/issue/%s",
43
+ },
44
+ {
45
+ pattern: [/@tms=(.*)/],
46
+ type: "tms",
47
+ urlTemplate: "http://localhost:8080/tms/%s",
48
+ },
49
+ ],
50
+ });
55
51
  }
56
52
  }
57
53
  ```
@@ -68,9 +64,9 @@ Or via configuration file:
68
64
  // config.js
69
65
  module.exports = {
70
66
  default: {
71
- format: "./path/to/reporter.js"
72
- }
73
- }
67
+ format: "./path/to/reporter.js",
68
+ },
69
+ };
74
70
  ```
75
71
 
76
72
  And then run CLI with `config` parameter:
@@ -93,19 +89,19 @@ By default, the feature is available out of the box for single thread mode.
93
89
  Example:
94
90
 
95
91
  ```js
96
- import { Given } from "@cucumber/cucumber"
92
+ import { Given } from "@cucumber/cucumber";
97
93
 
98
94
  Given(/my step/, async function () {
99
95
  await this.step("step can have anonymous body function", async function () {
100
- await this.label("label_name", "label_value")
101
- await this.attach(JSON.stringify({ foo: "bar "}), "application/json")
102
- })
103
-
96
+ await this.label("label_name", "label_value");
97
+ await this.attach(JSON.stringify({ foo: "bar " }), "application/json");
98
+ });
99
+
104
100
  await this.step("by the way, body function can be arrow one", async (step) => {
105
- await step.label("label_name", "label_value")
106
- await step.attach(JSON.stringify({ foo: "bar "}), "application/json")
107
- })
108
- })
101
+ await step.label("label_name", "label_value");
102
+ await step.attach(JSON.stringify({ foo: "bar " }), "application/json");
103
+ });
104
+ });
109
105
  ```
110
106
 
111
107
  If you want to keep the functoinality in `parallel` mode, set `CucumberAllureWorld` as
@@ -149,7 +145,7 @@ Follow the same approach when you need to use your own `World` implementation. J
149
145
 
150
146
  Given(/my step/, async function () {
151
147
  + this.hello()
152
-
148
+
153
149
  await this.step("step can have anonymous body function", async function () {
154
150
  await this.label("label_name", "label_value")
155
151
  await this.attach(JSON.stringify({ foo: "bar "}), "application/json")
@@ -184,3 +180,29 @@ Given("A cat fact is recieved", async function (this: CustomWorld) {
184
180
  });
185
181
  });
186
182
  ```
183
+
184
+ ### Parameters usage
185
+
186
+ ```ts
187
+ import { Given } from "@cucumber/cucumber";
188
+
189
+ Given(/my step/, async function () {
190
+ await this.step("step can have anonymous body function", async function () {
191
+ await this.parameter("parameterName", "parameterValue");
192
+ });
193
+ });
194
+ ```
195
+
196
+ Also addParameter takes an third optional parameter with the hidden and excluded options:
197
+ `hidden: true` - hides parameter from the report
198
+ `excluded: true` - excludes parameter from the history
199
+
200
+ ```ts
201
+ import { Given } from "@cucumber/cucumber";
202
+
203
+ Given(/my step/, async function () {
204
+ await this.step("step can have anonymous body function", async function () {
205
+ await this.parameter("parameterName", "parameterValue", { hidden: true, excluded: true });
206
+ });
207
+ });
208
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure-cucumberjs",
3
- "version": "2.0.0-beta.23",
3
+ "version": "2.0.0-beta.25",
4
4
  "description": "Allure Cucumber.JS integration",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Ilya Korobitsyn <mail@korobochka.org>",
@@ -24,25 +24,20 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/chai": "^4.2.21",
27
- "@types/fs-extra": "^9.0.1",
28
- "@types/glob": "^7.1.4",
27
+ "@types/glob": "^8.0.0",
29
28
  "@types/mocha": "^9.0.0",
30
29
  "@types/node": "^16.7.8",
31
30
  "@types/sinon": "^10.0.11",
32
- "@types/verror": "^1.10.3",
33
- "allure-mocha": "2.0.0-beta.23",
31
+ "allure-mocha": "2.0.0-beta.25",
34
32
  "chai": "^4.3.4",
35
33
  "chai-like": "^1.1.1",
36
- "fs-extra": "^10.0.0",
37
- "glob": "^7.1.7",
34
+ "glob": "^8.0.0",
38
35
  "mocha": "^9.1.1",
39
36
  "nyc": "^15.1.0",
40
- "path": "^0.12.7",
41
37
  "rimraf": "^3.0.2",
42
38
  "sinon": "^14.0.0",
43
39
  "ts-node": "^10.2.1",
44
- "typescript": "^4.4.2",
45
- "verror": "^1.10.0"
40
+ "typescript": "^4.4.2"
46
41
  },
47
42
  "dependencies": {
48
43
  "@cucumber/cucumber": "^8.8.0",
@@ -50,7 +45,7 @@
50
45
  "@cucumber/gherkin-streams": "^5.0.1",
51
46
  "@cucumber/gherkin-utils": "^8.0.0",
52
47
  "@cucumber/messages": "^20.0.0",
53
- "allure-js-commons": "2.0.0-beta.23"
48
+ "allure-js-commons": "2.0.0-beta.25"
54
49
  },
55
50
  "files": [
56
51
  "dist/src/**/*",