testilo 44.1.2 → 44.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "44.1.2",
3
+ "version": "44.2.1",
4
4
  "description": "Prepares Testaro jobs and processes Testaro reports",
5
5
  "main": "call.js",
6
6
  "scripts": {
@@ -426,6 +426,31 @@ exports.issues = {
426
426
  variable: false,
427
427
  quality: 1,
428
428
  what: 'Link purpose may be undisclosed [speculative]'
429
+ },
430
+ 'This checkboxinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
431
+ variable: false,
432
+ quality: 1,
433
+ what: 'checkbox input element has no accessible name [invalid]'
434
+ },
435
+ 'This emailinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
436
+ variable: false,
437
+ quality: 1,
438
+ what: 'email input element has no accessible name [invalid]'
439
+ },
440
+ 'This numberinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
441
+ variable: false,
442
+ quality: 1,
443
+ what: 'Element is an input of type number but has no accessible name [invalid]'
444
+ },
445
+ 'This searchinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
446
+ variable: false,
447
+ quality: 1,
448
+ what: 'search input element has no accessible name [invalid]'
449
+ },
450
+ 'This textinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
451
+ variable: false,
452
+ quality: 1,
453
+ what: 'text input element has no accessible name [invalid]'
429
454
  }
430
455
  }
431
456
  }
@@ -672,36 +697,6 @@ exports.issues = {
672
697
  quality: 1,
673
698
  what: 'Element with an input role has no accessible name'
674
699
  },
675
- 'This emailinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
676
- variable: false,
677
- quality: 1,
678
- what: 'email input element has no accessible name'
679
- },
680
- 'This searchinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
681
- variable: false,
682
- quality: 1,
683
- what: 'search input element has no accessible name'
684
- },
685
- 'This textinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
686
- variable: false,
687
- quality: 1,
688
- what: 'text input element has no accessible name'
689
- }
690
- }
691
- }
692
- },
693
- checkboxNoText: {
694
- summary: 'checkbox input not named',
695
- why: 'User cannot get help on whether to check a checkbox',
696
- wcag: '4.1.2',
697
- weight: 4,
698
- tools: {
699
- wax: {
700
- 'This checkboxinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
701
- variable: false,
702
- quality: 1,
703
- what: 'checkbox input element has no accessible name'
704
- }
705
700
  }
706
701
  }
707
702
  },
@@ -788,21 +783,6 @@ exports.issues = {
788
783
  }
789
784
  }
790
785
  },
