@dev-blinq/cucumber_client 1.0.1683-dev → 1.0.1684-dev

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.
@@ -507,7 +507,7 @@ export class BVTRecorder {
507
507
  this.workspaceService = new PublishService(this.TOKEN);
508
508
  this.pageSet = new Set();
509
509
  this.lastKnownUrlPath = "";
510
- this.world = { attach: () => {} };
510
+ this.world = { attach: () => { } };
511
511
  this.shouldTakeScreenshot = true;
512
512
  this.watcher = null;
513
513
  this.networkEventsFolder = path.join(tmpdir(), "blinq_network_events");
@@ -650,7 +650,7 @@ export class BVTRecorder {
650
650
  }
651
651
 
652
652
  // this.stepRunner.setRemoteDebugPort(this.#remoteDebuggerPort);
653
- this.world = { attach: () => {} };
653
+ this.world = { attach: () => { } };
654
654
 
655
655
  const ai_config_file = path.join(this.projectDir, "ai_config.json");
656
656
  let ai_config = {};
@@ -1154,7 +1154,7 @@ export class BVTRecorder {
1154
1154
  }
1155
1155
  async closeBrowser() {
1156
1156
  delete process.env.TEMP_RUN;
1157
- await this.watcher.close().then(() => {});
1157
+ await this.watcher.close().then(() => { });
1158
1158
  this.watcher = null;
1159
1159
  this.previousIndex = null;
1160
1160
  this.previousHistoryLength = null;
@@ -1499,6 +1499,7 @@ export class BVTRecorder {
1499
1499
 
1500
1500
  const steps = [];
1501
1501
  const parameters = [];
1502
+ const datasets = []
1502
1503
  if (scenario.examples && scenario.examples.length > 0) {
1503
1504
  const example = scenario.examples[0];
1504
1505
  example?.tableHeader?.cells.forEach((cell, index) => {
@@ -1506,7 +1507,26 @@ export class BVTRecorder {
1506
1507
  key: cell.value,
1507
1508
  value: unEscapeNonPrintables(example.tableBody[0].cells[index].value),
1508
1509
  });
1510
+ // datasets.push({
1511
+ // data: example.tableBody[]
1512
+ // })
1509
1513
  });
1514
+
1515
+ for (let i = 0; i < example.tableBody.length; i++) {
1516
+ const row = example.tableBody[i];
1517
+ // for (const row of example.tableBody) {
1518
+ const paramters = [];
1519
+ row.cells.forEach((cell, index) => {
1520
+ paramters.push({
1521
+ key: example.tableHeader.cells[index].value,
1522
+ value: unEscapeNonPrintables(cell.value),
1523
+ });
1524
+ });
1525
+ datasets.push({
1526
+ data: paramters,
1527
+ datasetId: i,
1528
+ });
1529
+ }
1510
1530
  }
1511
1531
 
1512
1532
  for (const step of scenario.steps) {
@@ -1527,6 +1547,7 @@ export class BVTRecorder {
1527
1547
  tags: scenario.tags.map((tag) => tag.name),
1528
1548
  steps,
1529
1549
  parameters,
1550
+ datasets,
1530
1551
  };
1531
1552
  }
1532
1553
  async findRelatedTextInAllFrames({ searchString, climb, contextText, params }) {
@@ -1930,7 +1951,7 @@ export class BVTRecorder {
1930
1951
  await page
1931
1952
  .context()
1932
1953
  .grantPermissions(["clipboard-read", "clipboard-write"])
1933
- .catch(() => {});
1954
+ .catch(() => { });
1934
1955
  await page.evaluate(async (clipboardPayload) => {
1935
1956
  console.log("Injecting clipboard payload", clipboardPayload);
1936
1957
  const toArrayBuffer = (base64) => {
@@ -108,7 +108,18 @@ export function getCommandContent(command) {
108
108
  }
109
109
  }
110
110
 
111
- export function getExamplesContent(parametersMap) {
111
+ export function getExamplesContent(parametersMap, datasets) {
112
+ if (datasets && datasets.length > 0) {
113
+ let result = ''
114
+ const keys = Object.keys(parametersMap);
115
+ result += "\t\tExamples:\n";
116
+
117
+ result += `\t\t| ${keys.join(" | ")} |\n`;
118
+ for (const dataset of datasets) {
119
+ result += `\t\t| ${dataset.data.map(d => escapeNonPrintables(d.value)).join(" | ")} |\n`;
120
+ }
121
+ return result;
122
+ }
112
123
  const keys = Object.keys(parametersMap);
113
124
  const l = keys.length;
114
125
  let result = "\t\tExamples:\n";
@@ -164,7 +175,7 @@ export function getScenarioContent({ scenario }, featureFileObject) {
164
175
  scenarioContent += `\t${step.keyword} ${escapeString(step.text)}\n`;
165
176
  }
166
177
  if (!isParmatersMapEmpty) {
167
- scenarioContent += getExamplesContent(prametersMap);
178
+ scenarioContent += getExamplesContent(prametersMap, scenario.datasets);
168
179
  }
169
180
  return scenarioContent;
170
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1683-dev",
3
+ "version": "1.0.1684-dev",
4
4
  "description": " ",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",