testaro 77.0.0 → 77.0.1
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/package.json
CHANGED
package/procs/launch.js
CHANGED
|
@@ -514,11 +514,11 @@ const launchOnce = async opts => {
|
|
|
514
514
|
}
|
|
515
515
|
// Base the wait on the need of the tool and the retry history.
|
|
516
516
|
let waitUntil = xPathNeed === 'none' ? 'domcontentloaded' : 'networkidle';
|
|
517
|
-
if (relaxWait
|
|
518
|
-
waitUntil = '
|
|
517
|
+
if (relaxWait === 'partly' && waitUntil === 'networkidle') {
|
|
518
|
+
waitUntil = 'load';
|
|
519
519
|
}
|
|
520
520
|
if (relaxWait === 'fully') {
|
|
521
|
-
waitUntil = '
|
|
521
|
+
waitUntil = 'domcontentloaded';
|
|
522
522
|
}
|
|
523
523
|
// Navigate to the specified URL and wait for the stability required by the next action.
|
|
524
524
|
const navResult = await goTo(report, page, url, 10000, waitUntil);
|
package/testaro/autocomplete.js
CHANGED
|
@@ -79,12 +79,18 @@ exports.reporter = async (
|
|
|
79
79
|
};
|
|
80
80
|
const selector = 'body input[type=text], body input[type=email], body input:not([type])';
|
|
81
81
|
const whats = 'Inputs are missing required autocomplete attributes';
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
// Each placeholder sits inside single quotes in getBadWhat (e.g. name: ['__nameLabels__']).
|
|
83
|
+
// Replace the quoted placeholder with the bracket-stripped JSON so the result is a proper
|
|
84
|
+
// element list (name: ["your name", ...]) rather than a one-element array holding the JSON
|
|
85
|
+
// text of the array (name: ['["your name", ...]']), which never matches an accessible name.
|
|
86
|
+
const placeHolders = Object.keys(labels).map(key => `'__${key}Labels__'`);
|
|
87
|
+
const replacers = Object.values(labels).map(value => JSON.stringify(value).slice(1, -1));
|
|
84
88
|
// Create a stringified getBadWhat, with placeholders replaced with the specified label arrays.
|
|
85
89
|
let getBadWhatString = getBadWhat.toString();
|
|
86
90
|
[0, 1, 2, 3].forEach(index => {
|
|
87
91
|
getBadWhatString = getBadWhatString.replace(placeHolders[index], replacers[index]);
|
|
88
92
|
});
|
|
89
|
-
return doTest(
|
|
93
|
+
return doTest(
|
|
94
|
+
page, report.catalog, withItems, 'autocomplete', selector, whats, 2, getBadWhatString
|
|
95
|
+
);
|
|
90
96
|
};
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
[
|
|
68
68
|
"standardResult.totals.2",
|
|
69
69
|
"=",
|
|
70
|
-
|
|
70
|
+
3
|
|
71
71
|
],
|
|
72
72
|
[
|
|
73
73
|
"standardResult.instances.1.what",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
[
|
|
121
121
|
"standardResult.totals.2",
|
|
122
122
|
"=",
|
|
123
|
-
|
|
123
|
+
3
|
|
124
124
|
],
|
|
125
125
|
[
|
|
126
126
|
"standardResult.instances.0.what",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
[
|
|
136
136
|
"standardResult.instances.0.count",
|
|
137
137
|
"=",
|
|
138
|
-
|
|
138
|
+
3
|
|
139
139
|
]
|
|
140
140
|
],
|
|
141
141
|
"rules": [
|