testaro 60.4.0 → 60.5.0
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/AGENTS.md +8 -5
- package/README.md +105 -52
- package/UPGRADES.md +163 -0
- package/package.json +1 -1
- package/procs/doTestAct.js +27 -26
- package/procs/shoot.js +51 -0
- package/procs/tellServer.js +1 -1
- package/procs/visChange.js +2 -4
- package/run.js +41 -39
- package/testaro/motion.js +40 -23
- package/testaro/motionSolo.js +1 -1
- package/testaro/shoot0.js +26 -0
- package/testaro/shoot1.js +26 -0
- package/tests/testaro.js +26 -8
- package/tests/wave.js +3 -2
- package/testaro/shoot.js +0 -57
package/testaro/shoot.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
© 2025 Jonathan Robert Pool. All rights reserved.
|
|
3
|
-
Licensed under the MIT License. See LICENSE file for details.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
shoot
|
|
8
|
-
This test makes a full-page screenshot and returns it as a PNG object.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
// IMPORTS
|
|
12
|
-
|
|
13
|
-
const {PNG} = require('pngjs');
|
|
14
|
-
const {screenShot} = require('../procs/screenShot');
|
|
15
|
-
const {result} = require('../tests/testaro');
|
|
16
|
-
|
|
17
|
-
// FUNCTIONS
|
|
18
|
-
|
|
19
|
-
exports.reporter = async page => {
|
|
20
|
-
// Get the result of the previous iterations of this test, if any.
|
|
21
|
-
const shootResult = result ? result.shoot || {} : {};
|
|
22
|
-
// If any previous failure occurred:
|
|
23
|
-
if (shootResult && shootResult.success === false) {
|
|
24
|
-
// Return a failure without making a screenshot.
|
|
25
|
-
return {
|
|
26
|
-
success: false,
|
|
27
|
-
prevented: true,
|
|
28
|
-
error: 'At least 1 screenshot failed'
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
// Otherwise, make and get a screenshot.
|
|
32
|
-
const shot = await screenShot(page);
|
|
33
|
-
// If it succeeded:
|
|
34
|
-
if (shot.length) {
|
|
35
|
-
// Get the screenshot as an object representation of a PNG image.
|
|
36
|
-
const png = PNG.sync.read(shot);
|
|
37
|
-
shootResult.pngs ??= [];
|
|
38
|
-
const {pngs} = shootResult;
|
|
39
|
-
// Add it to the test result.
|
|
40
|
-
pngs.push(png);
|
|
41
|
-
// Return the updated result.
|
|
42
|
-
return {
|
|
43
|
-
success: true,
|
|
44
|
-
prevented: false,
|
|
45
|
-
pngs
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
// Otherwise, i.e. if it failed:
|
|
49
|
-
else {
|
|
50
|
-
// Return this.
|
|
51
|
-
return {
|
|
52
|
-
success: false,
|
|
53
|
-
prevented: true,
|
|
54
|
-
error: 'Screenshot failed'
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
};
|