testdriverai 4.0.60 → 4.0.61

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.
Files changed (2) hide show
  1. package/lib/redraw.js +31 -30
  2. package/package.json +1 -1
package/lib/redraw.js CHANGED
@@ -1,20 +1,20 @@
1
1
  const { captureScreenPNG } = require("./system");
2
2
 
3
- const Jimp = require("jimp");
3
+ // const Jimp = require("jimp");
4
4
 
5
- async function compareImages(image1Url, image2Url) {
6
- const image1 = await Jimp.read(image1Url);
7
- const image2 = await Jimp.read(image2Url);
5
+ // async function compareImages(image1Url, image2Url) {
6
+ // const image1 = await Jimp.read(image1Url);
7
+ // const image2 = await Jimp.read(image2Url);
8
8
 
9
- // Pixel difference
10
- const diff = Jimp.diff(image1, image2);
9
+ // // Pixel difference
10
+ // const diff = Jimp.diff(image1, image2);
11
11
 
12
- if (diff.percent < 0.15) {
13
- return false;
14
- } else {
15
- return true;
16
- }
17
- }
12
+ // if (diff.percent < 0.15) {
13
+ // return false;
14
+ // } else {
15
+ // return true;
16
+ // }
17
+ // }
18
18
 
19
19
  let startImage = null;
20
20
 
@@ -25,24 +25,25 @@ async function start() {
25
25
 
26
26
  function wait(timeoutMs) {
27
27
  return new Promise((resolve) => {
28
- const startTime = Date.now();
29
-
30
- async function checkCondition() {
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(() => {
40
- checkCondition();
41
- }, 200);
42
- }
43
- }
44
-
45
- checkCondition();
28
+ setTimeout(resolve, timeoutMs);
29
+ // const startTime = Date.now();
30
+
31
+ // async function checkCondition() {
32
+ // let nowImage = await captureScreenPNG();
33
+ // let result = await compareImages(startImage, nowImage);
34
+
35
+ // if (result) {
36
+ // resolve("Condition met");
37
+ // } else if (Date.now() - startTime >= timeoutMs) {
38
+ // resolve("Timeout reached");
39
+ // } else {
40
+ // setTimeout(() => {
41
+ // checkCondition();
42
+ // }, 200);
43
+ // }
44
+ // }
45
+
46
+ // checkCondition();
46
47
  });
47
48
  }
48
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "4.0.60",
3
+ "version": "4.0.61",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "index.js",
6
6
  "bin": {