testaro 4.7.0 → 4.7.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/tests/focInd.js
CHANGED
|
@@ -121,20 +121,20 @@ exports.reporter = async (page, revealAll, allowedDelay, withItems) => {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
// If no outline
|
|
124
|
+
// If no allowed outline appeared:
|
|
125
125
|
if (! hasOutline) {
|
|
126
126
|
// Returns whether a style property differs between focused and not focused.
|
|
127
127
|
const diff = prop => styleDec[prop] !== styleBlurred[prop];
|
|
128
128
|
// Determine whether the element has another allowed focus indicator.
|
|
129
|
+
const hasDiffOutline = styleDec.outlineWidth !== '0px'
|
|
130
|
+
&& styleDec.outlineColor !== 'rgba(0, 0, 0, 0)'
|
|
131
|
+
&& (diff('outlineStyle') || diff('outlineWidth'));
|
|
132
|
+
const hasDiffBorder = styleDec.borderWidth !== '0px'
|
|
133
|
+
&& styleDec.borderColor !== 'rgba(0, 0, 0, 0)'
|
|
134
|
+
&& (diff('borderStyle') || diff('borderWidth'));
|
|
129
135
|
const hasIndicator
|
|
130
|
-
=
|
|
131
|
-
|
|
132
|
-
&& styleDec.borderWidth !== '0px'
|
|
133
|
-
|| (styleDec.borderStyle !== 'none' && diff('borderWidth'))
|
|
134
|
-
|| diff('outlineStyle')
|
|
135
|
-
&& styleBlurred.outlineWidth !== '0px'
|
|
136
|
-
&& styleDec.outlineWidth !== '0px'
|
|
137
|
-
|| (styleDec.outlineStyle !== 'none' && diff('outlineWidth'))
|
|
136
|
+
= hasDiffOutline
|
|
137
|
+
|| hasDiffBorder
|
|
138
138
|
|| diff('fontSize')
|
|
139
139
|
|| diff('fontStyle')
|
|
140
140
|
|| diff('textDecorationLine')
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
{
|
|
16
16
|
"type": "test",
|
|
17
17
|
"which": "focInd",
|
|
18
|
-
"what": "focus indication",
|
|
19
|
-
"withItems": false,
|
|
20
18
|
"revealAll": false,
|
|
19
|
+
"allowedDelay": 0,
|
|
20
|
+
"withItems": false,
|
|
21
|
+
"what": "focus indication",
|
|
21
22
|
"expect": [
|
|
22
23
|
["totals.total", "=", 4],
|
|
23
24
|
["totals.types.indicatorMissing.total", "=", 0],
|
|
@@ -36,14 +37,17 @@
|
|
|
36
37
|
{
|
|
37
38
|
"type": "test",
|
|
38
39
|
"which": "focInd",
|
|
39
|
-
"what": "focus indication",
|
|
40
|
-
"withItems": false,
|
|
41
40
|
"revealAll": false,
|
|
41
|
+
"allowedDelay": 150,
|
|
42
|
+
"withItems": true,
|
|
43
|
+
"what": "focus indication",
|
|
42
44
|
"expect": [
|
|
43
|
-
["totals.total", "=",
|
|
44
|
-
["totals.types.indicatorMissing.total", "=",
|
|
45
|
+
["totals.total", "=", 7],
|
|
46
|
+
["totals.types.indicatorMissing.total", "=", 2],
|
|
47
|
+
["totals.types.indicatorMissing.tagNames.A", "=", 1],
|
|
45
48
|
["totals.types.indicatorMissing.tagNames.INPUT", "=", 1],
|
|
46
|
-
["totals.types.nonOutlinePresent.total", "=",
|
|
49
|
+
["totals.types.nonOutlinePresent.total", "=", 2],
|
|
50
|
+
["totals.types.nonOutlinePresent.tagNames.A", "=", 1],
|
|
47
51
|
["totals.types.nonOutlinePresent.tagNames.BUTTON", "=", 1],
|
|
48
52
|
["totals.types.outlinePresent.total", "=", 3],
|
|
49
53
|
["totals.types.outlinePresent.tagNames.A", "=", 1],
|
|
@@ -6,26 +6,47 @@
|
|
|
6
6
|
<meta name="description" content="tester">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
8
|
<style>
|
|
9
|
-
|
|
10
|
-
outline: none;
|
|
11
|
-
}
|
|
12
|
-
input[type=checkbox]:focus {
|
|
9
|
+
#button:focus, #checkbox:focus {
|
|
13
10
|
outline: 3px blue solid;
|
|
14
11
|
outline-offset: 2px;
|
|
15
12
|
}
|
|
13
|
+
#slowLink:focus, #sluggishLink:focus {
|
|
14
|
+
border: 2px green solid;
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
#checkbox {
|
|
18
|
+
transition-property: outline;
|
|
19
|
+
transition-delay: 35ms;
|
|
20
|
+
transition-duration: 40ms;
|
|
21
|
+
}
|
|
22
|
+
#slowLink {
|
|
23
|
+
transition-property: border;
|
|
24
|
+
transition-delay: 125ms;
|
|
25
|
+
}
|
|
26
|
+
#sluggishLink {
|
|
27
|
+
transition-property: border;
|
|
28
|
+
transition-delay: 525ms;
|
|
29
|
+
}
|
|
16
30
|
#special:focus {
|
|
17
31
|
outline: none;
|
|
18
32
|
text-decoration-line: underline overline;
|
|
19
|
-
text-decoration-color:
|
|
33
|
+
text-decoration-color: darkorange;
|
|
34
|
+
}
|
|
35
|
+
#textInput:focus {
|
|
36
|
+
outline: none;
|
|
20
37
|
}
|
|
21
38
|
</style>
|
|
22
39
|
</head>
|
|
23
40
|
<body>
|
|
24
41
|
<main>
|
|
25
42
|
<h1>Page with mixed focus indication</h1>
|
|
26
|
-
<p>This paragraph contains a link to <a href="https://en.wikipedia.org">information</a>,
|
|
27
|
-
<p>This paragraph contains a
|
|
28
|
-
<p>This paragraph contains a
|
|
43
|
+
<p>This paragraph contains a link to <a href="https://en.wikipedia.org">English information</a>, which exhibits a default focus indicator.</p>
|
|
44
|
+
<p>This paragraph contains a <button id="button" type="button">button</button> with a custom outline as its focus indicator.</p>
|
|
45
|
+
<p>This paragraph contains a <label>text input <input id="textInput" type="text"></label> with the focus indicator suppressed.</p>
|
|
46
|
+
<p>This paragraph contains a checkbox with an enhanced focus-indication outline that finishes appearing 75 ms after the checkbox becomes focused. <label><input id="checkbox" type="checkbox"> I am a bad page.</label></p>
|
|
47
|
+
<p>This paragraph contains a link to <a id="slowLink" href="https://fr.wikipedia.org">French information</a> with a custom border as its only focus indicator. The border appears 125 ms after the link becomes focused.</p>
|
|
48
|
+
<p>This paragraph contains a link to <a id="sluggishLink" href="https://de.wikipedia.org">German information</a> with a custom border as its only focus indicator. The border appears 525 ms after the link becomes focused.</p>
|
|
49
|
+
<p>This paragraph contains a button with a focus indicator consisting solely of an underline and an overline. <button id="special" type="button">special button</button></p>
|
|
29
50
|
</main>
|
|
30
51
|
</body>
|
|
31
52
|
</html>
|