testilo 10.3.1 → 11.0.2

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.
Files changed (72) hide show
  1. package/README.md +215 -188
  2. package/batch.js +64 -0
  3. package/call.js +29 -4
  4. package/compare.js +2 -2
  5. package/merge.js +1 -7
  6. package/package.json +1 -1
  7. package/procs/compare/cp20sqrt/index.js +7 -10
  8. package/procs/compare/{cp15b → tcp24}/index.html +5 -5
  9. package/procs/compare/{cp12a → tcp24}/index.js +13 -20
  10. package/procs/score/tic25.js +1 -1
  11. package/procs/score/{tic24.js → tic26.js} +205 -199
  12. package/procs/score/tsp24.js +9 -3
  13. package/procs/score/tsp26.js +120 -0
  14. package/score.js +2 -8
  15. package/procs/compare/cp0/index.html +0 -46
  16. package/procs/compare/cp0/index.js +0 -70
  17. package/procs/compare/cp1/index.html +0 -46
  18. package/procs/compare/cp1/index.js +0 -71
  19. package/procs/compare/cp12a/index.html +0 -47
  20. package/procs/compare/cp12b/index.html +0 -47
  21. package/procs/compare/cp12b/index.js +0 -71
  22. package/procs/compare/cp14a/index.html +0 -47
  23. package/procs/compare/cp14a/index.js +0 -71
  24. package/procs/compare/cp15a/index.html +0 -47
  25. package/procs/compare/cp15a/index.js +0 -71
  26. package/procs/compare/cp15b/index.js +0 -74
  27. package/procs/compare/cp16a/index.html +0 -47
  28. package/procs/compare/cp16a/index.js +0 -74
  29. package/procs/compare/cp16b/index.html +0 -47
  30. package/procs/compare/cp16b/index.js +0 -74
  31. package/procs/digest/dp10a/index.html +0 -137
  32. package/procs/digest/dp10a/index.js +0 -402
  33. package/procs/digest/dp10b/index.html +0 -74
  34. package/procs/digest/dp10b/index.js +0 -130
  35. package/procs/digest/dp10c/index.html +0 -55
  36. package/procs/digest/dp10c/index.js +0 -129
  37. package/procs/digest/dp11a/index.html +0 -76
  38. package/procs/digest/dp11a/index.js +0 -127
  39. package/procs/digest/dp12a/index.html +0 -78
  40. package/procs/digest/dp12a/index.js +0 -126
  41. package/procs/digest/dp12b/index.html +0 -78
  42. package/procs/digest/dp12b/index.js +0 -126
  43. package/procs/digest/dp13a/index.html +0 -78
  44. package/procs/digest/dp13a/index.js +0 -126
  45. package/procs/digest/dp14a/index.html +0 -79
  46. package/procs/digest/dp14a/index.js +0 -126
  47. package/procs/digest/dp15a/index.html +0 -80
  48. package/procs/digest/dp15a/index.js +0 -126
  49. package/procs/digest/dp16a/index.html +0 -80
  50. package/procs/digest/dp16a/index.js +0 -126
  51. package/procs/digest/dp16b/index.html +0 -80
  52. package/procs/digest/dp16b/index.js +0 -126
  53. package/procs/digest/dp18a/index.html +0 -80
  54. package/procs/digest/dp18a/index.js +0 -129
  55. package/procs/digest/dp20c/index.html +0 -54
  56. package/procs/digest/dp20c/index.js +0 -117
  57. package/procs/digest/dp20d/index.html +0 -54
  58. package/procs/digest/dp20d/index.js +0 -121
  59. package/procs/digest/tdp09a/index.html +0 -126
  60. package/procs/digest/tdp09a/index.js +0 -381
  61. package/procs/digest/tdp22/index.html +0 -54
  62. package/procs/digest/tdp22/index.js +0 -120
  63. package/procs/score/tic21.js +0 -6868
  64. package/procs/score/tic22.js +0 -6911
  65. package/procs/score/tic23.js +0 -6924
  66. package/procs/score/tsp21.js +0 -720
  67. package/procs/score/tsp22.js +0 -720
  68. package/procs/score/tsp23.js +0 -720
  69. package/specs/batches/orgs.json +0 -43
  70. package/specs/scripts/ts21.json +0 -213
  71. package/specs/scripts/ts23.json +0 -219
  72. package/specs/scripts/ts24.json +0 -225
