testdriverai 4.1.47 → 4.1.49
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/system.js +17 -2
- package/package.json +6 -6
package/lib/system.js
CHANGED
|
@@ -4,7 +4,6 @@ const os = require("os");
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const screenshot = require("screenshot-desktop");
|
|
6
6
|
const si = require("systeminformation");
|
|
7
|
-
const activeWindow = require("active-win");
|
|
8
7
|
const robot = require("robotjs");
|
|
9
8
|
const sharp = require("sharp");
|
|
10
9
|
const { emitter, events } = require("./events.js");
|
|
@@ -111,9 +110,25 @@ const platform = () => {
|
|
|
111
110
|
return platform;
|
|
112
111
|
};
|
|
113
112
|
|
|
113
|
+
// Import get-windows using dynamic import for ES module compatibility
|
|
114
|
+
let activeWindowFn = null;
|
|
115
|
+
const initializeActiveWindow = async () => {
|
|
116
|
+
if (!activeWindowFn) {
|
|
117
|
+
const { activeWindow } = await import('get-windows');
|
|
118
|
+
activeWindowFn = activeWindow;
|
|
119
|
+
}
|
|
120
|
+
return activeWindowFn;
|
|
121
|
+
};
|
|
122
|
+
|
|
114
123
|
// this is the focused window
|
|
115
124
|
const activeWin = async () => {
|
|
116
|
-
|
|
125
|
+
try {
|
|
126
|
+
const activeWindow = await initializeActiveWindow();
|
|
127
|
+
return await activeWindow();
|
|
128
|
+
} catch (error) {
|
|
129
|
+
console.error('Error getting active window:', error);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
117
132
|
};
|
|
118
133
|
|
|
119
134
|
const getMousePosition = async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testdriverai",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.49",
|
|
4
4
|
"description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@electerm/strip-ansi": "^1.0.0",
|
|
20
|
-
"active-win": "^8.2.1",
|
|
21
20
|
"axios": "^1.7.7",
|
|
22
21
|
"chalk": "^4.1.2",
|
|
23
22
|
"cli-progress": "^3.12.0",
|
|
@@ -25,6 +24,7 @@
|
|
|
25
24
|
"decompress": "^4.2.1",
|
|
26
25
|
"dotenv": "^16.4.5",
|
|
27
26
|
"electron": "^33.0.2",
|
|
27
|
+
"get-windows": "^9.2.0",
|
|
28
28
|
"jimp": "^0.22.12",
|
|
29
29
|
"js-yaml": "^4.1.0",
|
|
30
30
|
"mac-screen-capture-permissions": "^2.1.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"odiff-bin": "^3.1.2",
|
|
38
38
|
"prompts": "^2.4.2",
|
|
39
39
|
"remark-parse": "^11.0.0",
|
|
40
|
-
"rimraf": "^
|
|
40
|
+
"rimraf": "^6.0.1",
|
|
41
41
|
"robotjs": "^0.6.0",
|
|
42
42
|
"sanitize-filename": "^1.6.3",
|
|
43
43
|
"say": "^0.16.0",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "^9.10.0",
|
|
54
|
+
"chai": "^5.1.2",
|
|
54
55
|
"esbuild": "0.20.2",
|
|
55
56
|
"esbuild-plugin-fileloc": "^0.0.6",
|
|
56
57
|
"eslint": "^9.10.0",
|
|
57
58
|
"globals": "^15.9.0",
|
|
58
|
-
"node-addon-api": "^8.0.0",
|
|
59
|
-
"node-gyp": "^10.1.0",
|
|
60
59
|
"mocha": "^10.8.2",
|
|
61
|
-
"
|
|
60
|
+
"node-addon-api": "^8.0.0",
|
|
61
|
+
"gi": "^10.1.0",
|
|
62
62
|
"prettier": "3.3.3"
|
|
63
63
|
},
|
|
64
64
|
"optionalDependencies": {
|