cucumberjs-qase-reporter 2.0.3 → 2.0.4

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 CHANGED
@@ -1,3 +1,9 @@
1
+ # qase-cucumberjs@2.0.4
2
+
3
+ ## What's new
4
+
5
+ Fixed the issue with the `QaseFields` tag.
6
+
1
7
  # qase-cucumberjs@2.0.3
2
8
 
3
9
  ## What's new
@@ -7,11 +13,11 @@ Support attachments in the test results.
7
13
  ```js
8
14
  const { Given, Then } = require('cucumber');
9
15
 
10
- Given('I have a step with attachment', async function () {
16
+ Given('I have a step with attachment', async function() {
11
17
  await this.attach('Hello, world!', 'text/plain');
12
18
  });
13
19
 
14
- Then('I have a step with attachment', async function () {
20
+ Then('I have a step with attachment', async function() {
15
21
  await this.attach('Hello, world!', 'text/plain');
16
22
  });
17
23
  ```
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
@@ -7,51 +7,49 @@ const uuid_1 = require("uuid");
7
7
  const qaseIdRegExp = /^@[Qq]-?(\d+)$/g;
8
8
  const newQaseIdRegExp = /^@[Qq]ase[Ii][Dd]=(\d+)$/g;
9
9
  const qaseTitleRegExp = /^@[Qq]ase[Tt]itle=(.+)$/g;
10
- const qaseFieldsRegExp = /^@[Qq]ase[Ff]ields:(.+?)=(.+)$/g;
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
- constructor() {
14
- /**
15
- * @type {Record<string, Pickle>}
16
- * @private
17
- */
18
- this.pickles = {};
19
- /**
20
- * @type {Record<string, TestCaseStarted>}
21
- * @private
22
- */
23
- this.testCaseStarts = {};
24
- /**
25
- * @type {Record<string, TestStepFinished>}
26
- * @private
27
- */
28
- this.testCaseSteps = {};
29
- /**
30
- * @type {Record<string, TestStatusEnum>}
31
- * @private
32
- */
33
- this.testCaseStartedResult = {};
34
- /**
35
- * @type {Record<string, string[]>}
36
- * @private
37
- */
38
- this.testCaseStartedErrors = {};
39
- /**
40
- * @type {Record<string, string>}
41
- * @private
42
- */
43
- this.testCases = {};
44
- /**
45
- * @type {Record<string, string>}
46
- * @private
47
- */
48
- this.scenarios = {};
49
- /**
50
- * @type {Record<string, string>}
51
- * @private
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: [],
@@ -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
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cucumberjs-qase-reporter",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Qase TMS CucumberJS Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "main": "./dist/index.js",