testdriverai 4.2.8 → 4.2.10
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/.github/workflows/format.yml +1 -1
- package/lib/system.js +2 -6
- package/package.json +2 -1
package/lib/system.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
const fs = require("fs");
|
|
3
3
|
const os = require("os");
|
|
4
4
|
const path = require("path");
|
|
5
|
+
const screenshot = require("screenshot-desktop");
|
|
5
6
|
const si = require("systeminformation");
|
|
6
7
|
const robot = require("robotjs");
|
|
7
8
|
const sharp = require("sharp");
|
|
8
9
|
const { emitter, events } = require("./events.js");
|
|
9
|
-
const { Monitor } = require("node-screenshots");
|
|
10
10
|
|
|
11
11
|
let primaryDisplay = null;
|
|
12
12
|
|
|
@@ -47,11 +47,7 @@ const captureAndResize = async (scale = 1, silent = false, mouse = false) => {
|
|
|
47
47
|
let step1 = tmpFilename();
|
|
48
48
|
let step2 = tmpFilename();
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
const primaryMonitor = monitors.find(monitor => monitor.isPrimary);
|
|
52
|
-
const image = await primaryMonitor.captureImage(); // Capture the image asynchronously
|
|
53
|
-
const buffer = await image.toPng(); // Convert the image to PNG format
|
|
54
|
-
fs.writeFileSync(step1, buffer); // Save the image to a file
|
|
50
|
+
await screenshot({ filename: step1, format: "png" });
|
|
55
51
|
|
|
56
52
|
// Fetch the mouse position
|
|
57
53
|
const mousePos = robot.getMousePos();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testdriverai",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.10",
|
|
4
4
|
"description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"robotjs": "^0.6.0",
|
|
42
42
|
"sanitize-filename": "^1.6.3",
|
|
43
43
|
"say": "^0.16.0",
|
|
44
|
+
"screenshot-desktop": "^1.15.0",
|
|
44
45
|
"semver": "^7.6.2",
|
|
45
46
|
"sharp": "^0.33.5",
|
|
46
47
|
"systeminformation": "^5.23.5",
|