testdriverai 4.2.12 → 4.2.13
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/lib/commands.js +4 -1
- package/package.json +1 -1
package/lib/commands.js
CHANGED
|
@@ -363,7 +363,10 @@ let commands = {
|
|
|
363
363
|
type: async (string, delay = 500) => {
|
|
364
364
|
await redraw.start();
|
|
365
365
|
string = string.toString();
|
|
366
|
-
|
|
366
|
+
// there is a bug in robotjs that causes repeated characters to only be typed once
|
|
367
|
+
// so we need to check for repeated characters and type them slowly if so
|
|
368
|
+
const hasRepeatedChars = /(.)\1/.test(string);
|
|
369
|
+
if (delay > 0 && hasRepeatedChars)
|
|
367
370
|
await robot.typeStringDelayed(string, delay);
|
|
368
371
|
else
|
|
369
372
|
await robot.typeString(string);
|