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 +6 -0
- package/dist/models.d.ts +1 -0
- package/dist/storage.js +23 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
package/dist/models.d.ts
CHANGED
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
|
-
|
|
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
|
}
|