testdriverai 4.0.51 → 4.0.53
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.js +15 -12
- package/lib/commands.js +4 -4
- package/lib/redraw.js +0 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -669,21 +669,24 @@ New commands will be appended.
|
|
|
669
669
|
|
|
670
670
|
let setTerminalWindowTransparency = async (hide) => {
|
|
671
671
|
|
|
672
|
+
if (hide) {
|
|
672
673
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
674
|
+
try {
|
|
675
|
+
http.get('http://localhost:60305/hide').on('error',function(){}).end();
|
|
676
|
+
} catch (e) {
|
|
677
|
+
// Suppress error
|
|
678
|
+
console.error('Caught exception:', e);
|
|
679
|
+
}
|
|
680
|
+
} else {
|
|
679
681
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
682
|
+
try {
|
|
683
|
+
http.get('http://localhost:60305/hide').on('error',function(){}).end();
|
|
684
|
+
} catch (e) {
|
|
685
|
+
// Suppress error
|
|
686
|
+
console.error('Caught exception:', e);
|
|
687
|
+
}
|
|
686
688
|
|
|
689
|
+
}
|
|
687
690
|
|
|
688
691
|
if (!config.TD_MINIMIZE) {
|
|
689
692
|
return
|
package/lib/commands.js
CHANGED
|
@@ -145,7 +145,7 @@ const assert = async (assertion, shouldThrow = false, async = false) => {
|
|
|
145
145
|
await sdk
|
|
146
146
|
.req("assert", {
|
|
147
147
|
expect: assertion,
|
|
148
|
-
image: await captureScreenBase64(
|
|
148
|
+
image: await captureScreenBase64(),
|
|
149
149
|
})
|
|
150
150
|
.then((response) => {
|
|
151
151
|
return handleAssertResponse(response);
|
|
@@ -155,7 +155,7 @@ const assert = async (assertion, shouldThrow = false, async = false) => {
|
|
|
155
155
|
} else {
|
|
156
156
|
let response = await sdk.req("assert", {
|
|
157
157
|
expect: assertion,
|
|
158
|
-
image: await captureScreenBase64(
|
|
158
|
+
image: await captureScreenBase64(),
|
|
159
159
|
});
|
|
160
160
|
return handleAssertResponse(response);
|
|
161
161
|
}
|
|
@@ -399,7 +399,7 @@ let commands = {
|
|
|
399
399
|
while (durationPassed < timeout && !passed) {
|
|
400
400
|
passed = await sdk.req("assert", {
|
|
401
401
|
needle: description,
|
|
402
|
-
image: await captureScreenBase64(
|
|
402
|
+
image: await captureScreenBase64(),
|
|
403
403
|
});
|
|
404
404
|
|
|
405
405
|
durationPassed = new Date().getTime() - startTime;
|
|
@@ -545,7 +545,7 @@ let commands = {
|
|
|
545
545
|
while (scrollDistance < maxDistance && !passed) {
|
|
546
546
|
passed = await sdk.req("assert", {
|
|
547
547
|
needle: `An image matching the description "${description}" appears on screen.`,
|
|
548
|
-
image: await captureScreenBase64(
|
|
548
|
+
image: await captureScreenBase64(),
|
|
549
549
|
});
|
|
550
550
|
|
|
551
551
|
if (!passed) {
|
package/lib/redraw.js
CHANGED