@dev-blinq/cucumber_client 1.0.1426-dev → 1.0.1426-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 (43) hide show
  1. package/bin/assets/bundled_scripts/recorder.js +73 -73
  2. package/bin/assets/preload/css_gen.js +10 -10
  3. package/bin/assets/preload/toolbar.js +27 -29
  4. package/bin/assets/preload/unique_locators.js +1 -1
  5. package/bin/assets/preload/yaml.js +288 -275
  6. package/bin/assets/scripts/aria_snapshot.js +223 -220
  7. package/bin/assets/scripts/dom_attr.js +329 -329
  8. package/bin/assets/scripts/dom_parent.js +169 -174
  9. package/bin/assets/scripts/event_utils.js +94 -94
  10. package/bin/assets/scripts/pw.js +2050 -1949
  11. package/bin/assets/scripts/recorder.js +70 -45
  12. package/bin/assets/scripts/snapshot_capturer.js +147 -147
  13. package/bin/assets/scripts/unique_locators.js +153 -45
  14. package/bin/assets/scripts/yaml.js +796 -783
  15. package/bin/assets/templates/_hooks_template.txt +6 -2
  16. package/bin/assets/templates/utils_template.txt +16 -16
  17. package/bin/client/code_cleanup/find_step_definition_references.js +0 -1
  18. package/bin/client/code_gen/api_codegen.js +2 -2
  19. package/bin/client/code_gen/code_inversion.js +63 -2
  20. package/bin/client/code_gen/function_signature.js +4 -0
  21. package/bin/client/code_gen/page_reflection.js +52 -11
  22. package/bin/client/code_gen/playwright_codeget.js +25 -3
  23. package/bin/client/cucumber/feature_data.js +2 -2
  24. package/bin/client/cucumber/project_to_document.js +8 -2
  25. package/bin/client/cucumber/steps_definitions.js +19 -3
  26. package/bin/client/local_agent.js +3 -2
  27. package/bin/client/parse_feature_file.js +23 -26
  28. package/bin/client/playground/projects/env.json +2 -2
  29. package/bin/client/recorderv3/bvt_init.js +363 -0
  30. package/bin/client/recorderv3/bvt_recorder.js +1008 -47
  31. package/bin/client/recorderv3/implemented_steps.js +2 -0
  32. package/bin/client/recorderv3/index.js +3 -283
  33. package/bin/client/recorderv3/scriptTest.js +1 -1
  34. package/bin/client/recorderv3/services.js +818 -142
  35. package/bin/client/recorderv3/step_runner.js +31 -8
  36. package/bin/client/recorderv3/step_utils.js +510 -39
  37. package/bin/client/recorderv3/update_feature.js +32 -13
  38. package/bin/client/recorderv3/wbr_entry.js +61 -0
  39. package/bin/client/recording.js +1 -0
  40. package/bin/client/upload-service.js +4 -2
  41. package/bin/client/utils/socket_logger.js +1 -1
  42. package/bin/index.js +4 -1
  43. package/package.json +6 -4
@@ -15,17 +15,17 @@
15
15
  },
16
16
  o: (t, e) => Object.prototype.hasOwnProperty.call(t, e),
17
17
  r: (t) => {
18
- "undefined" != typeof Symbol &&
18
+ ("undefined" != typeof Symbol &&
19
19
  Symbol.toStringTag &&
20
20
  Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }),
21
- Object.defineProperty(t, "__esModule", { value: !0 });
21
+ Object.defineProperty(t, "__esModule", { value: !0 }));
22
22
  },
23
23
  },
24
24
  e = {};
25
25
  function n(t) {
26
26
  return "object" == typeof t && null !== t && t.nodeType === Node.ELEMENT_NODE;
27
27
  }
28
- t.r(e), t.d(e, { default: () => Q, getCssSelector: () => K });
28
+ (t.r(e), t.d(e, { default: () => Q, getCssSelector: () => K }));
29
29
  const r = { NONE: "", DESCENDANT: " ", CHILD: " > " },
30
30
  o = {
31
31
  id: "id",
@@ -136,7 +136,7 @@
136
136
  e = null != e ? e : S(t);
137
137
  const r = [];
138
138
  let o = t;
139
- for (; n(o) && o !== e; ) r.push(o), (o = o.parentElement);
139
+ for (; n(o) && o !== e; ) (r.push(o), (o = o.parentElement));
140
140
  return r;
141
141
  }
