@dev-blinq/cucumber_client 1.0.1281-dev → 1.0.1281-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 +106 -106
  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 +4 -1
  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 +839 -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 +578 -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 +22 -13
@@ -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) {
@@ -690,7 +690,7 @@ class BVTRecorder {
690
690
  inputID: el.dataset.inputId,
691
691
  tagName: el.tagName,
692
692
  type: el.type,
693
- text: this.PW.selectorUtils.elementText(new Map(), el).full,
693
+ text: this.PW.selectorUtils.elementText(new Map(), el).full.trim(),
694
694
  parent: `tagname: ${el.parentElement?.tagName}\ninnerText: ${el.parentElement?.innerText}`,
695
695
  attrs: {
696
696
  placeholder: el.getAttribute("placeholder"),
@@ -803,6 +803,9 @@ class BVTRecorder {
803
803
  locator.text = text;
804
804
  locator.climb = climb;
805
805
  });
806
+ result.allStrategyLocators.context = result.locators;
807
+ result.allStrategyLocators.strategy = "context";
808
+ result.allStrategyLocators.no_text = [];
806
809
  return result;
807
810
  }
808
811
  const isRecordingText = this.#mode === "recordingText";