testaro 8.4.4 → 8.4.6
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/README.md +2 -0
- package/call.js +4 -2
- package/high.js +12 -5
- package/package.json +1 -1
- package/run.js +2 -0
package/README.md
CHANGED
|
@@ -283,6 +283,8 @@ Another navigation example is:
|
|
|
283
283
|
|
|
284
284
|
In this case, Testaro waits until the page title contains the string “travel” (case-insensitively).
|
|
285
285
|
|
|
286
|
+
The `launch` navigation command allows you to specify a “lowMotion” property as `true`. If you do, then the browser creates tabs with the `reduce-motion` option set to `reduce` instead of `no-preference`. This makes the browser act as if the user has chosen a [motion-reduction option in the settings of the operating system or browser](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#user_preferences). However, there are often motions on web pages that this option fails to suppress, such as those on the [Inditex](https://www.inditex.com/itxcomweb/en/home) and [Rescuing Leftover Cuisine](https://www.rescuingleftovercuisine.org) home pages. Carousel motion is also not suppressed.
|
|
287
|
+
|
|
286
288
|
##### Alterations
|
|
287
289
|
|
|
288
290
|
An example of an **alteration** is:
|
package/call.js
CHANGED
|
@@ -29,8 +29,10 @@ const reportDir = process.env.REPORTDIR;
|
|
|
29
29
|
|
|
30
30
|
// Fulfills a high-level testing request.
|
|
31
31
|
const callHigh = async jobID => {
|
|
32
|
-
await runJob(jobID);
|
|
33
|
-
|
|
32
|
+
const done = await runJob(jobID);
|
|
33
|
+
if (done) {
|
|
34
|
+
console.log(`Job completed and report ${jobID}.json saved in ${reportDir}`);
|
|
35
|
+
}
|
|
34
36
|
};
|
|
35
37
|
// Starts a watch.
|
|
36
38
|
const callWatch = async (isDirWatch, isForever, interval) => {
|
package/high.js
CHANGED
|
@@ -41,13 +41,20 @@ exports.runJob = async jobID => {
|
|
|
41
41
|
acts: [],
|
|
42
42
|
jobData: {}
|
|
43
43
|
};
|
|
44
|
-
//
|
|
45
|
-
await doJob(report);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
// If the initialized report is valid, run the job, adding the results to the report.
|
|
45
|
+
const done = await doJob(report);
|
|
46
|
+
if (done) {
|
|
47
|
+
const reportJSON = JSON.stringify(report, null, 2);
|
|
48
|
+
await fs.writeFile(`${reportDir}/${jobID}.json`, reportJSON);
|
|
49
|
+
console.log(`Report ${jobID}.json recorded in ${process.env.REPORTDIR}`);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
49
55
|
}
|
|
50
56
|
catch(error) {
|
|
51
57
|
console.log(`ERROR running job (${error.message})\n${error.stack}`);
|
|
58
|
+
return false;
|
|
52
59
|
}
|
|
53
60
|
};
|
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -1560,8 +1560,10 @@ exports.doJob = async report => {
|
|
|
1560
1560
|
const endTime = new Date();
|
|
1561
1561
|
report.jobData.endTime = nowString();
|
|
1562
1562
|
report.jobData.elapsedSeconds = Math.floor((endTime - startTime) / 1000);
|
|
1563
|
+
return true;
|
|
1563
1564
|
}
|
|
1564
1565
|
else {
|
|
1565
1566
|
console.log('ERROR: Initialized job report invalid');
|
|
1567
|
+
return false;
|
|
1566
1568
|
}
|
|
1567
1569
|
};
|