testaro 26.2.0 → 26.3.0

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.
@@ -117,6 +117,11 @@
117
117
  "standardResult.instances.0.what",
118
118
  "i",
119
119
  "Links have"
120
+ ],
121
+ [
122
+ "standardResult.instances.0.tagName",
123
+ "=",
124
+ "A"
120
125
  ]
121
126
  ],
122
127
  "rules": [
@@ -0,0 +1,172 @@
1
+ {
2
+ "id": "opFoc",
3
+ "what": "validation of opFoc test",
4
+ "strict": true,
5
+ "timeLimit": 20,
6
+ "acts": [
7
+ {
8
+ "type": "launch",
9
+ "which": "chromium",
10
+ "url": "file://validation/tests/targets/opFoc/good.html",
11
+ "what": "page with standard focusability and operability"
12
+ },
13
+ {
14
+ "type": "test",
15
+ "which": "testaro",
16
+ "withItems": true,
17
+ "stopOnFail": true,
18
+ "expect": [
19
+ [
20
+ "standardResult.totals.2",
21
+ "=",
22
+ 0
23
+ ],
24
+ [
25
+ "standardResult.totals.3",
26
+ "=",
27
+ 0
28
+ ],
29
+ [
30
+ "standardResult.instances.length",
31
+ "=",
32
+ 0
33
+ ]
34
+ ],
35
+ "rules": [
36
+ "y",
37
+ "opFoc"
38
+ ]
39
+ },
40
+ {
41
+ "type": "url",
42
+ "which": "file://validation/tests/targets/opFoc/bad.html",
43
+ "what": "page with deviant focusability and operability"
44
+ },
45
+ {
46
+ "type": "test",
47
+ "which": "testaro",
48
+ "withItems": true,
49
+ "stopOnFail": true,
50
+ "expect": [
51
+ [
52
+ "standardResult.totals.2",
53
+ "=",
54
+ 0
55
+ ],
56
+ [
57
+ "standardResult.totals.3",
58
+ "=",
59
+ 3
60
+ ],
61
+ [
62
+ "standardResult.instances.0.ruleID",
63
+ "=",
64
+ "opFoc"
65
+ ],
66
+ [
67
+ "standardResult.instances.0.what",
68
+ "i",
69
+ "Element is operable (tag name BUTTON)"
70
+ ],
71
+ [
72
+ "standardResult.instances.0.ordinalSeverity",
73
+ "=",
74
+ 3
75
+ ],
76
+ [
77
+ "standardResult.instances.0.tagName",
78
+ "=",
79
+ "BUTTON"
80
+ ],
81
+ [
82
+ "standardResult.instances.0.location.doc",
83
+ "=",
84
+ "dom"
85
+ ],
86
+ [
87
+ "standardResult.instances.0.location.type",
88
+ "=",
89
+ "box"
90
+ ],
91
+ [
92
+ "standardResult.instances.0.location.spec.width",
93
+ ">",
94
+ 0
95
+ ],
96
+ [
97
+ "standardResult.instances.0.excerpt",
98
+ "=",
99
+ "button"
100
+ ],
101
+ [
102
+ "standardResult.instances.1.tagName",
103
+ "=",
104
+ "SPAN"
105
+ ],
106
+ [
107
+ "standardResult.instances.2.what",
108
+ "i",
109
+ "Element is operable (pointer cursor)"
110
+ ]
111
+ ],
112
+ "rules": [
113
+ "y",
114
+ "opFoc"
115
+ ]
116
+ },
117
+ {
118
+ "type": "test",
119
+ "which": "testaro",
120
+ "withItems": false,
121
+ "stopOnFail": true,
122
+ "expect": [
123
+ [
124
+ "standardResult.totals.2",
125
+ "=",
126
+ 0
127
+ ],
128
+ [
129
+ "standardResult.totals.3",
130
+ "=",
131
+ 3
132
+ ],
133
+ [
134
+ "standardResult.totals.1",
135
+ "=",
136
+ 0
137
+ ],
138
+ [
139
+ "standardResult.instances.0.ruleID",
140
+ "=",
141
+ "opFoc"
142
+ ],
143
+ [
144
+ "standardResult.instances.0.what",
145
+ "i",
146
+ "Elements are operable but"
147
+ ],
148
+ [
149
+ "standardResult.instances.0.ordinalSeverity",
150
+ "=",
151
+ 3
152
+ ],
153
+ [
154
+ "standardResult.instances.0.count",
155
+ "=",
156
+ 3
157
+ ]
158
+ ],
159
+ "rules": [
160
+ "y",
161
+ "opFoc"
162
+ ]
163
+ }
164
+ ],
165
+ "sources": {
166
+ "script": "",
167
+ "host": {},
168
+ "requester": ""
169
+ },
170
+ "creationTime": "2013-05-28T12:00:00",
171
+ "timeStamp": "00000"
172
+ }
@@ -0,0 +1,130 @@
1
+ {
2
+ "id": "optRoleSel",
3
+ "what": "validation of optRoleSel test",
4
+ "strict": true,
5
+ "timeLimit": 20,
6
+ "acts": [
7
+ {
8
+ "type": "launch",
9
+ "which": "chromium",
10
+ "url": "file://validation/tests/targets/optRoleSel/index.html",
11
+ "what": "page with and without aria-select attributes on option-role elements"
12
+ },
13
+ {
14
+ "type": "test",
15
+ "which": "testaro",
16
+ "withItems": true,
17
+ "stopOnFail": true,
18
+ "expect": [
19
+ [
20
+ "standardResult.totals.1",
21
+ "=",
22
+ 1
23
+ ],
24
+ [
25
+ "standardResult.totals.0",
26
+ "=",
27
+ 0
28
+ ],
29
+ [
30
+ "standardResult.instances.0.ruleID",
31
+ "=",
32
+ "optRoleSel"
33
+ ],
34
+ [
35
+ "standardResult.instances.0.what",
36
+ "=",
37
+ "Element has an explicit option role but no aria-selected attribute"
38
+ ],
39
+ [
40
+ "standardResult.instances.0.ordinalSeverity",
41
+ "=",
42
+ 1
43
+ ],
44
+ [
45
+ "standardResult.instances.0.tagName",
46
+ "=",
47
+ "P"
48
+ ],
49
+ [
50
+ "standardResult.instances.0.location.doc",
51
+ "=",
52
+ "dom"
53
+ ],
54
+ [
55
+ "standardResult.instances.0.location.type",
56
+ "=",
57
+ "box"
58
+ ],
59
+ [
60
+ "standardResult.instances.0.location.spec.width",
61
+ ">",
62
+ 0
63
+ ],
64
+ [
65
+ "standardResult.instances.0.excerpt",
66
+ "=",
67
+ "Vegan"
68
+ ]
69
+ ],
70
+ "rules": [
71
+ "y",
72
+ "optRoleSel"
73
+ ]
74
+ },
75
+ {
76
+ "type": "test",
77
+ "which": "testaro",
78
+ "withItems": false,
79
+ "stopOnFail": true,
80
+ "expect": [
81
+ [
82
+ "standardResult.totals.1",
83
+ "=",
84
+ 1
85
+ ],
86
+ [
87
+ "standardResult.totals.2",
88
+ "=",
89
+ 0
90
+ ],
91
+ [
92
+ "standardResult.instances.length",
93
+ "=",
94
+ 1
95
+ ],
96
+ [
97
+ "standardResult.instances.0.ruleID",
98
+ "=",
99
+ "optRoleSel"
100
+ ],
101
+ [
102
+ "standardResult.instances.0.what",
103
+ "=",
104
+ "Elements with explicit option roles have no aria-selected attributes"
105
+ ],
106
+ [
107
+ "standardResult.instances.0.ordinalSeverity",
108
+ "=",
109
+ 1
110
+ ],
111
+ [
112
+ "standardResult.instances.0.count",
113
+ "=",
114
+ 1
115
+ ]
116
+ ],
117
+ "rules": [
118
+ "y",
119
+ "optRoleSel"
120
+ ]
121
+ }
122
+ ],
123
+ "sources": {
124
+ "script": "",
125
+ "host": {},
126
+ "requester": ""
127
+ },
128
+ "creationTime": "2013-05-28T12:00:00",
129
+ "timeStamp": "00000"
130
+ }
@@ -0,0 +1,145 @@
1
+ {
2
+ "id": "phOnly",
3
+ "what": "validation of phOnly test",
4
+ "strict": true,
5
+ "timeLimit": 20,
6
+ "acts": [
7
+ {
8
+ "type": "launch",
9
+ "which": "chromium",
10
+ "url": "file://validation/tests/targets/phOnly/index.html",
11
+ "what": "page with inputs with and without labels and placeholders"
12
+ },
13
+ {
14
+ "type": "test",
15
+ "which": "testaro",
16
+ "withItems": true,
17
+ "stopOnFail": true,
18
+ "expect": [
19
+ [
20
+ "standardResult.totals.2",
21
+ "=",
22
+ 2
23
+ ],
24
+ [
25
+ "standardResult.totals.0",
26
+ "=",
27
+ 0
28
+ ],
29
+ [
30
+ "standardResult.instances.0.ruleID",
31
+ "=",
32
+ "phOnly"
33
+ ],
34
+ [
35
+ "standardResult.instances.0.what",
36
+ "=",
37
+ "Element has a placeholder but no accessible name"
38
+ ],
39
+ [
40
+ "standardResult.instances.0.ordinalSeverity",
41
+ "=",
42
+ 2
43
+ ],
44
+ [
45
+ "standardResult.instances.0.tagName",
46
+ "=",
47
+ "INPUT"
48
+ ],
49
+ [
50
+ "standardResult.instances.0.location.doc",
51
+ "=",
52
+ "dom"
53
+ ],
54
+ [
55
+ "standardResult.instances.0.location.type",
56
+ "=",
57
+ "box"
58
+ ],
59
+ [
60
+ "standardResult.instances.0.location.spec.y",
61
+ ">",
62
+ 0
63
+ ],
64
+ [
65
+ "standardResult.instances.0.excerpt",
66
+ "i",
67
+ "river2"
68
+ ],
69
+ [
70
+ "standardResult.instances.1.tagName",
71
+ "=",
72
+ "INPUT"
73
+ ],
74
+ [
75
+ "standardResult.instances.1.excerpt",
76
+ "i",
77
+ "company2"
78
+ ]
79
+ ],
80
+ "rules": [
81
+ "y",
82
+ "phOnly"
83
+ ]
84
+ },
85
+ {
86
+ "type": "test",
87
+ "which": "testaro",
88
+ "withItems": false,
89
+ "stopOnFail": true,
90
+ "expect": [
91
+ [
92
+ "standardResult.totals.2",
93
+ "=",
94
+ 2
95
+ ],
96
+ [
97
+ "standardResult.totals.1",
98
+ "=",
99
+ 0
100
+ ],
101
+ [
102
+ "standardResult.instances.length",
103
+ "=",
104
+ 1
105
+ ],
106
+ [
107
+ "standardResult.instances.0.ruleID",
108
+ "=",
109
+ "phOnly"
110
+ ],
111
+ [
112
+ "standardResult.instances.0.what",
113
+ "=",
114
+ "input elements have placeholders but no accessible names"
115
+ ],
116
+ [
117
+ "standardResult.instances.0.ordinalSeverity",
118
+ "=",
119
+ 2
120
+ ],
121
+ [
122
+ "standardResult.instances.0.count",
123
+ "=",
124
+ 2
125
+ ],
126
+ [
127
+ "standardResult.instances.0.tagName",
128
+ "=",
129
+ "INPUT"
130
+ ]
131
+ ],
132
+ "rules": [
133
+ "y",
134
+ "phOnly"
135
+ ]
136
+ }
137
+ ],
138
+ "sources": {
139
+ "script": "",
140
+ "host": {},
141
+ "requester": ""
142
+ },
143
+ "creationTime": "2013-05-28T12:00:00",
144
+ "timeStamp": "00000"
145
+ }
@@ -0,0 +1,56 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Page with standard and nonstandard caption locations</title>
6
+ <meta name="description" content="tester">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <style>
9
+ table {
10
+ border-collapse: collapse;
11
+ }
12
+ td, th {
13
+ padding: 0.3rem;
14
+ border: 0.2rem black solid;
15
+ }
16
+ </style>
17
+ </head>
18
+ <body>
19
+ <main>
20
+ <h1>Page with standard and nonstandard caption locations</h1>
21
+ <h2>Standard table</h2>
22
+ <table>
23
+ <caption>Factory personnel</caption>
24
+ <thead>
25
+ <tr><th>Name</th><th>Department</th></tr>
26
+ </thead>
27
+ <tbody>
28
+ <tr><th>Amy</th><td>Accessibility</td></tr>
29
+ <tr><th>Abe</th><td>Marketing</td></tr>
30
+ </tbody>
31
+ </table>
32
+ <h2>Nonstandard table</h2>
33
+ <table>
34
+ <thead>
35
+ <tr><th>Name</th><th>Department</th></tr>
36
+ </thead>
37
+ <tbody>
38
+ <tr><th>Amy</th><td>Accessibility</td></tr>
39
+ <tr><th>Abe</th><td>Marketing</td></tr>
40
+ </tbody>
41
+ <caption>Office personnel</caption>
42
+ </table>
43
+ <h2>Headerless table with caption in the head</h2>
44
+ <table>
45
+ <thead>
46
+ <caption>Farm personnel</caption>
47
+ </thead>
48
+ <tbody>
49
+ <tr><td>Given name</td><td>Unit</td></tr>
50
+ <tr><td>Kim</td><td>Cattle</td></tr>
51
+ <tr><td>Ken</td><td>Grain</td></tr>
52
+ </tbody>
53
+ </table>
54
+ </main>
55
+ </body>
56
+ </html>
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Page with standard and nonstandard fieldset legends</title>
6
+ <meta name="description" content="tester">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ </head>
9
+ <body>
10
+ <main>
11
+ <h1>Page with standard and nonstandard fieldset legends</h1>
12
+ <form>
13
+ <p>The next fieldset has its legend in a standard location.</p>
14
+ <div><fieldset>
15
+ <legend>Choose a drink</legend>
16
+ <p><label><input type="radio" name="drink" value="water">water</label></p>
17
+ <p><label><input type="radio" name="drink" value="juice">juice</label></p>
18
+ </fieldset></div>
19
+ <div><fieldset>
20
+ <p>Defect 1: This fieldset has a nonstandard legend location.</p>
21
+ <legend>Choose a food</legend>
22
+ <p><label><input type="radio" name="food" value="rice">rice</label></p>
23
+ <p><label><input type="radio" name="food" value="apple">apple</label></p>
24
+ </fieldset></div>
25
+ <p>Defect 2: The next legend is not in a fieldset.</p>
26
+ <div>
27
+ <legend>Choose a gas</legend>
28
+ <p><label><input type="radio" name="gas" value="methane">methane</label></p>
29
+ <p><label><input type="radio" name="gas" value="nitrogen">nitrogen</label></p>
30
+ </div>
31
+ </form>
32
+ </main>
33
+ </body>
34
+ </html>
@@ -9,10 +9,10 @@
9
9
  <body>
10
10
  <main>
11
11
  <h1>Page with deviant focusability and operability</h1>
12
- <p>This paragraph contains a link to <a href="https://en.wikipedia.org">information</a>, a <button type="button" tabindex="-1">button</button>, and a <label>text input <input type="text"></label>. The button is not focusable.</p>
13
- <p>This paragraph contains a <span style="font-weight: bold" tabindex="0">focusable part</span> that is not operable.</p>
14
- <p>If you click <span id="clickable" style="color: red" onclick="document.getElementById('clickable').style.color = 'black'">this text</span>, it will turn black, but it is not focusable.</p>
15
- <p>This <span style="cursor: pointer">word</span> is not focusable, but its cursor makes you think it is operable.</p>
12
+ <p>This paragraph contains a link to <a href="https://en.wikipedia.org">information</a>, a <button type="button" tabindex="-1">button</button>, and a <label>text input <input type="text"></label>. Defect 1: The button is not focusable.</p>
13
+ <p>This paragraph contains a <span style="font-weight: bold" tabindex="0">focusable part</span> that is not operable. This test does not cover that defect.</p>
14
+ <p>Defect 2: If you click <span id="clickable" style="color: red" onclick="document.getElementById('clickable').style.color = 'black'">this text</span>, it will turn black, but it is not focusable.</p>
15
+ <p>Defect 3: This <span style="cursor: pointer">word</span> is not focusable, but its cursor makes you think it is operable.</p>
16
16
  </main>
17
17
  </body>
18
18
  </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Page with partly nonstandard option roles</title>
6
+ <meta name="description" content="tester">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ </head>
9
+ <body>
10
+ <main>
11
+ <h1>Page with partly nonstandard option roles</h1>
12
+ <h2>Dietary preference</h2>
13
+ <div
14
+ id="pseudoSelect"
15
+ role="listbox"
16
+ name="diet"
17
+ aria-label="Choose one dietary option"
18
+ onclick="Array.from(document.getElementById('pseudoSelect').children).forEach(p => {p.style.fontWeight=400}); event.target.style.fontWeight=700"
19
+ >
20
+ <p role="option" aria-selected="false">Carnivorous</p>
21
+ <p role="option" aria-selected="true">Vegetarian</p>
22
+ <p role="option">Vegan</p>
23
+ </div>
24
+ </main>
25
+ </body>
26
+ </html>
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Page with partly nonstandard labeling</title>
6
+ <meta name="description" content="tester">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ </head>
9
+ <body>
10
+ <main>
11
+ <h1>Page with partly nonstandard labeling</h1>
12
+ <h2>Inputs without placeholders</h2>
13
+ <h3>Input with explicit label</h3>
14
+ <label for="input1">Enter the name of a fruit</label>
15
+ <p><input size="30" maxlength="30" name="fruit"></p>
16
+ <h3>Input with implicit label</h3>
17
+ <p><label>
18
+ Enter the name of a tool
19
+ <input size="30" maxlength="30" name="tool">
20
+ </label></p>
21
+ <h3>Input with reference label</h3>
22
+ <p id="placeLabel">Enter the name of a place</p>
23
+ <p><input size="30" maxlength="30" name="place" aria-labelledby="placeLabel"></p>
24
+ <h3>Input with attribute label</h3>
25
+ <p><input size="30" maxlength="30" name="person" aria-label="Enter the name of a person"></p>
26
+ <h3>Input with a title and no label</h3>
27
+ <p><input size="30" maxlength="30" name="river1" title="Enter the name of a river"></p>
28
+ <h3>Input with no label</h3>
29
+ <p>Enter the name of a company</p>
30
+ <p><input size="30" maxlength="30" name="company1"></p>
31
+ <h2>Inputs with placeholders</h2>
32
+ <h3>Input with explicit label</h3>
33
+ <label for="input1">Enter the name of a fruit</label>
34
+ <p><input id="input1" size="30" maxlength="30" name="fruit" placeholder="fruit"></p>
35
+ <h3>Input with implicit label</h3>
36
+ <p><label>
37
+ Enter the name of a tool
38
+ <input size="30" maxlength="30" name="tool" placeholder="tool">
39
+ </label></p>
40
+ <h3>Input with reference label</h3>
41
+ <p id="placeLabel">Enter the name of a place</p>
42
+ <p><input size="30" maxlength="30" name="place" aria-labelledby="placeLabel" placeholder="place"></p>
43
+ <h3>Input with attribute label</h3>
44
+ <p><input size="30" maxlength="30" name="person" aria-label="Enter the name of a person" placeholder="person"></p>
45
+ <h3>Input with a title and no label</h3>
46
+ <p><input size="30" maxlength="30" name="river2" title="Enter the name of a river" placeholder="river"></p>
47
+ <h3>Input with no label</h3>
48
+ <p>Enter the name of a company</p>
49
+ <p><input size="30" maxlength="30" name="company2" placeholder="company"></p>
50
+ <p>The last two inputs violate the phOnly rule.</p>
51
+ </main>
52
+ </body>
53
+ </html>
package/testaro/hr.js DELETED
@@ -1,26 +0,0 @@
1
- /*
2
- hr
3
- Related to ASLint test horizontal-rule.
4
- This test reports the existence of hr elements. Their semantics are inconsistently defined and
5
- interpreted and impair accessibility compared with stylistic segmentation.
6
- */
7
-
8
- // ########## IMPORTS
9
-
10
- // Module to perform common operations.
11
- const {init, report} = require('../procs/testaro');
12
-
13
- // ########## FUNCTIONS
14
-
15
- // Runs the test and returns the result.
16
- exports.reporter = async (page, withItems) => {
17
- // Initialize the locators and result.
18
- const all = await init(page, 'body hr');
19
- all.locs = all.allLocs;
20
- // Populate and return the result.
21
- const whats = [
22
- 'Element instead of styling is used for vertical segmentation',
23
- 'Elements instead of styling are used for vertical segmentation'
24
- ];
25
- return await report(withItems, all, 'hr', whats, 0, 'HR');
26
- };