cucumberjs-qase-reporter 2.1.8 → 2.1.9

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.1.9
2
+
3
+ ## What's new
4
+
5
+ - Added support for QaseSuite tag.
6
+
1
7
  # qase-cucumberjs@2.1.8
2
8
 
3
9
  ## What's new
package/dist/models.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface TestMetadata {
5
5
  isIgnore: boolean;
6
6
  parameters: Record<string, string>;
7
7
  group_params: Record<string, string>;
8
+ suite: string | null;
8
9
  }
9
10
  export interface ScenarioData {
10
11
  name: string;
package/dist/storage.js CHANGED
@@ -10,6 +10,7 @@ const qaseTitleRegExp = /^@[Qq]ase[Tt]itle=(.+)$/;
10
10
  const qaseFieldsRegExp = /^@[Qq]ase[Ff]ields=(.+)$/;
11
11
  const qaseParametersRegExp = /^@[Qq]ase[Pp]arameters=(.+)$/;
12
12
  const qaseGroupParametersRegExp = /^@[Qq]ase[Gg]roup[Pp]arameters=(.+)$/;
13
+ const qaseSuiteRegExp = /^@[Qq]ase[Ss]uite=(.+)$/;
13
14
  const qaseIgnoreRegExp = /^@[Qq]ase[Ii][Gg][Nn][Oo][Rr][Ee]$/;
14
15
  class Storage {
15
16
  /**
@@ -198,7 +199,20 @@ class Storage {
198
199
  let relations = null;
199
200
  let params = {};
200
201
  const nodeId = pickle.astNodeIds[0];
201
- if (nodeId != undefined && this.scenarios[nodeId] != undefined) {
202
+ // If suite is specified in metadata, use it (split by tab for sub-suites)
203
+ if (metadata.suite) {
204
+ const suiteParts = metadata.suite.split('\t').filter(part => part.trim().length > 0);
205
+ relations = {
206
+ suite: {
207
+ data: suiteParts.map((suite) => ({
208
+ title: suite.trim(),
209
+ public_id: null,
210
+ })),
211
+ },
212
+ };
213
+ }
214
+ else if (nodeId != undefined && this.scenarios[nodeId] != undefined) {
215
+ // Otherwise, use feature name as suite
202
216
  relations = {
203
217
  suite: {
204
218
  data: [
@@ -209,6 +223,9 @@ class Storage {
209
223
  ],
210
224
  },
211
225
  };
226
+ }
227
+ // Extract parameters from Gherkin examples
228
+ if (nodeId != undefined && this.scenarios[nodeId] != undefined) {
212
229
  for (const id of pickle.astNodeIds) {
213
230
  if (this.scenarios[nodeId]?.parameters[id] != undefined) {
214
231
  params = { ...params, ...this.scenarios[nodeId]?.parameters[id] };
@@ -316,6 +333,7 @@ class Storage {
316
333
  isIgnore: false,
317
334
  parameters: {},
318
335
  group_params: {},
336
+ suite: null,
319
337
  };
320
338
  for (const tag of tags) {
321
339
  if (qaseIdRegExp.test(tag.name)) {
@@ -363,6 +381,10 @@ class Storage {
363
381
  // do nothing
364
382
  }
365
383
  }
384
+ if (qaseSuiteRegExp.test(tag.name)) {
385
+ metadata.suite = tag.name.replace(/^@[Qq]ase[Ss]uite=/, '');
386
+ continue;
387
+ }
366
388
  if (qaseIgnoreRegExp.test(tag.name)) {
367
389
  metadata.isIgnore = true;
368
390
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cucumberjs-qase-reporter",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "Qase TMS CucumberJS Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "main": "./dist/index.js",