testdriverai 4.2.7 → 4.2.9

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.
@@ -0,0 +1,36 @@
1
+ name: Test TestDriverAI Installation
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 * * * *' # Runs every hour
6
+ workflow_dispatch:
7
+ push:
8
+ branches:
9
+ - main
10
+ pull_request:
11
+ branches:
12
+ - main
13
+
14
+ jobs:
15
+ install-testdriverai:
16
+ runs-on: ${{ matrix.runner }}
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ runner: [macos-latest, windows-latest]
21
+ node-version: ['18', '20']
22
+
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Node.js ${{ matrix.node-version }}
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: ${{ matrix.node-version }}
31
+
32
+ - name: Install TestDriverAI globally
33
+ run: npm install -g testdriverai
34
+
35
+ - name: Verify Installation
36
+ run: testdriverai --help || echo "TestDriverAI not found"
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
- const monitors = Monitor.all();
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.7",
3
+ "version": "4.2.9",
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",