cucumberjs-qase-reporter 2.0.3 → 2.0.5
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/changelog.md +20 -2
- package/dist/reporter.js +15 -0
- package/dist/storage.js +68 -70
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# qase-cucumberjs@2.0.5
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Enabled support for multiple IDs in the `QaseID` tag, allowing tests to be linked to multiple cases.
|
|
6
|
+
|
|
7
|
+
```gherkin
|
|
8
|
+
@QaseID=1,2,3
|
|
9
|
+
Scenario: Scenario with new Qase ID tag
|
|
10
|
+
Given I have a step
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
# qase-cucumberjs@2.0.4
|
|
14
|
+
|
|
15
|
+
## What's new
|
|
16
|
+
|
|
17
|
+
Fixed the issue with the `QaseFields` tag.
|
|
18
|
+
|
|
1
19
|
# qase-cucumberjs@2.0.3
|
|
2
20
|
|
|
3
21
|
## What's new
|
|
@@ -7,11 +25,11 @@ Support attachments in the test results.
|
|
|
7
25
|
```js
|
|
8
26
|
const { Given, Then } = require('cucumber');
|
|
9
27
|
|
|
10
|
-
Given('I have a step with attachment', async function
|
|
28
|
+
Given('I have a step with attachment', async function() {
|
|
11
29
|
await this.attach('Hello, world!', 'text/plain');
|
|
12
30
|
});
|
|
13
31
|
|
|
14
|
-
Then('I have a step with attachment', async function
|
|
32
|
+
Then('I have a step with attachment', async function() {
|
|
15
33
|
await this.attach('Hello, world!', 'text/plain');
|
|
16
34
|
});
|
|
17
35
|
```
|
package/dist/reporter.js
CHANGED
|
@@ -9,6 +9,21 @@ const storage_1 = require("./storage");
|
|
|
9
9
|
* @extends Formatter
|
|
10
10
|
*/
|
|
11
11
|
class CucumberQaseReporter extends cucumber_1.Formatter {
|
|
12
|
+
/**
|
|
13
|
+
* @type {Record<string, string>}
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
storage;
|
|
17
|
+
/**
|
|
18
|
+
* @type {ReporterInterface}
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
reporter;
|
|
22
|
+
/**
|
|
23
|
+
* @type {EventEmitter}
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
eventBroadcaster;
|
|
12
27
|
/**
|
|
13
28
|
* @param {CucumberQaseOptionsType} options
|
|
14
29
|
* @param {ConfigLoaderInterface} configLoader
|
package/dist/storage.js
CHANGED
|
@@ -5,53 +5,51 @@ const qase_javascript_commons_1 = require("qase-javascript-commons");
|
|
|
5
5
|
const cucumber_1 = require("@cucumber/cucumber");
|
|
6
6
|
const uuid_1 = require("uuid");
|
|
7
7
|
const qaseIdRegExp = /^@[Qq]-?(\d+)$/g;
|
|
8
|
-
const newQaseIdRegExp = /^@[Qq]ase[Ii][Dd]=(\d+)$/g;
|
|
8
|
+
const newQaseIdRegExp = /^@[Qq]ase[Ii][Dd]=(\d+(?:,\s*\d+)*)$/g;
|
|
9
9
|
const qaseTitleRegExp = /^@[Qq]ase[Tt]itle=(.+)$/g;
|
|
10
|
-
const qaseFieldsRegExp = /^@[Qq]ase[Ff]ields
|
|
10
|
+
const qaseFieldsRegExp = /^@[Qq]ase[Ff]ields=(.+)$/g;
|
|
11
11
|
const qaseIgnoreRegExp = /^@[Qq]ase[Ii][Gg][Nn][Oo][Rr][Ee]$/g;
|
|
12
12
|
class Storage {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.attachments = {};
|
|
54
|
-
}
|
|
13
|
+
/**
|
|
14
|
+
* @type {Record<string, Pickle>}
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
pickles = {};
|
|
18
|
+
/**
|
|
19
|
+
* @type {Record<string, TestCaseStarted>}
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
testCaseStarts = {};
|
|
23
|
+
/**
|
|
24
|
+
* @type {Record<string, TestStepFinished>}
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
testCaseSteps = {};
|
|
28
|
+
/**
|
|
29
|
+
* @type {Record<string, TestStatusEnum>}
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
testCaseStartedResult = {};
|
|
33
|
+
/**
|
|
34
|
+
* @type {Record<string, string[]>}
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
testCaseStartedErrors = {};
|
|
38
|
+
/**
|
|
39
|
+
* @type {Record<string, string>}
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
testCases = {};
|
|
43
|
+
/**
|
|
44
|
+
* @type {Record<string, string>}
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
scenarios = {};
|
|
48
|
+
/**
|
|
49
|
+
* @type {Record<string, string>}
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
attachments = {};
|
|
55
53
|
/**
|
|
56
54
|
* Add pickle to storage
|
|
57
55
|
* @param {Pickle} pickle
|
|
@@ -236,6 +234,30 @@ class Storage {
|
|
|
236
234
|
}
|
|
237
235
|
return results;
|
|
238
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* @type {Record<TestStepResultStatus, TestStatusEnum>}
|
|
239
|
+
*/
|
|
240
|
+
static statusMap = {
|
|
241
|
+
[cucumber_1.Status.PASSED]: qase_javascript_commons_1.TestStatusEnum.passed,
|
|
242
|
+
[cucumber_1.Status.FAILED]: qase_javascript_commons_1.TestStatusEnum.failed,
|
|
243
|
+
[cucumber_1.Status.SKIPPED]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
244
|
+
[cucumber_1.Status.AMBIGUOUS]: qase_javascript_commons_1.TestStatusEnum.failed,
|
|
245
|
+
[cucumber_1.Status.PENDING]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
246
|
+
[cucumber_1.Status.UNDEFINED]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
247
|
+
[cucumber_1.Status.UNKNOWN]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* @type {Record<TestStepResultStatus, StepStatusEnum>}
|
|
251
|
+
*/
|
|
252
|
+
static stepStatusMap = {
|
|
253
|
+
[cucumber_1.Status.PASSED]: qase_javascript_commons_1.StepStatusEnum.passed,
|
|
254
|
+
[cucumber_1.Status.FAILED]: qase_javascript_commons_1.StepStatusEnum.failed,
|
|
255
|
+
[cucumber_1.Status.SKIPPED]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
256
|
+
[cucumber_1.Status.AMBIGUOUS]: qase_javascript_commons_1.StepStatusEnum.failed,
|
|
257
|
+
[cucumber_1.Status.PENDING]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
258
|
+
[cucumber_1.Status.UNDEFINED]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
259
|
+
[cucumber_1.Status.UNKNOWN]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
260
|
+
};
|
|
239
261
|
parseTags(tags) {
|
|
240
262
|
const metadata = {
|
|
241
263
|
ids: [],
|
|
@@ -249,7 +271,7 @@ class Storage {
|
|
|
249
271
|
continue;
|
|
250
272
|
}
|
|
251
273
|
if (newQaseIdRegExp.test(tag.name)) {
|
|
252
|
-
metadata.ids.push(
|
|
274
|
+
metadata.ids.push(...(tag.name.replace(/^@[Qq]ase[Ii][Dd]=/, '')).split(',').map(Number));
|
|
253
275
|
continue;
|
|
254
276
|
}
|
|
255
277
|
if (qaseTitleRegExp.test(tag.name)) {
|
|
@@ -257,7 +279,7 @@ class Storage {
|
|
|
257
279
|
continue;
|
|
258
280
|
}
|
|
259
281
|
if (qaseFieldsRegExp.test(tag.name)) {
|
|
260
|
-
const value = tag.name.replace(/^@[Qq]ase[Ff]ields
|
|
282
|
+
const value = tag.name.replace(/^@[Qq]ase[Ff]ields=/, '');
|
|
261
283
|
try {
|
|
262
284
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
263
285
|
const record = JSON.parse(value);
|
|
@@ -325,27 +347,3 @@ class Storage {
|
|
|
325
347
|
}
|
|
326
348
|
}
|
|
327
349
|
exports.Storage = Storage;
|
|
328
|
-
/**
|
|
329
|
-
* @type {Record<TestStepResultStatus, TestStatusEnum>}
|
|
330
|
-
*/
|
|
331
|
-
Storage.statusMap = {
|
|
332
|
-
[cucumber_1.Status.PASSED]: qase_javascript_commons_1.TestStatusEnum.passed,
|
|
333
|
-
[cucumber_1.Status.FAILED]: qase_javascript_commons_1.TestStatusEnum.failed,
|
|
334
|
-
[cucumber_1.Status.SKIPPED]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
335
|
-
[cucumber_1.Status.AMBIGUOUS]: qase_javascript_commons_1.TestStatusEnum.failed,
|
|
336
|
-
[cucumber_1.Status.PENDING]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
337
|
-
[cucumber_1.Status.UNDEFINED]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
338
|
-
[cucumber_1.Status.UNKNOWN]: qase_javascript_commons_1.TestStatusEnum.skipped,
|
|
339
|
-
};
|
|
340
|
-
/**
|
|
341
|
-
* @type {Record<TestStepResultStatus, StepStatusEnum>}
|
|
342
|
-
*/
|
|
343
|
-
Storage.stepStatusMap = {
|
|
344
|
-
[cucumber_1.Status.PASSED]: qase_javascript_commons_1.StepStatusEnum.passed,
|
|
345
|
-
[cucumber_1.Status.FAILED]: qase_javascript_commons_1.StepStatusEnum.failed,
|
|
346
|
-
[cucumber_1.Status.SKIPPED]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
347
|
-
[cucumber_1.Status.AMBIGUOUS]: qase_javascript_commons_1.StepStatusEnum.failed,
|
|
348
|
-
[cucumber_1.Status.PENDING]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
349
|
-
[cucumber_1.Status.UNDEFINED]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
350
|
-
[cucumber_1.Status.UNKNOWN]: qase_javascript_commons_1.StepStatusEnum.skipped,
|
|
351
|
-
};
|