142
142
  function N(t, e) {
@@ -222,7 +222,7 @@
222
222
  for (; r.length <= t.length && n < e; ) {
223
223
  n += 1;
224
224
  const e = r.map((e) => t[e]);
225
- yield e, (r = L(r, t.length - 1));
225
+ (yield e, (r = L(r, t.length - 1)));
226
226
  }
227
227
  })(t, { maxResults: e })
228
228
  );
@@ -235,7 +235,7 @@
235
235
  for (let t = n - 1; t >= 0; t--)
236
236
  if (r[t] > e) {
237
237
  if (0 === t) return M(n + 1);
238
- r[t - 1]++, (r[t] = r[t - 1] + 1);
238
+ (r[t - 1]++, (r[t] = r[t - 1] + 1));
239
239
  }
240
240
  return r[n - 1] > e ? M(n + 1) : r;
241
241
  }
@@ -304,7 +304,7 @@
304
304
  return (function (t) {
305
305
  const { selectors: e, includeTag: n } = t,
306
306
  r = [...e];
307
- return n && !r.includes("tag") && r.push("tag"), r;
307
+ return (n && !r.includes("tag") && r.push("tag"), r);
308
308
  })(e).reduce((e, n) => {
309
309
  const r = (function (t, e) {
310
310
  return (0, W[e])(t);
@@ -319,7 +319,7 @@
319
319
  return r && !o ? -1 : !r && o ? 1 : 0;
320
320
  });
321
321
  })(s, u);
322
- return (e[n] = o ? k(a, { maxResults: i }) : a.map((t) => [t])), e;
322
+ return ((e[n] = o ? k(a, { maxResults: i }) : a.map((t) => [t])), e);
323
323
  }, {});
324
324
  })(t, n),
