testaro 13.0.2 → 14.0.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.
- package/README.md +190 -94
- package/actSpecs.js +17 -158
- package/package.json +1 -1
- package/run.js +30 -30
- package/standardize.js +338 -0
- package/{tests → testaro}/allHidden.js +36 -1
- package/{tests → testaro}/attVal.js +36 -2
- package/{tests → testaro}/autocomplete.js +34 -1
- package/{tests → testaro}/bulk.js +15 -1
- package/{tests → testaro}/docType.js +15 -1
- package/{tests → testaro}/dupAtt.js +34 -1
- package/{tests → testaro}/elements.js +9 -3
- package/testaro/embAc.js +78 -0
- package/{tests → testaro}/filter.js +35 -1
- package/{tests → testaro}/focAll.js +20 -3
- package/{tests → testaro}/focInd.js +45 -3
- package/{tests → testaro}/focOp.js +61 -2
- package/{tests → testaro}/focVis.js +35 -1
- package/{tests → testaro}/hover.js +67 -5
- package/{tests → testaro}/labClash.js +54 -4
- package/{tests → testaro}/linkTo.js +33 -1
- package/{tests → testaro}/linkUl.js +43 -5
- package/{tests → testaro}/menuNav.js +42 -1
- package/{tests → testaro}/miniText.js +32 -1
- package/{tests → testaro}/motion.js +27 -4
- package/{tests → testaro}/nonTable.js +32 -1
- package/{tests → testaro}/radioSet.js +33 -2
- package/{tests → testaro}/role.js +38 -1
- package/{tests → testaro}/styleDiff.js +43 -2
- package/{tests → testaro}/tabNav.js +42 -1
- package/{tests → testaro}/textNodes.js +6 -2
- package/{tests → testaro}/title.js +8 -4
- package/{tests → testaro}/titledEl.js +32 -1
- package/{tests → testaro}/zIndex.js +40 -2
- package/tests/alfa.js +72 -75
- package/tests/continuum.js +6 -2
- package/tests/ibm.js +14 -42
- package/tests/testaro.js +73 -0
- package/validation/tests/jobs/allHidden.json +877 -174
- package/validation/tests/jobs/attVal.json +57 -19
- package/validation/tests/jobs/autocomplete.json +34 -8
- package/validation/tests/jobs/bulk.json +33 -7
- package/validation/tests/jobs/docType.json +23 -5
- package/validation/tests/jobs/dupAtt.json +47 -8
- package/validation/tests/jobs/elements.json +231 -70
- package/validation/tests/jobs/embAc.json +70 -15
- package/validation/tests/jobs/filter.json +56 -12
- package/validation/tests/jobs/focAll.json +64 -16
- package/validation/tests/jobs/focInd.json +107 -23
- package/validation/tests/jobs/focOp.json +93 -21
- package/validation/tests/jobs/focVis.json +16 -4
- package/validation/tests/jobs/hover.json +246 -56
- package/validation/tests/jobs/labClash.json +43 -11
- package/validation/tests/jobs/linkTo.json +16 -4
- package/validation/tests/jobs/linkUl.json +79 -19
- package/validation/tests/jobs/menuNav.json +313 -65
- package/validation/tests/jobs/miniText.json +21 -5
- package/validation/tests/jobs/motion.json +81 -23
- package/validation/tests/jobs/nonTable.json +26 -6
- package/validation/tests/jobs/radioSet.json +43 -11
- package/validation/tests/jobs/role.json +93 -19
- package/validation/tests/jobs/styleDiff.json +124 -28
- package/validation/tests/jobs/tabNav.json +313 -65
- package/validation/tests/jobs/textNodes.json +190 -49
- package/validation/tests/jobs/title.json +23 -5
- package/validation/tests/jobs/titledEl.json +26 -6
- package/validation/tests/jobs/zIndex.json +28 -8
- package/validation/tests/old/allHidden.json +314 -0
- package/validation/tests/old/attVal.json +60 -0
- package/validation/tests/old/autocomplete.json +51 -0
- package/validation/tests/old/bulk.json +48 -0
- package/validation/tests/old/docType.json +46 -0
- package/validation/tests/old/dupAtt.json +51 -0
- package/validation/tests/old/elements.json +140 -0
- package/validation/tests/old/embAc.json +54 -0
- package/validation/tests/old/filter.json +55 -0
- package/validation/tests/old/focAll.json +68 -0
- package/validation/tests/old/focInd.json +69 -0
- package/validation/tests/old/focOp.json +62 -0
- package/validation/tests/old/focVis.json +35 -0
- package/validation/tests/old/hover.json +118 -0
- package/validation/tests/old/labClash.json +52 -0
- package/validation/tests/old/linkTo.json +35 -0
- package/validation/tests/old/linkUl.json +71 -0
- package/validation/tests/old/menuNav.json +106 -0
- package/validation/tests/old/miniText.json +36 -0
- package/validation/tests/old/motion.json +62 -0
- package/validation/tests/old/nonTable.json +37 -0
- package/validation/tests/old/radioSet.json +52 -0
- package/validation/tests/old/role.json +60 -0
- package/validation/tests/old/styleDiff.json +71 -0
- package/validation/tests/old/tabNav.json +106 -0
- package/validation/tests/old/temp.js +28 -0
- package/validation/tests/old/textNodes.json +98 -0
- package/validation/tests/old/title.json +46 -0
- package/validation/tests/old/titledEl.json +37 -0
- package/validation/tests/old/zIndex.json +49 -0
- package/validation/tests/targets/attVal/good.html +1 -1
- package/validation/tests/targets/elements/index.html +1 -0
- package/tests/embAc.js +0 -36
package/README.md
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
# testaro
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ensemble testing for web accessibility
|
|
4
4
|
|
|
5
5
|
## Summary
|
|
6
6
|
|
|
7
7
|
Testaro is a collection of web accessibility testing tools.
|
|
8
8
|
|
|
9
|
-
The purpose of Testaro is to provide programmatic access to accessibility tests defined by several tools
|
|
9
|
+
The purpose of Testaro is to provide programmatic access to accessibility tests defined by several tools.
|
|
10
10
|
|
|
11
11
|
Testaro launches and controls web browsers, performing operations, conducting tests, and recording results.
|
|
12
12
|
|
|
13
|
-
Testaro is designed to be a workstation-based agent
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Testaro is designed to be a workstation-based agent, because many of the tests performed by Testaro simulate the use of a web browser on a workstation. Testaro can be installed under MacOS, Windows, or potentially Ubuntu Linux.
|
|
14
|
+
|
|
15
|
+
Testaro accepts _jobs_, performs them, and returns _reports_.
|
|
16
|
+
|
|
17
|
+
Other software, located on any server or on the same workstation, can make use of Testaro, performing functions such as:
|
|
18
|
+
- Job preparation
|
|
19
|
+
- Converting user specifications into jobs
|
|
20
|
+
- Job scheduling
|
|
21
|
+
- Monitoring of the health of Testaro
|
|
16
22
|
- Management of clusters of workstations sharing workloads
|
|
17
23
|
- Allocation of responsibilities among workstations
|
|
18
|
-
- Receiving and fulfilling requests from users for
|
|
19
|
-
- Converting user specifications into instructions for workstations
|
|
24
|
+
- Receiving and fulfilling requests from users for jobs
|
|
20
25
|
- Allocating testing responsibilities to human testers
|
|
21
26
|
- Combining reports from workstations and human testers
|
|
22
27
|
- Analyzing and summarizing (e.g., computing scores on the basis of) test results
|
|
23
28
|
- Sending notifications
|
|
24
|
-
-
|
|
29
|
+
- Revising, combining, and publishing reports
|
|
25
30
|
|
|
26
31
|
One software product that performs some such functions is [Testilo](https://www.npmjs.com/package/testilo).
|
|
27
32
|
|
|
@@ -31,9 +36,7 @@ Testaro uses:
|
|
|
31
36
|
- [Playwright](https://playwright.dev/) to launch browsers, perform user actions in them, and perform tests
|
|
32
37
|
- [pixelmatch](https://www.npmjs.com/package/pixelmatch) to measure motion
|
|
33
38
|
|
|
34
|
-
Testaro
|
|
35
|
-
|
|
36
|
-
In addition, Testaro performs tests of these tools:
|
|
39
|
+
Testaro performs tests of these tools:
|
|
37
40
|
- [accessibility-checker](https://www.npmjs.com/package/accessibility-checker) (IBM)
|
|
38
41
|
- [alfa](https://alfa.siteimprove.com/) (Siteimprove)
|
|
39
42
|
- [axe-playwright](https://www.npmjs.com/package/axe-playwright) (Deque)
|
|
@@ -42,8 +45,11 @@ In addition, Testaro performs tests of these tools:
|
|
|
42
45
|
- [Nu Html Checker](https://github.com/validator/validator) (World Wide Web Consortium)
|
|
43
46
|
- [QualWeb core](https://www.npmjs.com/package/@qualweb/core) (University of Lisbon)
|
|
44
47
|
- [Tenon](https://tenon.io/documentation/what-tenon-tests.php) (Tenon)
|
|
48
|
+
- [Testaro](https://www.npmjs.com/package/testaro) (Testaro)
|
|
45
49
|
- [WAVE API](https://wave.webaim.org/api/) (WebAIM)
|
|
46
50
|
|
|
51
|
+
The [BBC Accessibility Standards Checker](https://github.com/bbc/bbc-a11y) is not a formal dependency, but some of the tests in the Testaro tool are adaptations of tests of that tool.
|
|
52
|
+
|
|
47
53
|
As of this version, the counts of tests of the tools referenced above were:
|
|
48
54
|
- Alfa: 103
|
|
49
55
|
- Axe-core: 138
|
|
@@ -62,8 +68,8 @@ Of the 29 Testaro tests, 26 are evaluative (they discover accessibility issues),
|
|
|
62
68
|
## Quasi-tests
|
|
63
69
|
|
|
64
70
|
Reports produced by Testaro contain data in addition to the results of these tests. Such data can be used like tests. In particular, the data include:
|
|
65
|
-
- Latency (how long a time each
|
|
66
|
-
- Test prevention (the failure of
|
|
71
|
+
- Latency (how long a time each tool takes to run its tests)
|
|
72
|
+
- Test prevention (the failure of tools to run on particular targets)
|
|
67
73
|
- Logging (browser messaging, including about document errors, during testing)
|
|
68
74
|
|
|
69
75
|
## Code organization
|
|
@@ -72,7 +78,7 @@ The main directories containing code files are:
|
|
|
72
78
|
- package root: main code files
|
|
73
79
|
- `tests`: files containing the code defining particular tests
|
|
74
80
|
- `procs`: shared procedures
|
|
75
|
-
- `validation`: code and artifacts for the validation of Testaro
|
|
81
|
+
- `validation`: code and artifacts for the validation of the Testaro tool
|
|
76
82
|
|
|
77
83
|
## System requirements
|
|
78
84
|
|
|
@@ -104,18 +110,14 @@ Once you have done that, you can install Testaro as you would install any `npm`
|
|
|
104
110
|
|
|
105
111
|
However, if the Playwright dependency is ever updated to a newer version, you must also reinstall its browsers by executing the statement `npx playwright install`.
|
|
106
112
|
|
|
113
|
+
To run Testaro after installation, provide the environment variables described below under “Environment variables”.
|
|
114
|
+
|
|
107
115
|
## Payment
|
|
108
116
|
|
|
109
117
|
All of the tests that Testaro can perform are free of cost, except those performed by the Tenon and WAVE tools. The owner of each of those tools gives new registrants a free allowance of credits before it becomes necessary to pay for use of the API of the tool. The required environment variables for authentication and payment are described below under “Environment variables”.
|
|
110
118
|
|
|
111
119
|
## Process objects
|
|
112
120
|
|
|
113
|
-
### Introduction
|
|
114
|
-
|
|
115
|
-
A _job_ is an object containing instructions for Testaro.
|
|
116
|
-
|
|
117
|
-
A _report_ is a job with properties added by Testaro, describing the results.
|
|
118
|
-
|
|
119
121
|
### Jobs
|
|
120
122
|
|
|
121
123
|
Here is an example of a job:
|
|
@@ -123,7 +125,7 @@ Here is an example of a job:
|
|
|
123
125
|
```javascript
|
|
124
126
|
{
|
|
125
127
|
id: 'be76p-ts25-w3c',
|
|
126
|
-
what: 'Test
|
|
128
|
+
what: 'Test W3C with 2 alfa rules',
|
|
127
129
|
strict: true,
|
|
128
130
|
timeLimit: 65,
|
|
129
131
|
acts: [
|
|
@@ -141,7 +143,8 @@ Here is an example of a job:
|
|
|
141
143
|
{
|
|
142
144
|
type: 'test',
|
|
143
145
|
which: 'alfa',
|
|
144
|
-
what: 'Siteimprove alfa tool'
|
|
146
|
+
what: 'Siteimprove alfa tool',
|
|
147
|
+
rules: ['y', 'r25', 'r71']
|
|
145
148
|
}
|
|
146
149
|
],
|
|
147
150
|
sources: {
|
|
@@ -158,30 +161,103 @@ Here is an example of a job:
|
|
|
158
161
|
}
|
|
159
162
|
```
|
|
160
163
|
|
|
161
|
-
This job contains three
|
|
164
|
+
This job contains three _acts_, telling Testaro to:
|
|
162
165
|
1. open a page in the Chromium browser
|
|
163
166
|
1. navigate to a specified URL
|
|
164
|
-
1. perform the tests of the `alfa` tool on that URL
|
|
167
|
+
1. perform two of the tests of the `alfa` tool (the tests for rules `r25` and `r71`) on that URL
|
|
165
168
|
|
|
166
169
|
Job properties:
|
|
167
|
-
- `id`:
|
|
168
|
-
- `what`:
|
|
169
|
-
- `strict`:
|
|
170
|
-
- `timeLimit`:
|
|
171
|
-
- `acts`:
|
|
172
|
-
- `sources`:
|
|
173
|
-
- `script
|
|
174
|
-
- `batch
|
|
175
|
-
- `target
|
|
176
|
-
- `requester
|
|
177
|
-
- `creationTime`:
|
|
178
|
-
- `timeStamp`:
|
|
170
|
+
- `id`: a string uniquely identifying the job.
|
|
171
|
+
- `what`: a description of the job.
|
|
172
|
+
- `strict`: `true` or `false`, indicating whether _substantive redirections_ should be treated as failures. These are redirections that do more than add or subtract a final slash.
|
|
173
|
+
- `timeLimit`: the number of seconds allowed for the execution of the job.
|
|
174
|
+
- `acts`: an array of the acts to be performed (documented below).
|
|
175
|
+
- `sources`: an object describing where the job came from:
|
|
176
|
+
- `script` (optional): the ID of the script from which the job was made.
|
|
177
|
+
- `batch` (optional): a set of targets (URLs) from which the target of this job was drawn.
|
|
178
|
+
- `target` (optional): an object describing the target being tested by this job.
|
|
179
|
+
- `requester` (optional): the email address that should receive a notice of completion of the job.
|
|
180
|
+
- `creationTime`: the time when the job was created.
|
|
181
|
+
- `timeStamp`: a string unique to this job.
|
|
179
182
|
|
|
180
183
|
### Reports
|
|
181
184
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
#### Introduction
|
|
186
|
+
|
|
187
|
+
While each tool produces a _tool report_ of the results of its tests, Testaro also produces a _job report_, combining all of the tool reports of a job.
|
|
188
|
+
- Tools append their reports to their acts in a job. For example, if one act in a job specifies some Continuum tests to be run, Continuum appends its report to that act. In that way, the act now describes not only the Continuum tests that were run, but also the results of those tests.
|
|
189
|
+
- Testaro further elaborates a job by reporting comprehensive results there. Testaro can add more facts to each of the tool reports and also adds whole-job facts, in a `jobData` property, to the job. Testaro thereby converts the job to a job report.
|
|
190
|
+
|
|
191
|
+
#### Formats
|
|
192
|
+
|
|
193
|
+
##### Tool formats
|
|
194
|
+
|
|
195
|
+
The tools listed above as dependencies write their tool reports in various formats. They differ in how they organize multiple instances of the same issue, how they classify issue severity and certainty, how they point to the locations of issue instances, how they name issues, etc.
|
|
196
|
+
|
|
197
|
+
Integrating reports from 10 different tools is a complex task, as analyzed in [“Accessibility Metatesting”](https://arxiv.org/abs/2304.07591). The diversity of their reporting formats makes the task more complex than it would otherwise be.
|
|
198
|
+
|
|
199
|
+
##### Standard format
|
|
200
|
+
|
|
201
|
+
Testaro helps overcome this format diversity by offering to represent the main facts in the report of each tool in a single standardized format.
|
|
202
|
+
|
|
203
|
+
If the `STANDARD` environment variable has the value `also` (which it has by default) or `only`, Testaro converts some data in each tool report to a standard format. That permits you to ignore the format idiosyncrasies of the tools. If `STANDARD` has the value `also`, the job report includes both formats. If the value is `only`, the job report includes only the standard format. If the value is `no`, the job report includes only the original format of each tool.
|
|
204
|
+
|
|
205
|
+
The standard format of each tool report has two properties:
|
|
206
|
+
- `totals`: an array of 4 integers, representing the counts of issue instances classified by the tool into 4 ordinal degrees of severity. For example, `[2, 13, 0, 5]` would mean that the tool reported 2 instances at the lowest severity, 13 at the next-lowest, none at the third-lowest, and 5 at the highest.
|
|
207
|
+
- `instances`: an array of objects describing facts about issue instances reported by the tool. Insofar as each tool permits, this object has these properties:
|
|
208
|
+
- `issueID`: a code identifying the issue
|
|
209
|
+
- `what`: a description of the issue
|
|
210
|
+
- `ordinalSeverity`: how the tool ranks the severity of the instance, on a 4-point ordinal scale
|
|
211
|
+
- `location`: an object with three properties:
|
|
212
|
+
- `doc`: whether the source (`source`) or the browser rendition (`dom`) was tested
|
|
213
|
+
- `type`: the type of location information provided by the tool (`line`, `selector`, or `xpath`)
|
|
214
|
+
- `spec`: the location information
|
|
215
|
+
- `excerpt`: some or all of the code
|
|
216
|
+
|
|
217
|
+
The original result of a test act is recorded as the value of a `result` property of the act. The standard-format result is recorded as the value of the `standardResult` property of the act. Its format is shown by this example:
|
|
218
|
+
|
|
219
|
+
``` javascript
|
|
220
|
+
standardResult: {
|
|
221
|
+
totals: [2, 0, 1],
|
|
222
|
+
instances: [
|
|
223
|
+
{
|
|
224
|
+
issueID: 'rule01',
|
|
225
|
+
what: 'button type invalid',
|
|
226
|
+
ordinalSeverity: 0,
|
|
227
|
+
location: {
|
|
228
|
+
doc: 'dom',
|
|
229
|
+
type: 'line',
|
|
230
|
+
spec: 32
|
|
231
|
+
},
|
|
232
|
+
excerpt: '<button type="link"></button>'
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
issueID: 'rule01',
|
|
236
|
+
what: 'button type invalid',
|
|
237
|
+
ordinalSeverity: 1,
|
|
238
|
+
location: {
|
|
239
|
+
doc: 'dom',
|
|
240
|
+
type: 'line',
|
|
241
|
+
spec: 145
|
|
242
|
+
},
|
|
243
|
+
excerpt: '<button type="important">Submit</button>'
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
issueID: 'rule02',
|
|
247
|
+
what: 'link href empty',
|
|
248
|
+
ordinalSeverity: 3,
|
|
249
|
+
location: {
|
|
250
|
+
doc: 'dom',
|
|
251
|
+
type: 'selector',
|
|
252
|
+
spec: '#helplink'
|
|
253
|
+
},
|
|
254
|
+
excerpt: '<a id="helplink" href>help</a>'
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
If a tool has the option to be used without itemization and is being so used, the `instances` array will be empty.
|
|
185
261
|
|
|
186
262
|
### Acts
|
|
187
263
|
|
|
@@ -264,13 +340,13 @@ This act causes Testaro to alter the `display` and `visibility` style properties
|
|
|
264
340
|
|
|
265
341
|
An act of type `test` performs operations and reports a result. The result may indicate that a page passes or fails requirements. Typically, accessibility tests report successes and failures. But a test in Testaro is defined less restrictively, so it can report any result. As one example, the Testaro `elements` test reports facts about certain elements on a page, without asserting that those facts are successes or failures.
|
|
266
342
|
|
|
267
|
-
The `which` property of a `test` act identifies the operations to perform.
|
|
343
|
+
The `which` property of a `test` act identifies the operations to perform. The value of `which` is the name of one of the tools, such as `alfa`.
|
|
268
344
|
|
|
269
345
|
###### Configuration
|
|
270
346
|
|
|
271
347
|
Every test in Testaro must have:
|
|
272
348
|
- a property in the `tests` object defined in the `run.js` file, where the property name is the name of the test and the value is a description of the test
|
|
273
|
-
- a `.js` file, defining the
|
|
349
|
+
- a `.js` file, defining the operation of the tool, in the `tests` directory, whose name base is the name of the tool
|
|
274
350
|
|
|
275
351
|
The `actSpecs.js` file (described in detail below) contains a specification for any `test` act, namely:
|
|
276
352
|
|
|
@@ -284,13 +360,13 @@ test: [
|
|
|
284
360
|
],
|
|
285
361
|
```
|
|
286
362
|
|
|
287
|
-
That means that a test (i.e. an act with a `type` property having the value `'test'`) must have a string-valued `which` property naming a
|
|
363
|
+
That means that a test act (i.e. an act with a `type` property having the value `'test'`) must have a string-valued `which` property naming a tool and may optionally have a string-valued `what` property describing the tool.
|
|
288
364
|
|
|
289
|
-
If a particular test either must have or may have any other properties, those properties
|
|
365
|
+
If a particular test act either must have or may have any other properties, those properties are specified in the `tests` property in `actSpecs.js`.
|
|
290
366
|
|
|
291
367
|
###### Examples
|
|
292
368
|
|
|
293
|
-
An example of a `test` act
|
|
369
|
+
An example of a `test` act is:
|
|
294
370
|
|
|
295
371
|
```json
|
|
296
372
|
{
|
|
@@ -301,26 +377,80 @@ An example of a `test` act invoking a **tool** is:
|
|
|
301
377
|
}
|
|
302
378
|
```
|
|
303
379
|
|
|
304
|
-
In this
|
|
380
|
+
Most tools allow you to decide which of their _rules_ to apply. In effect, this means deciding which of their tests to run, since each test is considered a test of some rule. The act example given above,
|
|
305
381
|
|
|
306
|
-
|
|
382
|
+
```javaScript
|
|
383
|
+
{
|
|
384
|
+
type: 'test',
|
|
385
|
+
which: 'alfa',
|
|
386
|
+
what: 'Siteimprove alfa tool',
|
|
387
|
+
rules: ['y', 'r25', 'r71']
|
|
388
|
+
}
|
|
389
|
+
```
|
|
307
390
|
|
|
308
|
-
|
|
391
|
+
specifies that the tests for rules `r25` and `r71` of the `alfa` tool are to be run. If the `'y'` in the `rules` array were e`'n'` instead, the act would specify that all the tests of the `alfa` tool **except** those for rules `r25` and `r71` are to be run.
|
|
392
|
+
|
|
393
|
+
One of the tools that allows rule selection, Testaro, has some rules that take additional arguments. As prescribed in `actSpecs.js`, you can pass such additional arguments to the `reporter` functions of those Testaro tests with an `args` property. Example:
|
|
394
|
+
|
|
395
|
+
```javaScript
|
|
309
396
|
{
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
397
|
+
type: 'test',
|
|
398
|
+
which: 'testaro',
|
|
399
|
+
what: 'Testaro tool',
|
|
400
|
+
rules: ['y', 'hover', 'focInd'],
|
|
401
|
+
args: {
|
|
402
|
+
hover: [20],
|
|
403
|
+
focInd: [false, 300]
|
|
404
|
+
}
|
|
316
405
|
}
|
|
317
406
|
```
|
|
318
407
|
|
|
319
|
-
|
|
408
|
+
This act specifies that the Testaro tests `hover` is to be run with the additional argument `20`, and `focInd` with the additional arguments `false` and `300`.
|
|
409
|
+
|
|
410
|
+
###### Expectations
|
|
411
|
+
|
|
412
|
+
Any `test` act can contain an `expect` property. If it does, the value of that property must be an array of arrays. Each array specifies expectations about the results of the operation of the tool.
|
|
413
|
+
|
|
414
|
+
For example, a `test` act might have this `expect` property:
|
|
415
|
+
|
|
416
|
+
```javaScript
|
|
417
|
+
'expect': [
|
|
418
|
+
['total.links', '=', 5],
|
|
419
|
+
['total.links.underlined', '<', 6],
|
|
420
|
+
['total.links.outlined'],
|
|
421
|
+
['docLang', '!', 'es-ES'],
|
|
422
|
+
['items.3.tagName', '=', 'BUTTON']
|
|
423
|
+
]
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
That would state the expectations that the `result` property of the act will have:
|
|
427
|
+
- a `total.links` property with the value 5
|
|
428
|
+
- a `total.links.underlined` property with a value less than 6
|
|
429
|
+
- **no** `total.links.outlined` property
|
|
430
|
+
- a `docLang` property with a value different from `es-ES`
|
|
431
|
+
- an `items[3].tagName` property with the value `'BUTTON'`
|
|
432
|
+
|
|
433
|
+
The first item in each array is an identifier of a property within the `result` object. The item has the format of a string with `.` delimiters. Each `.`-delimited segment its the name of the next property in the hierarchy. If the current object is an array, the next segment must be a non-negative integer, representing the index of an element of the array.
|
|
434
|
+
|
|
435
|
+
If there is only 1 item in an array, it states the expectation that the specified property does not exist. Otherwise, there are 3 items in the array.
|
|
436
|
+
|
|
437
|
+
The second item in each array, if there are 3 items, is an operator, drawn from:
|
|
438
|
+
- `<`: less than
|
|
439
|
+
- `=`: equal to
|
|
440
|
+
- `>`: greater than
|
|
441
|
+
- `!`: unequal to
|
|
442
|
+
- `i`: includes
|
|
443
|
+
- `e`: equivalent to (parsed identically as JSON)
|
|
444
|
+
|
|
445
|
+
The third item in each array, if there are 3 items in the array, is the criterion with which the value of the first property is compared.
|
|
446
|
+
|
|
447
|
+
A typical use for an `expect` property is checking the correctness of a Testaro test. Thus, the validation jobs in the `validation/tests/jobs` directory all contain `test` acts with `expect` properties. See the “Validation” section below.
|
|
448
|
+
|
|
449
|
+
When a `test` act has an `expect` property, the result for that act has an `expectations` property reporting whether the expectations were satisfied. The value of `expectations` is an array of objects, one object per expectation. Each object includes a `property` property identifying the expectation, and a `passed` property with `true` or `false` value reporting whether the expectation was satisfied. If applicable, it also has other properties identifying what was expected and what was actually reported.
|
|
320
450
|
|
|
321
451
|
###### Continuum
|
|
322
452
|
|
|
323
|
-
The `continuum` tests makes use of the files in the `continuum` directory. The
|
|
453
|
+
The `continuum` tests makes use of the files in the `continuum` directory. The tool inserts the contents of all three files into the page as scripts and then uses them to perform the tests.
|
|
324
454
|
|
|
325
455
|
Level Access on 22 August 2022 granted authorization for the copying of the `AccessEngine.community.js` file insofar as necessary for allowing Continuum community edition tests to be included in Testaro.
|
|
326
456
|
|
|
@@ -347,11 +477,9 @@ results.label = results.label.replace(/:/g, '-');
|
|
|
347
477
|
|
|
348
478
|
These changes were proposed as pull requests 1333 and 1334 (https://github.com/IBMa/equal-access/pulls).
|
|
349
479
|
|
|
350
|
-
If you choose to invoke the `ibm` tests with the `withNewContent` property specified, you will choose whether the tested content is the content of the existing page or is retrieved anew with the document URL. Typically, both methods succeed and deliver similar results. However, sometimes one method succeeds and the other fails, or one method reports more violations than the other does. In those cases, most often the success, or the larger violation count, arises from the existing page (`withNewContent: false`).
|
|
351
|
-
|
|
352
480
|
###### HTML CodeSniffer
|
|
353
481
|
|
|
354
|
-
The `htmlcs`
|
|
482
|
+
The `htmlcs` tool makes use of the `htmlcs/HTMLCS.js` file. That file was created, and can be recreated if necessary, as follows:
|
|
355
483
|
|
|
356
484
|
1. Clone the [HTML CodeSniffer package](https://github.com/squizlabs/HTML_CodeSniffer).
|
|
357
485
|
1. Make that package’s directory the active directory.
|
|
@@ -383,7 +511,7 @@ The changes in `htmlcs/HTMLCS.js` are:
|
|
|
383
511
|
|
|
384
512
|
###### QualWeb
|
|
385
513
|
|
|
386
|
-
|
|
514
|
+
The `qualWeb` tool performs the ACT rules, WCAG Techniques, and best-practices tests of QualWeb. Only failures and warnings are included in the report. The EARL report of QualWeb is not generated, because it is equivalent to the report of the ACT rules tests.
|
|
387
515
|
|
|
388
516
|
###### Tenon
|
|
389
517
|
|
|
@@ -413,7 +541,7 @@ Example:
|
|
|
413
541
|
}
|
|
414
542
|
```
|
|
415
543
|
|
|
416
|
-
The reason
|
|
544
|
+
The reason is that the Tenon API operates asynchronously. You ask it to perform a test, and it puts your request into a queue. To learn whether Tenon has completed your test, you make a status request. You can continue making status requests until Tenon replies that your test has been completed. Then you submit a request for the test result, and Tenon replies with the result. (As of May 2022, however, status requests were observed to misreport still-running tests as completed. The `tenon` test act works around that by requesting only the result and using the response to determine whether the tests have been completed.)
|
|
417
545
|
|
|
418
546
|
Tenon says that tests are typically completed in 3 to 6 seconds but that the latency can be longer, depending on demand.
|
|
419
547
|
|
|
@@ -494,7 +622,7 @@ The requirement `which: [true, 'string', 'hasLength', 'substring of the link tex
|
|
|
494
622
|
|
|
495
623
|
In most cases, the array has length 4:
|
|
496
624
|
- 0. Is the property (here `which`) required (`true` or `false`)? The value `true` here means that every `link`-type act **must** contain a `which` property.
|
|
497
|
-
- 1. What format must the property value have (`'string'`, `'array'`, `'boolean'`, or `'
|
|
625
|
+
- 1. What format must the property value have (`'string'`, `'array'`, `'boolean'`, `'number'`, or `'object'`)?
|
|
498
626
|
- 2. What other validity criterion applies (if any)? (Empty string if none.) The `hasLength` criterion means that the string must be at least 1 character long.
|
|
499
627
|
- 3. Description of the property. In this example, the description says that the value of `which` must be a substring of the text content of the link that is to be clicked. Thus, a `link` act tells Testaro to find the first link whose text content has this substring and click it.
|
|
500
628
|
|
|
@@ -508,38 +636,6 @@ The validity criterion named in item 2 may be any of these:
|
|
|
508
636
|
- `'isWaitable'`: is `'url'`, `'title'`, or `'body'`
|
|
509
637
|
- `'areStrings'`: is an array of strings
|
|
510
638
|
|
|
511
|
-
Any `test` act can also (in addition to the requirements in `actSpecs.js`) contain an `expect` property. If it does, the value of that property must be an array of arrays. Each array specifies expectations about the results of the test.
|
|
512
|
-
|
|
513
|
-
For example, a `test` act might have this `expect` property:
|
|
514
|
-
|
|
515
|
-
```javaScript
|
|
516
|
-
'expect': [
|
|
517
|
-
['total.links', '=', 5],
|
|
518
|
-
['total.links.underlined', '<', 6],
|
|
519
|
-
['total.links.outlined'],
|
|
520
|
-
['docLang', '!', 'es-ES']
|
|
521
|
-
]
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
That would state the expectation that the `result` property of the act for that test in the report will have a `total.links` property with the value 5, a `total.links.underlined` property with a value less than 6, **no** `total.links.outlined` property, and a `docLang` property with a value different from `es-ES`.
|
|
525
|
-
|
|
526
|
-
The first item in each array is an identifier of a property within the `result` property. The item has the format of a string with `.` delimiters. Each `.`-delimited segment its the name of the next property in the hierarchy. If the current object is an array, the next segment must be a non-negative integer, representing the index of an element of the array. For example, `items.1.attributes.0` references the first element of the array that is the `attributes` property of the object that is the second element of the array that is the `items` property of `result`. (In JavaScript, this would be written `items[1].attributes[0]`, but in the `expect` property all property names are `.`-delimited.)
|
|
527
|
-
|
|
528
|
-
If there is only 1 item in an array, it states the expectation that the specified property does not exist. Otherwise, there are 3 items in the array.
|
|
529
|
-
|
|
530
|
-
The second item in each array, if there are 3 items in the array, is an operator, drawn from:
|
|
531
|
-
- `<`: less than
|
|
532
|
-
- `=`: equal to
|
|
533
|
-
- `>`: greater than
|
|
534
|
-
- `!`: unequal to
|
|
535
|
-
- `i`: includes
|
|
536
|
-
|
|
537
|
-
The third item in each array, if there are 3 items in the array, is the criterion with which the value of the first property is compared.
|
|
538
|
-
|
|
539
|
-
A typical use for an `expect` property is checking the correctness of a Testaro test. Thus, the validation jobs in the `validation/tests/jobs` directory all contain `test` acts with `expect` properties. See the “Validation” section below.
|
|
540
|
-
|
|
541
|
-
When a `test` act has an `expect` property, the result for that act has an `expectations` property reporting whether the expectations were satisfied. The value of `expectations` is an array of objects, one object per expectation. Each object includes a `property` property identifying the expectation, and a `passed` property with `true` or `false` value reporting whether the expectation was satisfied. If applicable, it also has other properties identifying what was expected and what was actually reported.
|
|
542
|
-
|
|
543
639
|
## Execution
|
|
544
640
|
|
|
545
641
|
### Introduction
|
|
@@ -673,7 +769,7 @@ DEBUG=false
|
|
|
673
769
|
|
|
674
770
|
### Validators
|
|
675
771
|
|
|
676
|
-
Testaro and
|
|
772
|
+
Testaro and the tests of the Testaro tool can be validated with the _executors_ located in the `validation/executors` directory.
|
|
677
773
|
|
|
678
774
|
The executor for a single test is `test`. To execute it for any test `xyz`, call it with the statement `npm test xyz`.
|
|
679
775
|
|