testaro 60.18.0 → 60.18.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/CONTRIBUTING.md CHANGED
@@ -6,7 +6,7 @@ Testaro can benefit from contributions of various types, such as:
6
6
 
7
7
  - Adding other tools to the tools that it integrates.
8
8
  - Improving its execution speed.
9
- - Improving its own rule implementations.
9
+ - Improving the rule implementations of the `testaro` tool.
10
10
  - Implementing new rules.
11
11
 
12
12
  ## Adding tools
@@ -17,21 +17,23 @@ Tools that may merit consideration include:
17
17
 
18
18
  ## Improving execution speed
19
19
 
20
- To come.
20
+ Major improvements in execution speed were made in 2025 with efficiency improvements in the `testaro` tool, which previously consumed more time than any other tool. The `testaro` tests were refactored to perform their computations within the browser environment. This increased execution speed by about 2 orders of magnitude, permitting the elimination of element sampling.
21
+
22
+ Further improvements in execution speed are hypothesized to require parallelization, so that multiple tools perform their tests simultaneously.
21
23
 
22
24
  ## Improving rule implementations
23
25
 
24
- To come.
26
+ Testaro relies mainly on the integrated tools for rule implementation. The rules of the `testaro` tool are intended to fill gaps not covered by the integrated tools. The tests for those rules are typically more crude than the tests of the integrated tools, so improvements in implementation quality are possible.
25
27
 
26
28
  ## Implementing new rules
27
29
 
