@dev-blinq/cucumber_client 1.0.1193-dev → 1.0.1195-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.
@@ -521,9 +521,9 @@ const invertCodeToCommand = (codeString, elements = {}, stepParams, stepsDefinit
521
521
  if (propName === "web" || propName === "stable") {
522
522
  const step = invertStableCommand(call, elements, stepParams);
523
523
  if (step) steps.push(step);
524
- // } else if (propName === "api") {
525
- // const step = invertApiCommand(stepsDefinitions, codePage, stepName);
526
- // if (step) steps.push(step);
524
+ } else if (propName === "api") {
525
+ const step = invertApiCommand(stepsDefinitions, codePage, stepName);
526
+ if (step) steps.push(step);
527
527
  } else {
528
528
  return;
529
529
  }
@@ -214,7 +214,6 @@ export class BVTRecorder {
214
214
  this.world = { attach: () => {} };
215
215
  this.shouldTakeScreenshot = true;
216
216
  this.watcher = null;
217
- this.sendEvent("BVTRecorder.getTestData", {});
218
217
  }
219
218
  events = {
220
219
  onFrameNavigate: "BVTRecorder.onFrameNavigate",
@@ -619,9 +618,7 @@ export class BVTRecorder {
619
618
  }
620
619
  async closeBrowser() {
621
620
  delete process.env.TEMP_RUN;
622
- await this.watcher.close().then(() => {
623
- this.logger.info(`Closed current testData file`);
624
- });
621
+ await this.watcher.close().then(() => {});
625
622
  this.watcher = null;
626
623
  await closeContext();
627
624
  this.pageSet.clear();
@@ -34,6 +34,7 @@ let recorder = null;
34
34
  const init = async ({ envName, projectDir, roomId }) => {
35
35
  console.log("connecting to " + WS_URL);
36
36
  const socket = io(WS_URL);
37
+ // Disconnect from the server when the process exits
37
38
  socket.on("connect", () => {
38
39
  // console.log('connected to server')
39
40
  });
@@ -232,7 +232,7 @@ export const getImplementedSteps = async (projectDir) => {
232
232
  delete scenario.scenarioText;
233
233
  delete scenario.featureText;
234
234
  delete scenario.scenarioDocument;
235
- // delete scenario.examples;
235
+ delete scenario.examples;
236
236
  delete scenario.steps;
237
237
  for (const tag of scenario.tags) {
238
238
  delete tag.location;
@@ -132,11 +132,13 @@ export async function saveRecording({ step, cucumberStep, codePage, projectDir,
132
132
  step.keyword,
133
133
  stepsDefinitions
134
134
  );
135
- stepsDefinitions.addStep({
136
- name: step.text,
137
- file: result.codePage.sourceFileName,
138
- source: "recorder",
139
- });
135
+ if (!step.isImplemented) {
136
+ stepsDefinitions.addStep({
137
+ name: step.text,
138
+ file: result.codePage.sourceFileName,
139
+ source: "recorder",
140
+ });
141
+ }
140
142
  cucumberStep.methodName = result.methodName;
141
143
  return result.codePage;
142
144
  } else {
@@ -227,7 +229,7 @@ export const getCommandsForImplementedStep = (stepName, stepsDefinitions, stepPa
227
229
 
228
230
  isUtilStep = codePage.sourceFileName.endsWith("utils.mjs");
229
231
  for (const { code } of codeCommands) {
230
- const command = invertCodeToCommand(code, elements, stepParams)[0];
232
+ const command = invertCodeToCommand(code, elements, stepParams, stepsDefinitions, codePage, stepName)[0];
231
233
  if (command === undefined || command.type === null) continue;
232
234
  if (command.element) {
233
235
  const key = command.element.key;
@@ -5,6 +5,7 @@ import { Step } from "../client/cucumber/feature.js";
5
5
  This list need to be in sync with the list exist in the commands.js file
6
6
  */
7
7
  const Types = {
8
+ API: "api",
8
9
  CLICK: "click_element",
9
10
  CLICK_SIMPLE: "click_simple",
10
11
  NAVIGATE: "navigate",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1193-dev",
3
+ "version": "1.0.1195-dev",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",