testaro 5.5.2 → 5.5.3
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 +1 -1
- package/run.js +3 -0
- package/tests/focInd.js +15 -2
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;
|