cucumberjs-qase-reporter 2.0.0-beta.3 → 2.0.1

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
@@ -1,50 +1,69 @@
1
- > # Qase TMS Cucumber JS reporter
2
- >
3
- > Publish results simple and easy.
1
+ # Qase TMS Cucumber JS reporter
4
2
 
5
- ## How to integrate
3
+ Publish results simple and easy.
6
4
 
5
+ To install the latest version, run:
6
+
7
+ ```sh
8
+ npm install -D cucumberjs-qase-reporter
7
9
  ```
8
- npm install cucumberjs-qase-reporter
9
- ```
10
10
 
11
- ## Example of usage
11
+ ## Updating from v1
12
+
13
+ To update a test project using cucumberjs-qase-reporter@v1 to version 2:
14
+
15
+ 1. Update reporter configuration in `qase.config.json` and/or environment variables —
16
+ see the [configuration reference](#configuration) below.
12
17
 
13
- The Cucumber JS reporter has the ability to auto-generate test cases
18
+ ## Getting started
19
+
20
+ The Cucumber JS reporter can auto-generate test cases
14
21
  and suites from your test data.
22
+ Test results of subsequent test runs will match the same test cases
23
+ as long as their names and file paths don't change.
24
+
25
+ You can also annotate the tests with the IDs of existing test cases
26
+ from Qase.io before executing tests. It's a more reliable way to bind
27
+ autotests to test cases, that persists when you rename, move, or
28
+ parameterize your tests.
15
29
 
16
- But if necessary, you can independently register the ID of already
17
- existing test cases from TMS before the executing tests. You can decorate your scenarios with Qase TMS case IDs in format `Q-<case id>` or `Q123`, also `q` can be in any case:
30
+ For example:
18
31
 
19
32
  ```gherkin
20
33
  Feature: Cucumber documentation
21
- As a user of cucumber.js
22
- I want to have documentation on cucumber
23
- So I can write better applications
24
-
25
- @sections @Q-2
26
- Scenario: Usage documentation
27
- Given I am on the cucumber.js GitHub repository
28
- When I go to the README file
29
- Then I should see a "Cool" section
30
- When I go to the README file
31
-
32
- @ignore @q4
33
- Scenario: Status badges 2
34
- Given I am on the cucumber.js GitHub repository
35
- When I go to the README file
36
- Then I should see a "Build Status" badge
37
- And I should see a "Dependencies" badge
34
+ As a user of cucumber.js
35
+ I want to have documentation on cucumber
36
+ So I can write better applications
37
+
38
+ @QaseID=1
39
+ Scenario: Usage documentation
40
+ Given I am on the cucumber.js GitHub repository
41
+ When I go to the README file
42
+ Then I should see a "Cool" section
43
+
44
+ @QaseID=2
45
+ @QaseFields={'severity':'high'}
46
+ Scenario: Status badges 2
47
+ Given I am on the cucumber.js GitHub repository
48
+ When I go to the README file
49
+ Then I should see a "Build Status" badge
50
+ And I should see a "Dependencies" badge
38
51
  ```
39
- ---
40
- To run tests and create a test run, execute the command (for example from folder examples/cucumberjs):
52
+
53
+ To execute Cucumber JS tests and report them to Qase.io, run the command:
54
+
41
55
  ```bash
42
- QASE_MODE=testops cucumber-js -f cucumberjs-qase-reporter:/dev/null features -r zombie/support -r zombie/steps --publish-quiet
56
+ QASE_MODE=testops cucumber-js -f cucumberjs-qase-reporter features -r step_definitions --publish-quiet
43
57
  ```
58
+
44
59
  or
60
+
45
61
  ```bash
46
62
  npm test