791
- numberInputNoText: {
792
- summary: 'number input not named',
793
- why: 'User cannot get help understanding what to enter into a number field',
794
- wcag: '4.1.2',
795
- weight: 4,
796
- tools: {
797
- wax: {
798
- 'This numberinput element does not have a name available to an accessibility API. Valid names are: label element, title , aria-label , aria-labelledby , aria-description , aria-describedby .': {
799
- variable: false,
800
- quality: 1,
801
- what: 'Element is an input of type number but has no accessible name'
802
- }
803
- }
804
- }
805
- },
806
786
  imageInputNoText: {
807
787
  summary: 'image input not named',
808
788
  why: 'User cannot get help understanding an image used as a submission button',
@@ -51,7 +51,7 @@ const issueCountWeight = 10;
51
51
  */
52
52
  const maxWeight = 30;
53
53
 
54
- // 3. Tool
54
+ // 2. Tool
55
55
  /*
56
56
  Severity: amount added to each raw tool score by each violation of a rule with ordinal severity 0
57
57
  through 3.
@@ -60,17 +60,17 @@ const severityWeights = [1, 2, 3, 4];
60
60
  // Final: multiplier of the raw tool score to obtain the final tool score.
61
61
  const toolWeight = 0.1;
62
62
 
63
- // 4. Element
63
+ // 3. Element
64
64
  // Multiplier of the count of elements with at least 1 rule violation.
65
65
  const elementWeight = 2;
66
66
 
67
- // 5. Prevention
67
+ // 4. Prevention
68
68
  // Each tool prevention by the page.
69
69
  const preventionWeight = 300;
70
70
  // Each prevention of a Testaro rule test by the page.
71
71
  const testaroRulePreventionWeight = 30;
72
72
 
73
- // 6. Log
73
+ // 5. Log
74
74
  // Multipliers of log values to obtain the log score.
75
75
  const logWeights = {
76
76
  logCount: 0.1,
@@ -81,7 +81,7 @@ const logWeights = {
81
81
  visitRejectionCount: 2
82
82
  };
83
83
 
84
- // 7. Latency
84
+ // 6. Latency
85
85
  // Normal latency (11 visits [1 per tool], with 2 seconds per visit).
86
86
  const normalLatency = 22;
87
87
  // Total latency exceeding normal, in seconds.
@@ -89,7 +89,7 @@ const latencyWeight = 2;
89
89
 
90
90
  // RULE CONSTANTS
91
91
 
92
- // Initialize a table of issue-classified tool rules.
92
+ // Initialize a directory of issue-classified tool rules.
93
93
  const issueIndex = {};
94
94
  // Initialize an array of variably named tool rules.
95
95
  const issueMatcher = [];
@@ -100,7 +100,7 @@ Object.keys(issues).forEach(issueName => {
100
100
  // For each of those rules:
101
101
  Object.keys(issues[issueName].tools[toolName]).forEach(ruleID => {
102
102
  issueIndex[toolName] ??= {};
103
- // Add it to the table of tool rules.
103
+ // Add it to the directory of tool rules.
104
104
  issueIndex[toolName][ruleID] = issueName;
105
105
  // If it is variably named:
106
106
  if (issues[issueName].tools[toolName][ruleID].variable) {
@@ -203,38 +203,35 @@ exports.scorer = report => {
203
203
  return patternRE.test(ruleID);
204
204
  });
205
205
  }
206
- // If the rule has an ID:
206
+ // If the instance rule has an ID:
207
207
  if (canonicalRuleID) {
208
208
  // Get the issue of the rule.
209
209
  const issueName = issueIndex[which][canonicalRuleID];
210
- // If the rule ID belongs to a non-ignorable issue:
210
+ // If the issue is non-ignorable:
211
211
  if (issueName !== 'ignorable') {
212
- // Add the instance to the issue details of the score data.
213
- if (! details.issue[issueName]) {
214
- details.issue[issueName] = {
215
- summary: issues[issueName].summary,
216
- wcag: issues[issueName].wcag || '',
217
- score: 0,
218
- maxCount: 0,
219
- weight: issues[issueName].weight,
220
- countLimit: issues[issueName].max,
221
- instanceCounts: {},
222
- tools: {}
223
- };
224
- if (! details.issue[issueName].countLimit) {
225
- delete details.issue[issueName].countLimit;
226
- }
227
- }
228
- if (! details.issue[issueName].tools[which]) {
229
- details.issue[issueName].tools[which] = {};
230
- }
231
- if (! details.issue[issueName].instanceCounts[which]) {
232
- details.issue[issueName].instanceCounts[which] = 0;
212
+ // Initialize the issue details if necessary.
213
+ details.issue[issueName] ??= {
214
+ summary: issues[issueName].summary,
215
+ wcag: issues[issueName].wcag || '',
216
+ score: 0,
217
+ maxCount: 0,
218
+ weight: issues[issueName].weight,
219
+ countLimit: issues[issueName].max,
220
+ instanceCounts: {},
221
+ elementXPaths: [],
222
+ tools: {}
223
+ };
224
+ const issueDetails = details.issue[issueName];
225
+ if (! issueDetails.countLimit) {
226
+ delete issueDetails.countLimit;
233
227
  }
234
- details.issue[issueName].instanceCounts[which] += count;
235
- if (! details.issue[issueName].tools[which][canonicalRuleID]) {
228
+ issueDetails.tools[which] ??= {};
229
+ issueDetails.instanceCounts[which] ??= 0;
230
+ // Add data from the instance to the issue details.
231
+ issueDetails.instanceCounts[which] += count;
232
+ if (! issueDetails.tools[which][canonicalRuleID]) {
236
233
  const ruleData = issues[issueName].tools[which][canonicalRuleID];
237
- details.issue[issueName].tools[which][canonicalRuleID] = {
234
+ issueDetails.tools[which][canonicalRuleID] = {
238
235
  quality: ruleData.quality,
239
236
  what: ruleData.what,
240
237
  complaints: {
@@ -266,7 +263,7 @@ exports.scorer = report => {
266
263
  issuePaths[issueName] ??= new Set();
267
264
  // If the element has a path ID:
268
265
  if (pathID) {
269
- // Ensure that it is in the issue-specific set of paths.
266
+ // Ensure that it is in the issue-specific set of XPaths.
270
267
  issuePaths[issueName].add(pathID);
271
268
  }
272
269
  }