testdriverai 4.1.28 → 4.1.29
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 +6 -12
- package/package.json +1 -1
package/lib/commands.js
CHANGED
|
@@ -436,7 +436,7 @@ let commands = {
|
|
|
436
436
|
wait: async (timeout = 3000) => {
|
|
437
437
|
return await delay(timeout);
|
|
438
438
|
},
|
|
439
|
-
"wait-for-image": async (description, timeout =
|
|
439
|
+
"wait-for-image": async (description, timeout = 10000) => {
|
|
440
440
|
log("info", "");
|
|
441
441
|
log(
|
|
442
442
|
"info",
|
|
@@ -451,11 +451,8 @@ let commands = {
|
|
|
451
451
|
let passed = false;
|
|
452
452
|
|
|
453
453
|
while (durationPassed < timeout && !passed) {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
image: await captureScreenBase64(),
|
|
457
|
-
});
|
|
458
|
-
passed = response.data;
|
|
454
|
+
|
|
455
|
+
passed = await assert(`An image matching the description "${description}" appears on screen.`, false, false);
|
|
459
456
|
|
|
460
457
|
durationPassed = new Date().getTime() - startTime;
|
|
461
458
|
if (!passed) {
|
|
@@ -625,13 +622,10 @@ let commands = {
|
|
|
625
622
|
let incrementDistance = 500;
|
|
626
623
|
let passed = false;
|
|
627
624
|
|
|
628
|
-
while (scrollDistance
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
image: await captureScreenBase64(),
|
|
632
|
-
});
|
|
625
|
+
while (scrollDistance <= maxDistance && !passed) {
|
|
626
|
+
|
|
627
|
+
passed = await assert(`An image matching the description "${description}" appears on screen.`, false, false);
|
|
633
628
|
|
|
634
|
-
passed = response.data;
|
|
635
629
|
if (!passed) {
|
|
636
630
|
log(
|
|
637
631
|
"info",
|