testaro 5.5.1 → 5.5.4
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/create.js +4 -3
- package/package.json +1 -1
- package/run.js +3 -0
- package/tests/focInd.js +15 -2
package/create.js
CHANGED
|
@@ -75,7 +75,7 @@ exports.runJob = async (scriptID, batchID) => {
|
|
|
75
75
|
'runHost', [id, JSON.stringify(script), JSON.stringify(host)],
|
|
76
76
|
{
|
|
77
77
|
detached: true,
|
|
78
|
-
stdio: [0, 1, 'ipc']
|
|
78
|
+
stdio: [0, 1, 'ignore', 'ipc']
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
subprocess.on('exit', () => {
|
|
@@ -89,7 +89,8 @@ exports.runJob = async (scriptID, batchID) => {
|
|
|
89
89
|
// If there is no need to keep checking:
|
|
90
90
|
const reportNames = await fs.readdir(reportDir);
|
|
91
91
|
const timedOut = Date.now() - startTime > 1000 * timeLimit;
|
|
92
|
-
|
|
92
|
+
const reportWritten = reportNames.includes(`${id}.json`);
|
|
93
|
+
if (timedOut || reportWritten || ! childAlive) {
|
|
93
94
|
// Stop checking.
|
|
94
95
|
clearInterval(reCheck);
|
|
95
96
|
// If the cause is a timeout:
|
|
@@ -98,7 +99,7 @@ exports.runJob = async (scriptID, batchID) => {
|
|
|
98
99
|
timeoutHosts.push(id);
|
|
99
100
|
}
|
|
100
101
|
// Otherwise, if the cause is a child crash:
|
|
101
|
-
else if (! childAlive) {
|
|
102
|
+
else if (! (childAlive || reportWritten)) {
|
|
102
103
|
// Add the host to the array of crashed hosts.
|
|
103
104
|
crashHosts.push(id);
|
|
104
105
|
}
|
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -497,6 +497,9 @@ const matchElement = async (page, selector, matchText, index = 0) => {
|
|
|
497
497
|
const deSlash = string => string.endsWith('/') ? string.slice(0, -1) : string;
|
|
498
498
|
// Tries to visit a URL.
|
|
499
499
|
const goto = async (page, url, timeout, waitUntil, isStrict) => {
|
|
500
|
+
if (url.startsWith('file://.')) {
|
|
501
|
+
url = url.replace('file://', `file://${__dirname}/`);
|
|
502
|
+
}
|
|
500
503
|
const response = await page.goto(url, {
|
|
501
504
|
timeout,
|
|
502
505
|
waitUntil
|
package/tests/focInd.js
CHANGED
|
@@ -83,8 +83,21 @@ exports.reporter = async (page, revealAll, allowedDelay, withItems) => {
|
|
|
83
83
|
data.totals.total++;
|
|
84
84
|
// Get a live style declaration of its properties.
|
|
85
85
|
const styleDec = window.getComputedStyle(element);
|
|
86
|
-
//
|
|
87
|
-
const styleBlurred =
|
|
86
|
+
// Get the relevant style properties.
|
|
87
|
+
const styleBlurred = {};
|
|
88
|
+
[
|
|
89
|
+
'outlineWidth',
|
|
90
|
+
'outlineColor',
|
|
91
|
+
'borderWidth',
|
|
92
|
+
'boxShadow',
|
|
93
|
+
'fontSize',
|
|
94
|
+
'fontStyle',
|
|
95
|
+
'textDecorationLine',
|
|
96
|
+
'textDecorationStyle',
|
|
97
|
+
'textDecorationThickness'
|
|
98
|
+
].forEach(styleName => {
|
|
99
|
+
styleBlurred[styleName] = styleDec[styleName];
|
|
100
|
+
});
|
|
88
101
|
// Focus it, potentially changing the properties in its style declaration.
|
|
89
102
|
element.focus({preventScroll: true});
|
|
90
103
|
let hasOutline = false;
|