28
- Testaro has about 50 of its own rules, in addition to the approximately 900 rules of the other tools that it integrates. According to the issue classifications in the [Testilo](https://www.npmjs.com/package/testilo) package, these 950 or so rules can be classified into about 290 accessibility _issues_, because some rules of some tools at least approximately duplicate some rules of other tools.
30
+ Testaro has about 50 of its own rules, in addition to the approximately 950 rules of the other tools that it integrates. According to the issue classifications in the [Testilo](https://www.npmjs.com/package/testilo) package, these 1000 or so rules can be classified into about 300 accessibility _issues_, because some rules of some tools at least approximately duplicate some rules of other tools.
29
31
 
30
32
  However, many other significant accessibility issues exist that are not covered by any of the existing rules. Thus, Testaro welcomes contributions of new rules for such issues.
31
33
 
32
34
  ### Step 1
33
35
 
34
- The first step in contributing a new rule to Testaro is to satisfy yourself that it will not duplicate existing rules. The latest `procs/score/tic….js` file in the Testilo package should be helpful here.
36
+ The first step in contributing a new rule to Testaro is to satisfy yourself that it will not duplicate existing rules. The `procs/score/tic.js` file in the Testilo package should be helpful here.
35
37
 
36
38
  ### Step 2
37
39
 
@@ -46,57 +48,19 @@ Inspecting some of the jobs and targets in the `validation/tests` directory can
46
48
 
47
49
  ### Step 3
48
50
 
49
- The third step is to add an entry to the `evalRules` or `etcRules` object in the `tests/testaro.js` file.
51
+ The third step is to add an entry to the `allRules` object in the `tests/testaro.js` file.
50
52
 
51
53
  ### Step 4
52
54
 
53
- The fourth step is to implement the new rule by creating a JavaScript or JSON file and saving it in the `testaro` directory.
55
+ The fourth step is to implement the new rule by creating a JavaScript file and saving it in the `testaro` directory.
54
56
 
55
57
  To optimize quality, it may be wise for one person to perform steps 1, 2, and 3, and then for a second person independently to perform step 4 (“clean-room” development).
56
58
 
57
59
  At any time after an implementation is attempted or revised, the developer can run the validation on it, simply by executing the statement `npm test xyz` (replacing `xyz` with the name of the new rule). When the implementation fails validation, diagnosis may find fault either with the implementation or with the validator.
58
60
 
59
- Whether a new rule should be implemented in JSON or JavaScript depends on the complexity of the rule. The JSON format is effective for simple rules, and JavaScript is needed for more complex rules.
60
-
61
- ### Simple rules
62
-
63
- You can create a JSON-defined rule if a single CSS selector can identify all and only the elements on a page that violate the rule.
64
-
65
- Suppose, for example, that you want a rule prohibiting `i` elements (because `i` represents confusingly many different semantic properties). A single CSS selector, namely `"i"`, will identify all the `i` elements on the page, so this rule can be defined with JSON.
66
-
67
- Substantially more complex rules, too, can satisfy this criterion. An example is the `titledEl` rule, which prohibits an element from having a `title` attribute unless the element type is `input`, `button`, `textarea`, `select`, or `iframe`. Its CSS selector is `"[title]:not(input, button, textarea, select, iframe)"`. The CSS selector in a JSON-defined rule may include [custom Playwright pseudo-classes](https://playwright.dev/docs/other-locators#css-locator).
68
-
69
- You can copy and revise any of the existing JSON files in the `testaro` directory to implement a new rule. If, for example, you start with a copy of the `titledEl` file, you can change its properties to fit your new rule. In particular:
70
-
71
- ```json
72
- {
73
- "ruleID": "titledEl",
74
- "selector": "[title]:not(input, button, textarea, select, iframe):visible",
75
- "complaints": {
76
- "instance": "Ineligible element has a title attribute",
77
- "summary": "Ineligible elements have title attributes"
78
- },
79
- "ordinalSeverity": 2,
80
- "summaryTagName": ""
81
- }
82
- ```
83
-
84
- - Assign a violation description for a single instance to `complaints.instance`.
85
- - Assign a violation description for a summary instance (when itemization has been turned off) to `complaints.summary`.
86
- - Assign an integer from 0 through 3 to `ordinalSeverity`.
87
- - If all instances of violations of the rule necessarily involve elements of the same type, assign its tag name (such as `"BUTTON"`) to `summaryTagName`.
88
-
89
- ### Simplifiable rules
90
-
91
- More complex Testaro rules are implemented in JavaScript. Some rules are _simplifiable_. These can be implemented with JavaScript modules like the one for the `allSlanted` rule. To implement such a rule, you can copy an existing module and replace the values of the 6 properties of the`ruleData` object. The significant decisions here are about the values of the `selector` and `pruner` properties.
92
-
93
- The `selector` value is a CSS selector that identifies candidate elements for violation reporting. What makes this rule simplifiable, instead of simple, is that these elements may or may not be determined to violate the rule. Each of the elements identified by the selector must be further analyzed by the pruner. The pruner takes a Playwright locator as its argument and returns `true` if it finds that the element located by the locator violates the rule, or `false` if not.
94
-
95
- ### Complex rules
96
-
97
- Even more complex Testaro rules require analysis that cannot fit into the simple or simplifiable category. You can begin with existing JavaScript rules, or the `data/template.js` file, as an example.
61
+ Whether a new rule should be implemented with support from the `doTest` function or the `getBasicResult` function depends on the requirements of the rule. If operations on each element suffice to determine whether and how that element violates the rule, the `doTest` function is appropriate. If, however, the verdict on an element requires features offered by Playwright or other dependencies that cannot be replicated easily in the browser environment, or if the verdict on one element depends on the state or properties of other elements, then the `getBasicResult` function is appropriate.
98
62
 
99
- Some utility functions in modules in the `procs` directory are available for support of new rules. Among these modules are `testaro` (used in many tests), `isInlineLink`, `operable`, and `visChange`.
63
+ The existing `testaro` tests can serve as templates for new ones. At present, only the `hover` and `role` tests make use of the `getBasicResult` function.
100
64
 
101
65
  ## License agreement
102
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "60.18.0",
3
+ "version": "60.18.1",
4
4
  "description": "Run 1000 web accessibility tests from 11 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/procs/testaro.js CHANGED
@@ -15,8 +15,6 @@
15
15
 
16
16
  // ########## IMPORTS
17
17
 
18
- // Module to sample a population.
19
- const {getSample} = require('../procs/sample');
20
18
  // Module to get locator data.
21
19
  const {getLocatorData} = require('../procs/getLocatorData');
22
20
  // Module to get element IDs.