@dev-blinq/cucumber_client 1.0.1273-dev → 1.0.1275-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.
@@ -1,7 +1,4 @@
1
-
2
- import DOM_Attr from "./dom_attr";
3
1
  import DOM_Parent from "./dom_parent";
4
- // import SnapshotCapturer from "./snapshot_capturer";
5
2
  import { __PW } from "./pw"
6
3
 
7
4
  class LocatorGenerator {
@@ -15,7 +12,6 @@ class LocatorGenerator {
15
12
  text_with_index: "text_with_index",
16
13
  };
17
14
  this.options = options;
18
- this.dom_Attr = new DOM_Attr();
19
15
  this.dom_Parent = new DOM_Parent();
20
16
  this.PW = __PW;
21
17
  this.injectedScript = injectedScript;
@@ -58,7 +58,8 @@ const _isCodeGenerationStep = (step) => {
58
58
  step.type === Types.VERIFY_ATTRIBUTE ||
59
59
  step.type === Types.VERIFY_PROPERTY ||
60
60
  step.type === Types.SET_INPUT_FILES ||
61
- step.type === Types.VERIFY_PAGE_SNAPSHOT
61
+ step.type === Types.VERIFY_PAGE_SNAPSHOT ||
62
+ step.type === Types.CONDITIONAL_WAIT
62
63
  ) {
63
64
  return true;
64
65
  }
@@ -641,6 +642,13 @@ const _generateCodeFromCommand = (step, elements, userData) => {
641
642
  codeLines.push(line);
642
643
  break;
643
644
  }
645
+ case Types.CONDITIONAL_WAIT: {
646
+ line = `await context.web.conditionalWait(elements["${elementIdentifier}"], `;
647
+ input = "_param_0";
648
+ line += `"${step.parameters[1]}", ${input}, _params, null, this);`;
649
+ codeLines.push(line);
650
+ break;
651
+ }
644
652
  case Types.SET_INPUT_FILES: {
645
653
  line = `await context.web.setInputFiles(elements["${elementIdentifier}"], `;
646
654
  let files = step.parameters[0];
@@ -598,6 +598,11 @@ class StepsDefinitions {
598
598
  Object.assign(bvtError, { info: errInfo });
599
599
  throw bvtError;
600
600
  }
601
+
602
+ return {
603
+ result,
604
+ info,
605
+ };
601
606
  } catch (error) {
602
607
  console.error("Error running cucumber-js", error);
603
608
  throw error;
@@ -701,7 +701,6 @@ export class BVTRecorder {
701
701
  async closeBrowser() {
702
702
  delete process.env.TEMP_RUN;
703
703
  await this.watcher.close().then(() => {});
704
-
705
704
  this.watcher = null;
706
705
  this.previousIndex = null;
707
706
  this.previousHistoryLength = null;
@@ -808,7 +807,7 @@ export class BVTRecorder {
808
807
  }
809
808
  await this.setMode("running");
810
809
  try {
811
- await this.stepRunner.runStep(
810
+ const { result, info } = await this.stepRunner.runStep(
812
811
  {
813
812
  step,
814
813
  parametersMap,
@@ -818,6 +817,7 @@ export class BVTRecorder {
818
817
  options
819
818
  );
820
819
  await this.revertMode();
820
+ return { result, info };
821
821
  } catch (error) {
822
822
  await this.revertMode();
823
823
  throw error;
@@ -114,8 +114,8 @@ export class BVTStepRunner {
114
114
 
115
115
  const stepExecController = new AbortController();
116
116
  this.#currentStepController = stepExecController;
117
- await withAbort(async () => {
118
- await stepsDefinitions.executeStepRemote(
117
+ const { result, info } = await withAbort(async () => {
118
+ return await stepsDefinitions.executeStepRemote(
119
119
  {
120
120
  feature_file_path,
121
121
  tempFolderPath,
@@ -130,5 +130,7 @@ export class BVTStepRunner {
130
130
  fs.rmSync(tempFolderPath, { recursive: true });
131
131
  }
132
132
  });
133
+ console.log("Step execution result:", result);
134
+ return { result, info };
133
135
  }
134
136
  }
@@ -52,6 +52,7 @@ const Types = {
52
52
  VERIFY_FILE_EXISTS: "verify_file_exists",
53
53
  SET_INPUT_FILES: "set_input_files",
54
54
  VERIFY_PAGE_SNAPSHOT: "verify_page_snapshot",
55
+ CONDITIONAL_WAIT: "conditional_wait",
55
56
  };
56
57
  class Recording {
57
58
  steps = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1273-dev",
3
+ "version": "1.0.1275-dev",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "@cucumber/tag-expressions": "^6.1.1",
32
32
  "@dev-blinq/cucumber-js": "1.0.175-dev",
33
33
  "@faker-js/faker": "^8.1.0",
34
- "automation_model": "1.0.754-dev",
34
+ "automation_model": "1.0.755-dev",
35
35
  "axios": "^1.7.4",
36
36
  "chokidar": "^3.6.0",
37
37
  "create-require": "^1.1.1",