325
325
  o = (function (t, e) {
@@ -424,7 +424,7 @@
424
424
  ((r = n.selectors),
425
425
  Array.isArray(r)
426
426
  ? r.filter((t) => {
427
- return (e = o), (n = t), Object.values(e).includes(n);
427
+ return ((e = o), (n = t), Object.values(e).includes(n));
428
428
  var e, n;
429
429
  })
430
430
  : []),
@@ -457,7 +457,7 @@
457
457
  for (; g; ) {
458
458
  const { foundElements: t, selector: e } = g;
459
459
  if (b(i, e, s)) return e;
460
- (f = t[0]), (a = e), (g = p());
460
+ ((f = t[0]), (a = e), (g = p()));
461
461
  }
462
462
  return i.length > 1
463
463
  ? i.map((t) => K(t, c)).join(E)
@@ -86,7 +86,7 @@ class BVTTool extends HTMLElement {
86
86
  const tooltip = this.#tooltip;
87
87
 
88
88
  tooltip.style.opacity = "0"; // hide before measuring
89
- tooltip.style.left = "0px"; // reset for accurate width calc
89
+ tooltip.style.left = "0px"; // reset for accurate width calc
90
90
  tooltip.style.top = "0px";
91
91
  tooltip.style.transform = "none"; // remove old transform
92
92
 
@@ -106,7 +106,6 @@ class BVTTool extends HTMLElement {
106
106
  tooltip.style.top = `${rect.bottom + 20}px`;
107
107
  tooltip.style.opacity = "1";
108
108
  });
109
-
110
109
  }
111
110
  hideTooltip() {
112
111
  if (this.#tooltip) {
@@ -129,7 +128,7 @@ class BVTTool extends HTMLElement {
129
128
  // this.#tooltip.style.top = `${rect.top - tooltipRect.height - 8}px`; // 8px gap above button
130
129
  // }
131
130
  // }
132
-
131
+
133
132
  reset() {
134
133
  this.selected = false;
135
134
  }
@@ -168,36 +167,35 @@ class BVTToolBar extends HTMLElement {
168
167
 
169
168
  dragHandler.addEventListener("mousedown", (event) => {
170
169
  event.preventDefault(); // Prevent text selection
171
-
170
+
172
171
  if (dragHandler.hideTooltip) {
173
172
  dragHandler.hideTooltip(); // Hide tooltip while dragging
174
173
  }
175
174
 
176
175
  document.body.style.userSelect = "none";
177
- // const toolbar = this;
178
- // const rect = toolbar.getBoundingClientRect();
179
- // const offsetX = event.clientX - rect.left;
180
- // const offsetY = event.clientY - rect.top;
181
-
182
- // const moveHandler = (event) => {
183
- // const left = event.clientX - offsetX;
184
- // const top = event.clientY - offsetY;
185
- // if (left < 0 || top < 0 || left + rect.width > window.innerWidth || top + rect.height > window.innerHeight) {
186
- // return;
187
- // }
188
- // toolbar.style.left = `${left}px`;
189
- // toolbar.style.top = `${top}px`;
190
- // };
191
-
192
- // const upHandler = () => {
193
- // document.removeEventListener("mousemove", moveHandler);
194
- // document.removeEventListener("mouseup", upHandler);
195
- // };
196
-
197
- // document.addEventListener("mousemove", moveHandler);
198
- // document.addEventListener("mouseup", upHandler);
199
- }
200
- );
176
+ // const toolbar = this;
177
+ // const rect = toolbar.getBoundingClientRect();
178
+ // const offsetX = event.clientX - rect.left;
179
+ // const offsetY = event.clientY - rect.top;
180
+
181
+ // const moveHandler = (event) => {
182
+ // const left = event.clientX - offsetX;
183
+ // const top = event.clientY - offsetY;
184
+ // if (left < 0 || top < 0 || left + rect.width > window.innerWidth || top + rect.height > window.innerHeight) {
185
+ // return;
186
+ // }
187
+ // toolbar.style.left = `${left}px`;
188
+ // toolbar.style.top = `${top}px`;
189
+ // };
190
+
191
+ // const upHandler = () => {
192
+ // document.removeEventListener("mousemove", moveHandler);
193
+ // document.removeEventListener("mouseup", upHandler);
194
+ // };
195
+
196
+ // document.addEventListener("mousemove", moveHandler);
197
+ // document.addEventListener("mouseup", upHandler);
198
+ });
201
199
  return dragHandler;
202
200
  }
203
201
  getHoverTool() {
@@ -205,7 +203,7 @@ class BVTToolBar extends HTMLElement {
205
203
  const hoverTool = document.createElement("x-bvt-tool");
206
204
  hoverTool.name = "hover";
207
205
  hoverTool.tooltipText = "Record hover over an element";
208
- hoverTool.innerHTML = `<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M13.999 17.175l-3.452.774a.391.391 0 00-.245.172l-1.664 2.6c-.809 1.265-2.743.924-3.072-.541L3.71 10.963C3.38 9.493 4.99 8.36 6.263 9.167l8.271 4.933c1.27.805.933 2.746-.535 3.075z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="stroke: currentColor; fill: none;" /><rect x="11" y="3" width="12" height="2" rx="1" fill="currentColor" style="fill: currentColor;"/><rect x="11" y="7" width="9" height="2" rx="1" fill="currentColor" style="fill: currentColor;"/><rect x="11" y="11" width="12" height="2" rx="1" fill="currentColor" style="fill: currentColor;"/><circle cx="9" cy="4" r="1" fill="currentColor" style="fill: currentColor;"/><circle cx="9" cy="8" r="1" fill="currentColor" style="fill: currentColor;"/></svg>`
206
+ hoverTool.innerHTML = `<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M13.999 17.175l-3.452.774a.391.391 0 00-.245.172l-1.664 2.6c-.809 1.265-2.743.924-3.072-.541L3.71 10.963C3.38 9.493 4.99 8.36 6.263 9.167l8.271 4.933c1.27.805.933 2.746-.535 3.075z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="stroke: currentColor; fill: none;" /><rect x="11" y="3" width="12" height="2" rx="1" fill="currentColor" style="fill: currentColor;"/><rect x="11" y="7" width="9" height="2" rx="1" fill="currentColor" style="fill: currentColor;"/><rect x="11" y="11" width="12" height="2" rx="1" fill="currentColor" style="fill: currentColor;"/><circle cx="9" cy="4" r="1" fill="currentColor" style="fill: currentColor;"/><circle cx="9" cy="8" r="1" fill="currentColor" style="fill: currentColor;"/></svg>`;
209
207
  // hoverTool.addEventListener("click", this.onHoverMode);
210
208
  return hoverTool;
211
209
  }
@@ -365,7 +365,7 @@ function generateUniqueCSSSelector(element, options) {
365
365
 
366
366
  let selector = "";
367
367
  const id = element.getAttribute("id");
368
- if (id && !/\d/.test(id) && (!noCSSId)) {
368
+ if (id && !/\d/.test(id) && !noCSSId) {
369
369
  selector = "#" + cssEscape(id);
370
370
  if (isUnique(selector)) return selector;
371
371
  }