testdriverai 4.0.48 → 4.0.50
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 +6 -3
- package/lib/config.js +1 -0
- package/lib/init.js +6 -0
- package/lib/redraw.js +27 -16
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -29,6 +29,7 @@ const generator = require("./lib/generator");
|
|
|
29
29
|
const sdk = require("./lib/sdk");
|
|
30
30
|
const commands = require("./lib/commands");
|
|
31
31
|
const init = require("./lib/init");
|
|
32
|
+
const config = require("./lib/config");
|
|
32
33
|
|
|
33
34
|
const { showTerminal, hideTerminal } = require("./lib/focus-application");
|
|
34
35
|
const isValidVersion = require("./lib/valid-version");
|
|
@@ -45,8 +46,6 @@ let checkCount = 0;
|
|
|
45
46
|
let checkLimit = 3;
|
|
46
47
|
let rl;
|
|
47
48
|
|
|
48
|
-
require("dotenv").config();
|
|
49
|
-
|
|
50
49
|
// list of prompts that the user has given us
|
|
51
50
|
let tasks = [];
|
|
52
51
|
|
|
@@ -499,7 +498,6 @@ const generate = async (type) => {
|
|
|
499
498
|
}
|
|
500
499
|
let list = testPrompt.listsOrdered[0];
|
|
501
500
|
|
|
502
|
-
list.push(`/save testdriver/${fileName}`);
|
|
503
501
|
let contents = list
|
|
504
502
|
.map((item, index) => `${index + 1}. /explore ${item}`)
|
|
505
503
|
.join("\n");
|
|
@@ -669,6 +667,11 @@ New commands will be appended.
|
|
|
669
667
|
};
|
|
670
668
|
|
|
671
669
|
let setTerminalWindowTransparency = async (hide) => {
|
|
670
|
+
|
|
671
|
+
if (!config.TD_MINIMIZE) {
|
|
672
|
+
return
|
|
673
|
+
};
|
|
674
|
+
|
|
672
675
|
try {
|
|
673
676
|
if (hide) {
|
|
674
677
|
if (terminalApp) {
|
package/lib/config.js
CHANGED
package/lib/init.js
CHANGED
|
@@ -81,6 +81,12 @@ module.exports = async () => {
|
|
|
81
81
|
message: "Enable desktop notifications?",
|
|
82
82
|
initial: true,
|
|
83
83
|
},
|
|
84
|
+
{
|
|
85
|
+
type: "confirm",
|
|
86
|
+
name: "TD_MINIMIZE",
|
|
87
|
+
message: "Minimize terminal app?",
|
|
88
|
+
initial: true,
|
|
89
|
+
},
|
|
84
90
|
{
|
|
85
91
|
type: "confirm",
|
|
86
92
|
name: "TD_SPEAK",
|
package/lib/redraw.js
CHANGED
|
@@ -24,24 +24,35 @@ async function start() {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function wait(timeoutMs) {
|
|
27
|
+
|
|
28
|
+
// wait for a certain amount of time
|
|
27
29
|
return new Promise((resolve) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let nowImage = await captureScreenPNG();
|
|
32
|
-
let result = await compareImages(startImage, nowImage);
|
|
33
|
-
|
|
34
|
-
if (result) {
|
|
35
|
-
resolve("Condition met");
|
|
36
|
-
} else if (Date.now() - startTime >= timeoutMs) {
|
|
37
|
-
resolve("Timeout reached");
|
|
38
|
-
} else {
|
|
39
|
-
setTimeout(checkCondition, 0);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
checkCondition();
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
resolve("Timeout reached");
|
|
32
|
+
}, timeoutMs);
|
|
44
33
|
});
|
|
34
|
+
|
|
35
|
+
// return new Promise((resolve) => {
|
|
36
|
+
// const startTime = Date.now();
|
|
37
|
+
|
|
38
|
+
// async function checkCondition() {
|
|
39
|
+
// console.log('check condition')
|
|
40
|
+
// let nowImage = await captureScreenPNG();
|
|
41
|
+
// let result = await compareImages(startImage, nowImage);
|
|
42
|
+
|
|
43
|
+
// if (result) {
|
|
44
|
+
// resolve("Condition met");
|
|
45
|
+
// } else if (Date.now() - startTime >= timeoutMs) {
|
|
46
|
+
// resolve("Timeout reached");
|
|
47
|
+
// } else {
|
|
48
|
+
// setTimeout(() => {
|
|
49
|
+
// checkCondition();
|
|
50
|
+
// }, 0);
|
|
51
|
+
// }
|
|
52
|
+
// }
|
|
53
|
+
|
|
54
|
+
// checkCondition();
|
|
55
|
+
// });
|
|
45
56
|
}
|
|
46
57
|
|
|
47
58
|
module.exports = { start, wait };
|