@dev-blinq/cucumber_client 1.0.1276-dev → 1.0.1276-stage

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.
Files changed (37) hide show
  1. package/bin/assets/bundled_scripts/recorder.js +121 -121
  2. package/bin/assets/preload/recorderv3.js +3 -1
  3. package/bin/assets/scripts/dom_parent.js +4 -0
  4. package/bin/assets/scripts/recorder.js +11 -4
  5. package/bin/assets/scripts/unique_locators.js +837 -815
  6. package/bin/assets/templates/_hooks_template.txt +37 -0
  7. package/bin/assets/templates/page_template.txt +2 -16
  8. package/bin/assets/templates/utils_template.txt +1 -46
  9. package/bin/client/apiTest/apiTest.js +6 -0
  10. package/bin/client/cli_helpers.js +11 -13
  11. package/bin/client/code_cleanup/utils.js +5 -1
  12. package/bin/client/code_gen/code_inversion.js +53 -4
  13. package/bin/client/code_gen/page_reflection.js +838 -902
  14. package/bin/client/code_gen/playwright_codeget.js +43 -12
  15. package/bin/client/cucumber/feature.js +89 -27
  16. package/bin/client/cucumber/project_to_document.js +1 -1
  17. package/bin/client/cucumber/steps_definitions.js +84 -81
  18. package/bin/client/cucumber_selector.js +17 -1
  19. package/bin/client/local_agent.js +7 -6
  20. package/bin/client/project.js +186 -196
  21. package/bin/client/recorderv3/bvt_recorder.js +170 -60
  22. package/bin/client/recorderv3/implemented_steps.js +74 -16
  23. package/bin/client/recorderv3/index.js +50 -25
  24. package/bin/client/recorderv3/network.js +299 -0
  25. package/bin/client/recorderv3/services.js +4 -16
  26. package/bin/client/recorderv3/step_runner.js +332 -69
  27. package/bin/client/recorderv3/step_utils.js +579 -7
  28. package/bin/client/recorderv3/update_feature.js +32 -30
  29. package/bin/client/run_cucumber.js +5 -1
  30. package/bin/client/scenario_report.js +0 -5
  31. package/bin/client/test_scenario.js +0 -1
  32. package/bin/client/utils/socket_logger.js +132 -0
  33. package/bin/index.js +1 -0
  34. package/bin/logger.js +3 -2
  35. package/bin/min/consoleApi.min.cjs +2 -3
  36. package/bin/min/injectedScript.min.cjs +16 -16
  37. package/package.json +24 -14
@@ -955,6 +955,7 @@ class BVTRecorder {
955
955
  // Get all attributes
956
956
  if (element.attributes) {
957
957
  for (const attr of element.attributes) {
958
+ if (attr.name === "data-blinq-id" || attr.name === "data-input-id") continue;
958
959
  unsortedAttributes[attr.name] = attr.value;
959
960
  }
960
961
  }
@@ -962,6 +963,7 @@ class BVTRecorder {
962
963
  // Get dataset properties (data-* attributes)
963
964
  if (element.dataset) {
964
965
  for (const [key, value] of Object.entries(element.dataset)) {
966
+ if (key === "blinqId" || key === "inputId") continue;
965
967
  unsortedDataset[key] = value;
966
968
  }
967
969
  }
@@ -1188,7 +1190,7 @@ class BVTRecorder {
1188
1190
  cssLocators.push(origenCss);
1189
1191
  }
1190
1192
  const noClasses = CssSelectorGenerator.getCssSelector(el, {
1191
- blacklist: [/^(?!.*h\d).*?\d.*/, /\[style/, /\[data-input-id/, /\[blinq-container/],
1193
+ blacklist: [/^(?!.*h\d).*?\d.*/, /\[style/, /\[data-input-id/],
1192
1194
  combineWithinSelector: true,
1193
1195
  combineBetweenSelectors: true,
1194
1196
  selectors: ["id", "attribute", "tag", "nthchild", "nthoftype"],
@@ -6,6 +6,10 @@ class DOM_Parent {
6
6
  }
7
7
 
8
8
  // TODO: account for slotted elements
9
+
10
+ if (element.assignedSlot) {
11
+ return element.assignedSlot
12
+ }
9
13
  // Get the actual parent element, skipping shadow DOM if necessary
10
14
  let parent = element.parentElement;
11
15
  if (parent) {
@@ -144,7 +144,7 @@ class BVTRecorder {
144
144
  getAction: (e) => {
145
145
  this.eventUtils.consumeEvent(e);
146
146
  },
147
- getInterestedElement: () => {},
147
+ getInterestedElement: () => { },
148
148
  hoverOutlineStyle: "",
149
149
  });
150
150
 
@@ -159,7 +159,7 @@ class BVTRecorder {
159
159
  };
160
160
  },
161
161
  getAction: () => null,
162
- getInterestedElement: () => {},
162
+ getInterestedElement: () => { },
163
163
  hoverOutlineStyle: "",
164
164
  });
165
165
 
@@ -174,7 +174,7 @@ class BVTRecorder {
174
174
  };
175
175
  },
176
176
  getAction: () => null,
177
- getInterestedElement: () => {},
177
+ getInterestedElement: () => { },
178
178
  hoverOutlineStyle: "",
179
179
  });
180
180
 
@@ -642,6 +642,8 @@ class BVTRecorder {
642
642
  // Get all attributes
643
643
  if (element.attributes) {
644
644
  for (const attr of element.attributes) {
645
+ if (attr.name === "data-input-id") continue; // skip input id attribute
646
+ if (attr.name === "data-blinq-id") continue; // skip blinq id attribute{
645
647
  unsortedAttributes[attr.name] = attr.value;
646
648
  }
647
649
  }
@@ -649,6 +651,8 @@ class BVTRecorder {
649
651
  // Get dataset properties (data-* attributes)
650
652
  if (element.dataset) {
651
653
  for (const [key, value] of Object.entries(element.dataset)) {
654
+ if (key === "inputId") continue; // skip input id dataset property
655
+ if (key === "blinqId") continue; // skip blinq id dataset property
652
656
  unsortedDataset[key] = value;
653
657
  }
654
658
  }
@@ -686,7 +690,7 @@ class BVTRecorder {
686
690
  inputID: el.dataset.inputId,
687
691
  tagName: el.tagName,
688
692
  type: el.type,
689
- text: this.PW.selectorUtils.elementText(new Map(), el).full,
693
+ text: this.PW.selectorUtils.elementText(new Map(), el).full.trim(),
690
694
  parent: `tagname: ${el.parentElement?.tagName}\ninnerText: ${el.parentElement?.innerText}`,
691
695
  attrs: {
692
696
  placeholder: el.getAttribute("placeholder"),
@@ -799,6 +803,9 @@ class BVTRecorder {
799
803
  locator.text = text;
800
804
  locator.climb = climb;
801
805
  });
806
+ result.allStrategyLocators.context = result.locators;
807
+ result.allStrategyLocators.strategy = "context";
808
+ result.allStrategyLocators.no_text = [];
802
809
  return result;
803
810
  }
804
811
  const isRecordingText = this.#mode === "recordingText";