cucumberjs-qase-reporter 2.1.2 → 2.1.3

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.3
2
+
3
+ ## What's new
4
+
5
+ - Added support for table parameters in the test results.
6
+
1
7
  # qase-cucumberjs@2.1.1
2
8
 
3
9
  ## What's new
package/dist/models.d.ts CHANGED
@@ -4,3 +4,7 @@ export interface TestMetadata {
4
4
  title: string | null;
5
5
  isIgnore: boolean;
6
6
  }
7
+ export interface ScenarioData {
8
+ name: string;
9
+ parameters: Record<string, Record<string, string>>;
10
+ }
package/dist/storage.js CHANGED
@@ -66,7 +66,26 @@ class Storage {
66
66
  const { children, name } = document.feature;
67
67
  children.forEach(({ scenario }) => {
68
68
  if (scenario) {
69
- this.scenarios[scenario.id] = name;
69
+ const parameters = {};
70
+ scenario.examples?.forEach((example) => {
71
+ if (example.tableHeader && example.tableBody) {
72
+ const columnNames = example.tableHeader.cells.map(cell => cell.value);
73
+ example.tableBody.forEach((row) => {
74
+ const rowParams = {};
75
+ row.cells.forEach((cell, index) => {
76
+ const columnName = columnNames[index];
77
+ if (columnName) {
78
+ rowParams[columnName] = cell.value;
79
+ }
80
+ });
81
+ parameters[row.id] = rowParams;
82
+ });
83
+ }
84
+ });
85
+ this.scenarios[scenario.id] = {
86
+ name: name,
87
+ parameters: parameters,
88
+ };
70
89
  }
71
90
  });
72
91
  }
@@ -169,18 +188,24 @@ class Storage {
169
188
  }
170
189
  const error = this.getError(tcs.id);
171
190
  let relations = null;
172
- const nodeId = pickle.astNodeIds[pickle.astNodeIds.length - 1];
191
+ let params = {};
192
+ const nodeId = pickle.astNodeIds[0];
173
193
  if (nodeId != undefined && this.scenarios[nodeId] != undefined) {
174
194
  relations = {
175
195
  suite: {
176
196
  data: [
177
197
  {
178
- title: this.scenarios[nodeId] ?? '',
198
+ title: this.scenarios[nodeId]?.name ?? '',
179
199
  public_id: null,
180
200
  },
181
201
  ],
182
202
  },
183
203
  };
204
+ for (const id of pickle.astNodeIds) {
205
+ if (this.scenarios[nodeId]?.parameters[id] != undefined) {
206
+ params = { ...params, ...this.scenarios[nodeId]?.parameters[id] };
207
+ }
208
+ }
184
209
  }
185
210
  return {
186
211
  attachments: this.attachments[testCase.testCaseStartedId] ?? [],
@@ -196,7 +221,7 @@ class Storage {
196
221
  fields: metadata.fields,
197
222
  message: error?.message ?? null,
198
223
  muted: false,
199
- params: {},
224
+ params: params,
200
225
  group_params: {},
201
226
  relations: relations,
202
227
  run_id: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cucumberjs-qase-reporter",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
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.3.3"
43
+ "qase-javascript-commons": "~2.3.5"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@cucumber/cucumber": ">=7.0.0"