testilo 22.0.3 → 22.0.5
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 +47 -1
- package/package.json +1 -1
- package/procs/score/tic40.js +5 -7
- package/script.js +1 -1
package/README.md
CHANGED
|
@@ -220,7 +220,7 @@ The `call` module will save the batch as a JSON file in the `batches` subdirecto
|
|
|
220
220
|
|
|
221
221
|
Testilo classifies tool rules into _issues_. The built-in classifications are located in the `procs/score` directory, in files whose names begin with `tic` (for “Testilo issue classification”). You can create additional `tic` files with custom classifications.
|
|
222
222
|
|
|
223
|
-
For example, one of the issues in the `
|
|
223
|
+
For example, one of the issues in the `tic40.js` file is `mainNot1`. Four rules are classified as belonging to that issue: rule `main_element_only_one` of `aslint` and 3 more rules defined by 3 other tools.
|
|
224
224
|
|
|
225
225
|
If you want Testaro to test targets for only particular issues, you can name those issues and use the Testilo `script` module to create a script for that purpose. The only tools called by the script will be tools that define rules that are classified as belonging to one or more issues named.
|
|
226
226
|
|
|
@@ -488,6 +488,52 @@ The `score()` function of the `score` module takes two arguments:
|
|
|
488
488
|
|
|
489
489
|
A scoring function defines scoring rules. The Testilo package contains a `procs/score` directory, in which there are modules that export scoring functions. You can use one of those scoring functions, or you can create your own.
|
|
490
490
|
|
|
491
|
+
### Scorers
|
|
492
|
+
|
|
493
|
+
The built-in scoring functions are named `scorer` and are exported by files whose names begin with `tsp` (for Testilo scoring proc). Those functions make use of `issues` objects defined in files whose names begin with `tic`. An `issues` object defines an issue classification: a body of data about rules of tools and the tool-agnostic issues that those rules are deemed to belong to.
|
|
494
|
+
|
|
495
|
+
The properties of an `issues` object are issue objects: objects containing data about issues. Here is an example from `tic40.js`:
|
|
496
|
+
|
|
497
|
+
```javascript
|
|
498
|
+
multipleLabelees: {
|
|
499
|
+
summary: 'labeled element ambiguous',
|
|
500
|
+
why: 'User cannot get help on the topic of a form item',
|
|
501
|
+
wcag: '1.3.1',
|
|
502
|
+
weight: 4,
|
|
503
|
+
tools: {
|
|
504
|
+
aslint: {
|
|
505
|
+
label_implicitly_associatedM: {
|
|
506
|
+
variable: false,
|
|
507
|
+
quality: 1,
|
|
508
|
+
what: 'Element contains more than 1 labelable element.'
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
nuVal: {
|
|
512
|
+
'The label element may contain at most one button, input, meter, output, progress, select, or textarea descendant.': {
|
|
513
|
+
variable: false,
|
|
514
|
+
quality: 1,
|
|
515
|
+
what: 'Element has more than 1 labelable descendant.'
|
|
516
|
+
},
|
|
517
|
+
'label element with multiple labelable descendants.': {
|
|
518
|
+
variable: false,
|
|
519
|
+
quality: 1,
|
|
520
|
+
what: 'Element has multiple labelable descendants.'
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
In this example, `multipleLabelees` is the issue ID. The `weight` property represents the severity of the issue and ranges from 1 to 4. The `tools` property is an object containing data about the tools that have rules deemed to belong to the issue. Here there are 2 such tools: `aslint` and `nuVal`. The tool properties are objects containing data about the relevant rules of those tools: 1 from the `aslint` tool and 2 from the `nuVal` tool.
|
|
528
|
+
|
|
529
|
+
The property for each rule has the rule ID as its name.
|
|
530
|
+
|
|
531
|
+
The `variable` property is `true` if the rule ID is a regular expression or `false` if the rule ID is a string. Most rule IDs are strings, but some rules have patterns rather than constant strings as their identifiers, and in those cases regular expressions matching the patterns are the property names.
|
|
532
|
+
|
|
533
|
+
The `quality` property is usually 1, but if the test of the rule is known to be inaccurate the value is a fraction of 1, so the result of that test will be downweighted.
|
|
534
|
+
|
|
535
|
+
Some issue objects (such as `flash` in `tic40.js`) have a `max` property, equal to the maximum possible count of instances. That property allows a scorer to ascribe a greater weight to an instance of that issue.
|
|
536
|
+
|
|
491
537
|
### Invocation
|
|
492
538
|
|
|
493
539
|
There are two ways to invoke the `score` module.
|
package/package.json
CHANGED
package/procs/score/tic40.js
CHANGED
|
@@ -182,6 +182,11 @@ exports.issues = {
|
|
|
182
182
|
quality: 1,
|
|
183
183
|
what: 'Blocks of repeated content cannot be bypassed [invalid]'
|
|
184
184
|
},
|
|
185
|
+
'QW-BP1': {
|
|
186
|
+
variable: false,
|
|
187
|
+
quality: 1,
|
|
188
|
+
what: 'h1-h6 not used to identify headings [invalid]'
|
|
189
|
+
},
|
|
185
190
|
'QW-WCAG-T4': {
|
|
186
191
|
variable: false,
|
|
187
192
|
quality: 0,
|
|
@@ -4491,13 +4496,6 @@ exports.issues = {
|
|
|
4491
4496
|
what: 'Document has no headings'
|
|
4492
4497
|
}
|
|
4493
4498
|
},
|
|
4494
|
-
qualWeb: {
|
|
4495
|
-
'QW-BP1': {
|
|
4496
|
-
variable: false,
|
|
4497
|
-
quality: 1,
|
|
4498
|
-
what: 'h1-h6 not used to identify headings'
|
|
4499
|
-
}
|
|
4500
|
-
},
|
|
4501
4499
|
wave: {
|
|
4502
4500
|
heading_missing: {
|
|
4503
4501
|
variable: false,
|
package/script.js
CHANGED
|
@@ -12,7 +12,7 @@ require('dotenv').config();
|
|
|
12
12
|
|
|
13
13
|
// List of presumptively needed tools.
|
|
14
14
|
let toolIDs = [
|
|
15
|
-
'alfa', 'aslint', 'axe', 'htmlcs', 'ibm', 'nuVal', 'qualWeb', 'testaro', 'wave'
|
|
15
|
+
'alfa', 'aslint', 'axe', 'ed11y', 'htmlcs', 'ibm', 'nuVal', 'qualWeb', 'testaro', 'wave'
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
// ########## FUNCTIONS
|