@bigbinary/neeto-playwright-commons 1.22.46 → 1.22.47

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.
package/index.cjs.js CHANGED
@@ -191900,8 +191900,12 @@ class WebhooksPage {
191900
191900
  }
191901
191901
 
191902
191902
  const simulateTypingWithDelay = async ({ field, value, delay = 500, }) => {
191903
- const sliceLength = Math.floor(Math.random() * 5) + 10;
191904
- const backspaceCount = Math.floor(Math.random() * 3) + 2;
191903
+ const minSliceLength = Math.max(3, Math.floor(value.length * 0.6));
191904
+ const maxSliceLength = Math.max(4, Math.floor(value.length * 0.8));
191905
+ const sliceLength = Math.floor(Math.random() * (maxSliceLength - minSliceLength + 1)) +
191906
+ minSliceLength;
191907
+ const maxBackspaceCount = Math.max(2, Math.min(4, Math.floor(sliceLength * 0.3)));
191908
+ const backspaceCount = Math.floor(Math.random() * (maxBackspaceCount - 1)) + 2;
191905
191909
  const textPart1 = value.slice(0, sliceLength);
191906
191910
  const textPart2 = value.slice(sliceLength - backspaceCount);
191907
191911
  await field.hover();