testaro 14.8.0 → 14.9.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 CHANGED
@@ -6,9 +6,11 @@ Ensemble testing for web accessibility
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 purposes of Testaro are to:
10
+ - provide programmatic access to accessibility tests defined by several tools
11
+ - facilitate the integration of the reports of the tools into a unified report
10
12
 
11
- Testaro aims to increase the efficiency of multi-tool integration for accessibility testing. The need for multi-tool integration, and its costs, are analyzed in [Accessibility Metatesting: Comparing Nine Testing Tools](https://arxiv.org/abs/2304.07591).
13
+ The need for multi-tool integration, and its costs, are discussed in [Accessibility Metatesting: Comparing Nine Testing Tools](https://arxiv.org/abs/2304.07591).
12
14
 
13
15
  Testaro launches and controls web browsers, performing operations, conducting tests, and recording results.
14
16
 
@@ -52,27 +54,19 @@ Testaro performs tests of these tools:
52
54
 
53
55
  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.
54
56
 
55
- As of this version, the counts of tests of the tools referenced above were:
56
- - Alfa: 103
57
- - Axe-core: 138
58
- - Continuum Community Edition: 267
59
- - Equal Access: 163
60
- - HTML CodeSniffer: 98
61
- - Nu Html Checker: 147
62
- - QualWeb core: 121
63
- - Tenon: 180
64
- - WAVE: 110
65
- - Testaro: 29
66
- - total: 1356
57
+ ## Rules
67
58
 
68
- Of the 29 Testaro tests, 26 are evaluative (they discover accessibility problems), and the other 3 (`elements`, `textNodes`, and `title`) are informative (they report conditions specified by the user).
59
+ Each tool accessed with Testaro defines _rules_ and tests _targets_ for compliance with its rules. The counts of the rules range from about 30, for Testaro itself, to about 270, for Continuum Community Edition. In total, the ten tools define about 1350 rules. Some of the tools are under active development, and their rule counts change over time.
69
60
 
70
- ## Quasi-tests
61
+ ## Job data
71
62
 
72
- 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:
73
- - Latency (how long a time each tool takes to run its tests)
74
- - Test prevention (the failure of tools to run on particular targets)
75
- - Logging (browser messaging, including about document errors, during testing)
63
+ A report produced by Testaro discloses:
64
+ - raw results of tests conducted by tools
65
+ - standardized results of tests conducted by tools
66
+ - process data, including statistics on:
67
+ - latency (how long a time each tool takes to run its tests)
68
+ - test prevention (the failure of tools to run on particular targets)
69
+ - logging (browser messaging, including about document errors, during testing)
76
70
 
77
71
  ## Code organization
78
72
 
@@ -188,30 +182,31 @@ Job properties:
188
182
  #### Introduction
189
183
 
190
184
  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.
191
- - 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.
192
- - 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.
185
+ - 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. Testaro does some pruning of tool reports, removing content that is judged unlikely to be useful. You can examine and modify the pruning algorithms in the modules located in the `tests` directory.
186
+ - Testaro further elaborates a job by reporting comprehensive results in a job report. Testaro can add more facts to each of the tool reports and also adds whole-job facts, in a `jobData` property, to the job.
193
187
 
194
188
  #### Formats
195
189
 
196
- ##### Tool formats
190
+ ##### Tool-report formats
197
191
 
198
192
  The tools listed above as dependencies write their tool reports in various formats. They differ in how they organize multiple instances of the same problem, how they classify severity and certainty, how they point to the locations of problems, how they name problems, etc.
199
193
 
200
194
  ##### Standard format
201
195
 
202
- Testaro helps overcome this format diversity by offering to represent the main facts in the report of each tool in a single standardized format.
196
+ Testaro helps overcome this format diversity by offering to represent the main facts in each tool report in a single standardized format.
203
197
 
204
198
  In the conceptual scheme underlying the format standardization of Testaro, each tool has its own set of _rules_, where a rule is an algorithm for evaluating a target and determining whether instances of some kind of problem exist in it. With standardization, Testaro reports, in a uniform way, the outcomes from the application of rules by tools to a target.
205
199
 
206
- 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.
200
+ 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 report.
207
201
 
208
- The standard format of each tool report has two properties:
202
+ The standard format of each tool report has these properties:
203
+ - `prevented`: `true` if the tool failed to run on the page, or otherwise omitted.
209
204
  - `totals`: an array of 4 integers, representing the counts of problem 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.
210
205
  - `instances`: an array of objects describing facts about issue instances reported by the tool. This object has these properties, some of which have empty strings as values when the tool does not provide values:
211
206
  - `ruleID`: a code identifying a rule
212
207
  - `what`: a description of the rule
213
208
  - `count` (optional): the count of instances if this instance represents multiple instances
214
- - `ordinalSeverity`: how the tool ranks the severity of the instance, on a 4-point ordinal scale
209
+ - `ordinalSeverity`: how the tool ranks the severity of the instance, on a 4-point ordinal scale from 0 to 3
215
210
  - `tagName`: upper-case tagName of the affected element
216
211
  - `id`: value of the `id` property of that element
217
212
  - `location`: an object with three properties:
@@ -229,7 +224,7 @@ standardResult: {
229
224
  {
230
225
  ruleID: 'rule01',
231
226
  what: 'Button type invalid',
232
- ordinalSeverity: 0,
227
+ ordinalSeverity: 2,
233
228
  tagName: 'BUTTON'
234
229
  id: '',
235
230
  location: {
@@ -272,7 +267,13 @@ standardResult: {
272
267
 
273
268
  If a tool has the option to be used without itemization and is being so used, the `instances` array may be empty.
274
269
 
275
- This standard format is not opinionated about issue classifications. A rule ID identifies something deemed to be an issue by a tool. Useful reporting from multi-tool testing still requires the classification of tool **rules** into **issues**. If tool `A` has `alt-incomplete` as a rule ID and tool `B` has `image_alt_stub` as a rule ID, Testaro does not decide whether those are really the same issue or different issues. That decision belongs to you. The standardization of tool reports by Testaro eliminates some of the drudgery in issue classification, but not any of the judgment required for issue classification.
270
+ This standard format reflects some judgments. For example:
271
+ - The `ordinalSeverity` property of an instance may have required interpretation. Tools may report severity, certainty, both, or neither; they may classify severity or certainty ordinally or metrically; and, if they classify ordinally, their scales may have more or fewer than 4 ranks. Testaro coerces each tool’s severity and/or certainty classification into a 4-rank ordinal classification. This classification is deemed to express the most common pattern among the tools.
272
+ - The `tagName` property of an instance may not always be obvious, because in some cases the rule being tested for requires a relationship among more than one element (e.g., “An X element may not have a Y element as its parent”).
273
+
274
+ You are not dependent on the judgments incorporated into the standard format, because Testaro can give you the original reports from the tools.
275
+
276
+ The standard format does not express opinions issue classifications. A rule ID identifies something deemed to be an issue by a tool. Useful reporting from multi-tool testing still requires the classification of tool **rules** into **issues**. If tool `A` has `alt-incomplete` as a rule ID and tool `B` has `image_alt_stub` as a rule ID, Testaro does not decide whether those are really the same issue or different issues. That decision belongs to you. The standardization of tool reports by Testaro eliminates some of the drudgery in issue classification, but not any of the judgment required for issue classification.
276
277
 
277
278
  ### Acts
278
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "14.8.0",
3
+ "version": "14.9.0",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/standardize.js CHANGED
@@ -225,8 +225,12 @@ const doWAVE = (result, standardResult, categoryName) => {
225
225
  };
226
226
  // Converts a result.
227
227
  const convert = (toolName, result, standardResult) => {
228
+ // Prevention.
229
+ if (result.prevented) {
230
+ standardResult.prevented = true;
231
+ }
228
232
  // alfa
229
- if (toolName === 'alfa' && result.totals) {
233
+ else if (toolName === 'alfa' && result.totals) {
230
234
  standardResult.totals = [result.totals.warnings, 0, 0, result.totals.failures];
231
235
  result.items.forEach(item => {
232
236
  const {codeLines} = item.target;
@@ -452,6 +456,7 @@ const convert = (toolName, result, standardResult) => {
452
456
  doWAVE(result, standardResult, categoryName);
453
457
  });
454
458
  }
459
+ // Any tool with no reported rule violations:
455
460
  else {
456
461
  standardResult.totals = [0, 0, 0, 0];
457
462
  }