@@ -1,54 +0,0 @@
1
- <!DOCTYPE HTML>
2
- <html lang="en-US">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <meta name="author" content="Testilo">
7
- <meta name="creator" content="Testilo">
8
- <meta name="publisher" name="Testilo">
9
- <meta name="description" content="report of accessibility testing of a web page">
10
- <meta name="keywords" content="accessibility a11y web testing">
11
- <title>Accessibility digest</title>
12
- <link rel="icon" href="favicon.png">
13
- <link rel="stylesheet" href="style.css">
14
- </head>
15
- <body>
16
- <main>
17
- <header>
18
- <h1>Accessibility digest</h1>
19
- <table class="allBorder">
20
- <caption>Synopsis</caption>
21
- <tr><th>Page</th><td>__org__</td></tr>
22
- <tr><th>URL</th><td>__url__</td></tr>
23
- <tr><th>Requester</th><td>__requester__</td></tr>
24
- <tr><th>Test date</th><td>__dateSlash__</td></tr>
25
- <tr><th>Score</th><td>__totalScore__</td></tr>
26
- <tr><th>Tested by</th><td>Testaro, procedure <code>__ts__</code></td></tr>
27
- <tr><th>Scored by</th><td>Testilo, procedure <code>__sp__</code></td></tr>
28
- <tr><th>Digested by</th><td>Testilo, procedure <code>__dp__</code></td></tr>
29
- </table>
30
- </header>
31
- <h2>Introduction</h2>
32
- <p>This is a digest of results from a battery of accessibility Tests.</p>
33
- <p>The battery includes 1351 automated accessibility tests drawn from ten different packages: Alfa, Axe, Continuum, Equal Access, HTML CodeSniffer, Nu Html Checker, QualWeb, Tenon, Testaro, and WAVE.</p>
34
- <p>These tests were run on the web page named above and gave the page a score of __totalScore__, where 0 would be <q>perfect</q>.</p>
35
- <h2>Score summary</h2>
36
- <table class="allBorder secondCellRight">
37
- <caption>Score components</caption>
38
- <tbody class="headersLeft">
39
- __scoreRows__
40
- </tbody>
41
- </table>
42
- <h2>Issue summary</h2>
43
- <h3>Special issues</h3>
44
- __specialSummary__
45
- <h3>Classified issues</h3>
46
- __issueSummary__
47
- <h2>Complete report</h2>
48
- <pre>__report__</pre>
49
- <footer>
50
- <p class="date">Produced <time itemprop="datePublished" datetime="__dateISO__">__dateSlash__</time></p>
51
- </footer>
52
- </main>
53
- </body>
54
- </html>
@@ -1,120 +0,0 @@
1
- /*
2
- index: digester for scoring procedure tsp22.
3
- Creator of parameters for substitution into index.html.
4
- */
5
-
6
- // CONSTANTS
7
-
8
- // Newlines with indentations.
9
- const joiner = '\n ';
10
- const innerJoiner = '\n ';
11
- const specialMessages = {
12
- log: 'This is based on the amount of browser error logging and miscellaneous logging during the tests.',
13
- preventions: 'This is based on tests that the page did not allow to be run. That impedes accessibility progress and risks interfering with tools that users with disabilities need.',
14
- solos: 'This is based on issues reported by unclassified tests. Details are in the report.'
15
- };
16
-
17
- // FUNCTIONS
18
-
19
- // Makes strings HTML-safe.
20
- const htmlEscape = textOrNumber => textOrNumber
21
- .toString()
22
- .replace(/&/g, '&amp;')
23
- .replace(/</g, '&lt;');
24
- // Gets a row of the score-summary table.
25
- const getScoreRow = (component, score) => `<tr><th>${component}</th><td>${score}</td></tr>`;
26
- // Gets the start of a paragraph about a special score.
27
- const getSpecialPStart = (summary, scoreID) =>
28
- `<p><span class="componentID">${scoreID}</span>: Score ${summary[scoreID]}.`;
29
- // Adds parameters to a query for a digest.
30
- exports.makeQuery = (report, query) => {
31
- // Add an HTML-safe copy of the report to the query to be appended to the digest.
32
- const {acts, sources, jobData, score} = report;
33
- const {target, requester} = sources;
34
- const reportJSON = JSON.stringify(report, null, 2);
35
- const reportJSONSafe = htmlEscape(reportJSON);
36
- query.report = reportJSONSafe;
37
- query.ts = 'ts21';
38
- query.sp = 'tsp22';
39
- query.dp = 'tdp22';
40
- // Add the job data to the query.
41
- query.dateISO = jobData.endTime.slice(0, 10);
42
- query.dateSlash = query.dateISO.replace(/-/g, '/');
43
- query.org = target.what;
44
- query.url = acts && acts.length > 1 && acts[1].which;
45
- query.requester = requester;
46
- const {issueDetails, summary} = score;
47
- const {total, issues} = summary;
48
- if (typeof total === 'number') {
49
- query.totalScore = total;
50
- }
51
- else {
52
- console.log('ERROR: missing or invalid total score');
53
- return;
54
- }
55
- // Add the total and any special rows of the score-summary table to the query.
56
- const scoreRows = [];
57
- const specialComponentIDs = ['log', 'preventions', 'solos'];
58
- ['total'].concat(specialComponentIDs).forEach(item => {
59
- if (summary[item]) {
60
- scoreRows.push(getScoreRow(item, summary[item]));
61
- }
62
- });
63
- // Add the group rows of the score-summary table to the query.
64
- issues.forEach(issue => {
65
- scoreRows.push(getScoreRow(`${issue.issueName}`, issue.score));
66
- });
67
- query.scoreRows = scoreRows.join(innerJoiner);
68
- // If the score has any special components:
69
- const scoredSpecialIDs = specialComponentIDs.filter(item => summary[item]);
70
- if (scoredSpecialIDs.length) {
71
- // Add paragraphs about them for the issue summary to the query.
72
- const specialPs = [];
73
- scoredSpecialIDs.forEach(id => {
74
- specialPs.push(`${getSpecialPStart(summary, id)} ${specialMessages[id]}`);
75
- });
76
- query.specialSummary = specialPs.join(joiner);
77
- }
78
- // Otherwise, i.e. if the score has no special components:
79
- else {
80
- // Add a paragraph stating this for the issue summary to the query.
81
- query.specialSummary = '<p>No special issues contributed to the score.</p>'
82
- }
83
- // If the score has any classified issues as components:
84
- if (issues.length) {
85
- // Add paragraphs about them for the group summary to the query.
86
- const issueSummaryItems = [];
87
- issues.forEach(issue => {
88
- const {issueName, score} = issue;
89
- const issueHeading = `<h4>Issue ${issueName}</h4>`;
90
- const wcagP = `<p>WCAG: ${issueDetails.issues[issueName].wcag || 'N/A'}</p>`;
91
- const scoreP = `<p>Score: ${score}</p>`;
92
- const issueIntroP = '<p>Issue reports in this category:</p>';
93
- const issueListItems = [];
94
- const issueData = issueDetails.issues[issueName];
95
- const toolIDs = Object.keys(issueData.tools);
96
- toolIDs.forEach(toolID => {
97
- const testIDs = Object.keys(issueData.tools[toolID]);
98
- testIDs.forEach(testID => {
99
- const testData = issueData.tools[toolID][testID];
100
- const {score, what} = testData;
101
- const listItem =
102
- `<li>Package <code>${toolID}</code>, test <code>${testID}</code>, score ${score} (${what})</li>`;
103
- issueListItems.push(listItem);
104
- });
105
- });
106
- const issueList = [
107
- '<ul>',
108
- issueListItems.join('\n '),
109
- '</ul>'
110
- ].join(joiner);
111
- issueSummaryItems.push(issueHeading, wcagP, scoreP, issueIntroP, issueList);
112
- });
113
- query.issueSummary = issueSummaryItems.join(joiner);
114
- }
115
- // Otherwise, i.e. if the score has no classified issues as components:
116
- else {
117
- // Add a paragraph stating this for the issue summary to the query.
118
- query.issueSummary = '<p>No classified issues contributed to the score.</p>'
119
- }
120
- };