47
63
  ```
64
+
65
+ You can try it with the example project at [`examples/cucumberjs`](../examples/cucumberjs/).
66
+
48
67
  <p align="center">
49
68
  <img width="65%" src="./screenshots/screenshot.png">
50
69
  </p>
@@ -61,34 +80,28 @@ https://app.qase.io/run/QASE_PROJECT_CODE
61
80
 
62
81
  ## Configuration
63
82
 
64
- Qase reporter supports passing parameters using two ways:
65
- using `.qaserc`/`qase.config.json` file and using ENV variables.
66
-
67
- `.qaserc` parameters, (* - required):
68
- - `mode` - `testops`/`off` Enables reporter, default - `off`
69
- - `debug` - Enables debug logging, defaule - `false`
70
- - `environment` - To execute with the sending of the envinroment information
71
- - *`testops.api.token` - Token for API access, you can find more information
72
- [here](https://developers.qase.io/#authentication)
73
- - *`testops.project` - Code of your project (can be extracted from main
74
- page of your project: `https://app.qase.io/project/DEMOTR` -
75
- `DEMOTR` is project code here)
76
- - `testops.run.id` - Pass Run ID
77
- - `testops.run.title` - Set custom Run name, when new run is created
78
- - `testops.run.description` - Set custom Run description, when new run is created
79
- - `testops.run.complete` - Whether the run should be completed
80
-
81
- Example configuration file:
83
+ Qase Cucumber JS reporter can be configured in multiple ways:
84
+
85
+ - using a separate config file `qase.config.json`,
86
+ - using environment variables (they override the values from the configuration files).
87
+
88
+ For a full list of configuration options, see
89
+ the [Configuration reference](../qase-javascript-commons/README.md#configuration).
90
+
91
+ Example `qase.config.json` file:
82
92
 
83
93
  ```json
84
94
  {
95
+ "mode": "testops",
85
96
  "debug": true,
86
- "environment": 1,
87
97
  "testops": {
88
98
  "api": {
89
99
  "token": "api_key"
90
100
  },
91
- "project": "project_code"
101
+ "project": "project_code",
102
+ "run": {
103
+ "complete": true
104
+ }
92
105
  }
93
106
  }
94
107
  ```
@@ -105,41 +118,17 @@ Supported ENV variables:
105
118
  - `QASE_TESTOPS_RUN_DESCRIPTION` - Same as `testops.run.description`
106
119
 
107
120
  To run using ENV you have to execute:
108
- ```bash
109
- cucumber-js -f cucumberjs-qase-reporter features
110
- ```
111
-
112
- ## Setup with Protractor
113
121
 
114
- Due to different configurations of protractor and cucumber itself you should install a bit more libraries:
115
122
  ```bash
116
- npm install cucumberjs-qase-reporter @cucumber/cucumber @cucumber/messages
117
- ```
118
-
119
- After that you will be able to use reporter like this (`protractor.conf.js`):
120
- ```js
121
- exports.config = {
122
- ...
123
- cucumberOpts: {
124
- require: [
125
- './tests/e2e/specs/*.js',
126
- ], // require step definition files before executing features
127
- tags: [],
128
- 'dry-run': false,
129
- compiler: [],
130
- format: ["node_modules/cucumberjs-qase-reporter"],
131
- },
132
- ...
133
- }
123
+ cucumber-js -f cucumberjs-qase-reporter features -r step_definitions --publish-quiet
134
124
  ```
135
125
 
136
- **Do not forget to add `.qaserc`/`qase.config.json` file!**
137
-
138
126
  ## Requirements
139
127
 
140
- We maintain the reporter on LTS versions of Node. You can find the current versions by following the [link](https://nodejs.org/en/about/releases/)
141
- <!-- references -->
128
+ We maintain the reporter on [LTS versions of Node](https://nodejs.org/en/about/releases/).
142
129
 
143
130
  `@cucumber/cucumber >= 7.0.0`
144
131
 
132
+ <!-- references -->
133
+
145
134
  [auth]: https://developers.qase.io/#authentication
package/changelog.md CHANGED
@@ -1,3 +1,16 @@
1
+ # qase-cucumberjs@2.0.0
2
+
3
+ ## What's new
4
+
5
+ This is the first release in the 2.x series of the Cucumber JS reporter.
6
+ It brings a new annotation syntax with field values,
7
+ new and more flexible configs, uploading results in parallel with running tests,
8
+ and other powerful features.
9
+
10
+ This changelog entry will be updated soon.
11
+ For more information about the new features and a guide for migration from v1, refer to the
12
+ [reporter documentation](https://github.com/qase-tms/qase-javascript/tree/main/qase-cucumberjs#readme)
13
+
1
14
  # qase-cucumberjs@2.0.0-beta.3
2
15
 
3
16
  ## What's new
package/dist/storage.d.ts CHANGED
@@ -97,5 +97,11 @@ export declare class Storage {
97
97
  */
98
98
  static stepStatusMap: Record<TestStepResultStatus, StepStatusEnum>;
99
99
  private parseTags;
100
+ /**
101
+ * @param {Pickle} pickle
102
+ * @param {number[]} ids
103
+ * @private
104
+ */
105
+ private getSignature;
100
106
  }
101
107
  export {};
package/dist/storage.js CHANGED
@@ -184,9 +184,10 @@ class Storage {
184
184
  message: null,
185
185
  muted: false,
186
186
  params: {},
187
+ group_params: {},
187
188
  relations: relations,
188
189
  run_id: null,
189
- signature: '',
190
+ signature: this.getSignature(pickle, metadata.ids),
190
191
  steps: this.convertSteps(pickle.steps, tc),
191
192
  testops_id: metadata.ids.length > 0 ? metadata.ids : null,
192
193
  id: tcs.id,
@@ -266,6 +267,20 @@ class Storage {
266
267
  }
267
268
  return metadata;
268
269
  }
270
+ /**
271
+ * @param {Pickle} pickle
272
+ * @param {number[]} ids
273
+ * @private
274
+ */
275
+ getSignature(pickle, ids) {
276
+ let signature = pickle.uri.split('/').join('::')
277
+ + '::'
278
+ + pickle.name.toLowerCase().replace(/\s/g, '_');
279
+ if (ids.length > 0) {
280
+ signature += '::' + ids.join('::');
281
+ }
282
+ return signature;
283
+ }
269
284
  }
270
285
  exports.Storage = Storage;
271
286
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cucumberjs-qase-reporter",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.1",
4
4
  "description": "Qase TMS CucumberJS Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "main": "./dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "license": "Apache-2.0",
41
41
  "dependencies": {
42
42
  "@cucumber/messages": "^22.0.0",
43
- "qase-javascript-commons": "^2.0.0-beta.8"
43
+ "qase-javascript-commons": "^2.2.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@cucumber/cucumber": ">=7.0.0"