testdriverai 4.1.34 → 4.1.36
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/commander.js +1 -1
- package/lib/commands.js +6 -3
- package/package.json +1 -1
package/lib/commander.js
CHANGED
|
@@ -50,7 +50,7 @@ commands:
|
|
|
50
50
|
speak(`typing ${object.text}`);
|
|
51
51
|
log("info", generator.jsonToManual(object));
|
|
52
52
|
notify(generator.jsonToManual(object, false));
|
|
53
|
-
response = await commands.type(object.text);
|
|
53
|
+
response = await commands.type(object.text, object.delay);
|
|
54
54
|
break;
|
|
55
55
|
case "press-keys":
|
|
56
56
|
speak(`pressing keys ${object.keys.join(",")}`);
|
package/lib/commands.js
CHANGED
|
@@ -360,10 +360,13 @@ let commands = {
|
|
|
360
360
|
}
|
|
361
361
|
},
|
|
362
362
|
// type a string
|
|
363
|
-
type: async (string) => {
|
|
363
|
+
type: async (string, delay = 500) => {
|
|
364
364
|
await redraw.start();
|
|
365
365
|
string = string.toString();
|
|
366
|
-
|
|
366
|
+
if (delay > 0)
|
|
367
|
+
await robot.typeStringDelayed(string, delay);
|
|
368
|
+
else
|
|
369
|
+
await robot.typeString(string);
|
|
367
370
|
await redraw.wait(5000);
|
|
368
371
|
return;
|
|
369
372
|
},
|
|
@@ -548,7 +551,7 @@ let commands = {
|
|
|
548
551
|
// so we need to release the modifier keys manually
|
|
549
552
|
robot.keyToggle(commandOrControl, "up");
|
|
550
553
|
// type the text
|
|
551
|
-
await robot.
|
|
554
|
+
await robot.typeStringDelayed(text, 500);
|
|
552
555
|
await redraw.wait(5000);
|
|
553
556
|
await robot.keyTap("escape");
|
|
554
557
|
} catch (e) {
|