testilo 20.0.3 → 21.0.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/package.json +1 -1
- package/procs/digest/{tdp37 → tdp38}/index.js +10 -5
- package/procs/score/tsp38.js +1 -1
- package/procs/digest/tdp31/index.html +0 -72
- package/procs/digest/tdp31/index.js +0 -105
- package/procs/digest/tdp33/index.html +0 -72
- package/procs/digest/tdp33/index.js +0 -105
- package/procs/digest/tdp33h/index.html +0 -82
- package/procs/digest/tdp33h/index.js +0 -111
- package/procs/digest/tdp36/index.html +0 -72
- package/procs/digest/tdp36/index.js +0 -96
- package/procs/score/tic31.js +0 -7235
- package/procs/score/tic32.js +0 -7274
- package/procs/score/tic33.js +0 -7524
- package/procs/score/tic34.js +0 -7538
- package/procs/score/tic35.js +0 -7413
- package/procs/score/tic36.js +0 -8215
- package/procs/score/tic37.js +0 -8543
- package/procs/score/tsp31.js +0 -241
- package/procs/score/tsp33.js +0 -278
- package/procs/score/tsp36.js +0 -278
- package/procs/score/tsp37.js +0 -292
- /package/procs/digest/{tdp37 → tdp38}/index.html +0 -0
package/package.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
// IMPORTS
|
|
4
4
|
|
|
5
5
|
// Module to classify tool rules into issues
|
|
6
|
-
const {issues} = require('../../score/
|
|
6
|
+
const {issues} = require('../../score/tic38');
|
|
7
7
|
// Module to process files.
|
|
8
8
|
const fs = require('fs/promises');
|
|
9
9
|
|
|
10
10
|
// CONSTANTS
|
|
11
11
|
|
|
12
12
|
// Digester ID.
|
|
13
|
-
const id = '
|
|
13
|
+
const id = 'tdp38';
|
|
14
14
|
// Newline with indentations.
|
|
15
15
|
const innerJoiner = '\n ';
|
|
16
16
|
|
|
@@ -53,9 +53,14 @@ const populateQuery = (report, query) => {
|
|
|
53
53
|
// Get rows for the issue-score table.
|
|
54
54
|
issueIDs.forEach(issueID => {
|
|
55
55
|
const {score, tools} = details.issue[issueID];
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
if (issues[issueID]) {
|
|
57
|
+
rows.issueRows.push(
|
|
58
|
+
getIssueScoreRow(issues[issueID].summary, issues[issueID].wcag, score, Object.keys(tools))
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.log(`ERROR: Issue ${issueID} not found`);
|
|
63
|
+
}
|
|
59
64
|
});
|
|
60
65
|
// Add the rows to the query.
|
|
61
66
|
['summaryRows', 'issueRows'].forEach(rowType => {
|
package/procs/score/tsp38.js
CHANGED
|
@@ -283,7 +283,7 @@ exports.scorer = report => {
|
|
|
283
283
|
+ summary.prevention
|
|
284
284
|
+ summary.log
|
|
285
285
|
+ summary.latency;
|
|
286
|
-
// Add the score to the report.
|
|
286
|
+
// Add the score to the report or replace the existing score of the report.
|
|
287
287
|
report.score = score;
|
|
288
288
|
}
|
|
289
289
|
// Otherwise, i.e. if none of them is a test act:
|
|
@@ -1,72 +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>__total__</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 <a href="https://www.w3.org/WAI/">web accessibility</a> tests.</p>
|
|
33
|
-
<p>Nine different <dfn>tools</dfn> (Alfa, Axe, Continuum, Equal Access, HTML CodeSniffer, Nu Html Checker, QualWeb, Testaro, and WAVE) tested the web page of __org__ at __url__ to check its compliance with various <dfn>rules</dfn>. There were a total of about 900 rules, classified into about 260 accessibility <dfn>issues</dfn>.</p>
|
|
34
|
-
<p>The results were interpreted to yield an aggregate score of __total__, where 0 would be <q>perfect</q>.</p>
|
|
35
|
-
<h2>Total score</h2>
|
|
36
|
-
<p>The total score is the sum of five components.</p>
|
|
37
|
-
<table class="allBorder secondCellRight">
|
|
38
|
-
<caption>Score summary</caption>
|
|
39
|
-
<thead>
|
|
40
|
-
<tr><th>Component</th><th>Score</th><th>Description</th></tr>
|
|
41
|
-
</thead>
|
|
42
|
-
<tbody class="headersLeft">
|
|
43
|
-
<tr><th>total</th><td>__total__</td><td>Sum of the component scores</td></tr>
|
|
44
|
-
<tr><th>issue</th><td>__issue__</td><td>Severity and number of reported defects</td></tr>
|
|
45
|
-
<tr><th>tool</th><td>__tool__</td><td>Tool-by-tool defect ratings</td></tr>
|
|
46
|
-
<tr><th>prevention</th><td>__prevention__</td><td>Failed attempts by tools to test the page</td></tr>
|
|
47
|
-
<tr><th>log</th><td>__log__</td><td>Browser warnings about the page</td></tr>
|
|
48
|
-
<tr><th>latency</th><td>__latency__</td><td>Abnormal delay in page responses</td></tr>
|
|
49
|
-
</tbody>
|
|
50
|
-
</table>
|
|
51
|
-
<h2>Issue scores</h2>
|
|
52
|
-
<p>The score of an issue depends on the <dfn>severity</dfn> (user impact and certainty) of the issue and on how many instances were reported (by one or more tools).</p>
|
|
53
|
-
<table class="allBorder secondCellRight">
|
|
54
|
-
<caption>Issue scores</caption>
|
|
55
|
-
<thead>
|
|
56
|
-
<tr><th>Issue</th><th>Score</th></tr>
|
|
57
|
-
</thead>
|
|
58
|
-
<tbody class="headersLeft">
|
|
59
|
-
__issueRows__
|
|
60
|
-
</tbody>
|
|
61
|
-
</table>
|
|
62
|
-
<h2>Itemized issues</h2>
|
|
63
|
-
<p>The reported rule violations are itemized below, issue by issue. Additional details can be inspected in the complete report at the end of this page.</p>
|
|
64
|
-
__issueDetailRows__
|
|
65
|
-
<h2>Complete report</h2>
|
|
66
|
-
<pre>__report__</pre>
|
|
67
|
-
<footer>
|
|
68
|
-
<p class="date">Produced <time itemprop="datePublished" datetime="__dateISO__">__dateSlash__</time></p>
|
|
69
|
-
</footer>
|
|
70
|
-
</main>
|
|
71
|
-
</body>
|
|
72
|
-
</html>
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// index: digester for scoring procedure tsp28.
|
|
2
|
-
|
|
3
|
-
// IMPORTS
|
|
4
|
-
|
|
5
|
-
// Issue classification
|
|
6
|
-
const {issues} = require('../../score/tic31');
|
|
7
|
-
// Function to process files.
|
|
8
|
-
const fs = require('fs/promises');
|
|
9
|
-
|
|
10
|
-
// CONSTANTS
|
|
11
|
-
|
|
12
|
-
// Digester ID.
|
|
13
|
-
const id = 'tdp31';
|
|
14
|
-
// Newlines with indentations.
|
|
15
|
-
const joiner = '\n ';
|
|
16
|
-
const innerJoiner = '\n ';
|
|
17
|
-
|
|
18
|
-
// FUNCTIONS
|
|
19
|
-
|
|
20
|
-
// Makes strings HTML-safe.
|
|
21
|
-
const htmlEscape = textOrNumber => textOrNumber
|
|
22
|
-
.toString()
|
|
23
|
-
.replace(/&/g, '&')
|
|
24
|
-
.replace(/</g, '<');
|
|
25
|
-
// Gets a row of the score-summary table.
|
|
26
|
-
const getScoreRow = (componentName, score) => `<tr><th>${componentName}</th><td>${score}</td></tr>`;
|
|
27
|
-
// Adds parameters to a query for a digest.
|
|
28
|
-
const populateQuery = (report, query) => {
|
|
29
|
-
const {sources, jobData, score} = report;
|
|
30
|
-
const {script, target, requester} = sources;
|
|
31
|
-
const {scoreProcID, summary, details} = score;
|
|
32
|
-
query.ts = script;
|
|
33
|
-
query.sp = scoreProcID;
|
|
34
|
-
query.dp = id;
|
|
35
|
-
// Add the job data to the query.
|
|
36
|
-
query.dateISO = jobData.endTime.slice(0, 10);
|
|
37
|
-
query.dateSlash = query.dateISO.replace(/-/g, '/');
|
|
38
|
-
query.org = target.what;
|
|
39
|
-
query.url = target.which;
|
|
40
|
-
query.requester = requester;
|
|
41
|
-
// Add values for the score-summary table to the query.
|
|
42
|
-
const rows = {
|
|
43
|
-
summaryRows: [],
|
|
44
|
-
issueRows: []
|
|
45
|
-
};
|
|
46
|
-
['total', 'issue', 'tool', 'prevention', 'log', 'latency'].forEach(sumItem => {
|
|
47
|
-
query[sumItem] = summary[sumItem];
|
|
48
|
-
rows.summaryRows.push(getScoreRow(sumItem, query[sumItem]));
|
|
49
|
-
});
|
|
50
|
-
// Sort the issue IDs in descending score order.
|
|
51
|
-
const issueIDs = Object.keys(details.issue);
|
|
52
|
-
issueIDs.sort((a, b) => details.issue[b].score - details.issue[a].score);
|
|
53
|
-
// Get rows for the issue-score table.
|
|
54
|
-
issueIDs.forEach(issueID => {
|
|
55
|
-
rows.issueRows.push(getScoreRow(issueID, details.issue[issueID].score));
|
|
56
|
-
});
|
|
57
|
-
// Add the rows to the query.
|
|
58
|
-
['summaryRows', 'issueRows'].forEach(rowType => {
|
|
59
|
-
query[rowType] = rows[rowType].join(innerJoiner);
|
|
60
|
-
});
|
|
61
|
-
// Add paragraph groups about the issue details to the query.
|
|
62
|
-
const issueDetailRows = [];
|
|
63
|
-
issueIDs.forEach(issueID => {
|
|
64
|
-
issueDetailRows.push(`<h3 class="bars">Issue <code>${issueID}</code></h3>`);
|
|
65
|
-
issueDetailRows.push(`<p>WCAG: ${issues[issueID].wcag || 'N/A'}</p>`);
|
|
66
|
-
const issueData = details.issue[issueID];
|
|
67
|
-
issueDetailRows.push(`<p>Score: ${issueData.score}</p>`);
|
|
68
|
-
const toolIDs = Object.keys(issueData.tools);
|
|
69
|
-
toolIDs.forEach(toolID => {
|
|
70
|
-
issueDetailRows.push(`<h4>Complaints by <code>${toolID}</code></h5>`);
|
|
71
|
-
const ruleIDs = Object.keys(issueData.tools[toolID]);
|
|
72
|
-
ruleIDs.forEach(ruleID => {
|
|
73
|
-
const ruleData = issueData.tools[toolID][ruleID];
|
|
74
|
-
issueDetailRows.push(`<h5>Rule <code>${ruleID}</code></h5>`);
|
|
75
|
-
issueDetailRows.push(`<p>Description: ${ruleData.what}</p>`);
|
|
76
|
-
issueDetailRows.push(`<p>Count of instances: ${ruleData.complaints.countTotal}</p>`);
|
|
77
|
-
issueDetailRows.push('<h6>Complaint specifics</h6>');
|
|
78
|
-
issueDetailRows.push('<ul>');
|
|
79
|
-
ruleData.complaints.texts.forEach(text => {
|
|
80
|
-
issueDetailRows.push(` <li>${htmlEscape(text || '')}</li>`);
|
|
81
|
-
});
|
|
82
|
-
issueDetailRows.push('</ul>');
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
query.issueDetailRows = issueDetailRows.join(innerJoiner);
|
|
87
|
-
// Add an HTML-safe copy of the report to the query to be appended to the digest.
|
|
88
|
-
const reportJSON = JSON.stringify(report, null, 2);
|
|
89
|
-
const reportJSONSafe = htmlEscape(reportJSON);
|
|
90
|
-
query.report = reportJSONSafe;
|
|
91
|
-
};
|
|
92
|
-
// Returns a digested report.
|
|
93
|
-
exports.digester = async report => {
|
|
94
|
-
// Create a query to replace placeholders.
|
|
95
|
-
const query = {};
|
|
96
|
-
populateQuery(report, query);
|
|
97
|
-
// Get the template.
|
|
98
|
-
let template = await fs.readFile(`${__dirname}/index.html`, 'utf8');
|
|
99
|
-
// Replace its placeholders.
|
|
100
|
-
Object.keys(query).forEach(param => {
|
|
101
|
-
template = template.replace(new RegExp(`__${param}__`, 'g'), query[param]);
|
|
102
|
-
});
|
|
103
|
-
// Return the digest.
|
|
104
|
-
return template;
|
|
105
|
-
};
|
|
@@ -1,72 +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>__total__</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 <a href="https://www.w3.org/WAI/">web accessibility</a> tests.</p>
|
|
33
|
-
<p>Nine different <dfn>tools</dfn> (Alfa, Axe, Continuum, Equal Access, HTML CodeSniffer, Nu Html Checker, QualWeb, Testaro, and WAVE) tested the web page of __org__ at __url__ to check its compliance with various <dfn>rules</dfn>. There were a total of about 900 rules, classified into about 260 accessibility <dfn>issues</dfn>.</p>
|
|
34
|
-
<p>The results were interpreted to yield an aggregate score of __total__, where 0 would be <q>perfect</q>.</p>
|
|
35
|
-
<h2>Total score</h2>
|
|
36
|
-
<p>The total score is the sum of five components.</p>
|
|
37
|
-
<table class="allBorder secondCellRight">
|
|
38
|
-
<caption>Score summary</caption>
|
|
39
|
-
<thead>
|
|
40
|
-
<tr><th>Component</th><th>Score</th><th>Description</th></tr>
|
|
41
|
-
</thead>
|
|
42
|
-
<tbody class="headersLeft">
|
|
43
|
-
<tr><th>total</th><td>__total__</td><td>Sum of the component scores</td></tr>
|
|
44
|
-
<tr><th>issue</th><td>__issue__</td><td>Severity and number of reported defects</td></tr>
|
|
45
|
-
<tr><th>tool</th><td>__tool__</td><td>Tool-by-tool defect ratings</td></tr>
|
|
46
|
-
<tr><th>prevention</th><td>__prevention__</td><td>Failed attempts by tools to test the page</td></tr>
|
|
47
|
-
<tr><th>log</th><td>__log__</td><td>Browser warnings about the page</td></tr>
|
|
48
|
-
<tr><th>latency</th><td>__latency__</td><td>Abnormal delay in page responses</td></tr>
|
|
49
|
-
</tbody>
|
|
50
|
-
</table>
|
|
51
|
-
<h2>Issue scores</h2>
|
|
52
|
-
<p>The score of an issue depends on the <dfn>severity</dfn> (user impact and certainty) of the issue and on how many instances were reported (by one or more tools).</p>
|
|
53
|
-
<table class="allBorder secondCellRight">
|
|
54
|
-
<caption>Issue scores</caption>
|
|
55
|
-
<thead>
|
|
56
|
-
<tr><th>Issue</th><th>Score</th></tr>
|
|
57
|
-
</thead>
|
|
58
|
-
<tbody class="headersLeft">
|
|
59
|
-
__issueRows__
|
|
60
|
-
</tbody>
|
|
61
|
-
</table>
|
|
62
|
-
<h2>Itemized issues</h2>
|
|
63
|
-
<p>The reported rule violations are itemized below, issue by issue. Additional details can be inspected in the complete report at the end of this page.</p>
|
|
64
|
-
__issueDetailRows__
|
|
65
|
-
<h2>Complete report</h2>
|
|
66
|
-
<pre>__report__</pre>
|
|
67
|
-
<footer>
|
|
68
|
-
<p class="date">Produced <time itemprop="datePublished" datetime="__dateISO__">__dateSlash__</time></p>
|
|
69
|
-
</footer>
|
|
70
|
-
</main>
|
|
71
|
-
</body>
|
|
72
|
-
</html>
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// index: digester for scoring procedure tsp28.
|
|
2
|
-
|
|
3
|
-
// IMPORTS
|
|
4
|
-
|
|
5
|
-
// Issue classification
|
|
6
|
-
const {issues} = require('../../score/tic33');
|
|
7
|
-
// Function to process files.
|
|
8
|
-
const fs = require('fs/promises');
|
|
9
|
-
|
|
10
|
-
// CONSTANTS
|
|
11
|
-
|
|
12
|
-
// Digester ID.
|
|
13
|
-
const id = 'tdp33';
|
|
14
|
-
// Newlines with indentations.
|
|
15
|
-
const joiner = '\n ';
|
|
16
|
-
const innerJoiner = '\n ';
|
|
17
|
-
|
|
18
|
-
// FUNCTIONS
|
|
19
|
-
|
|
20
|
-
// Makes strings HTML-safe.
|
|
21
|
-
const htmlEscape = textOrNumber => textOrNumber
|
|
22
|
-
.toString()
|
|
23
|
-
.replace(/&/g, '&')
|
|
24
|
-
.replace(/</g, '<');
|
|
25
|
-
// Gets a row of the score-summary table.
|
|
26
|
-
const getScoreRow = (componentName, score) => `<tr><th>${componentName}</th><td>${score}</td></tr>`;
|
|
27
|
-
// Adds parameters to a query for a digest.
|
|
28
|
-
const populateQuery = (report, query) => {
|
|
29
|
-
const {sources, jobData, score} = report;
|
|
30
|
-
const {script, target, requester} = sources;
|
|
31
|
-
const {scoreProcID, summary, details} = score;
|
|
32
|
-
query.ts = script;
|
|
33
|
-
query.sp = scoreProcID;
|
|
34
|
-
query.dp = id;
|
|
35
|
-
// Add the job data to the query.
|
|
36
|
-
query.dateISO = jobData.endTime.slice(0, 10);
|
|
37
|
-
query.dateSlash = query.dateISO.replace(/-/g, '/');
|
|
38
|
-
query.org = target.what;
|
|
39
|
-
query.url = target.which;
|
|
40
|
-
query.requester = requester;
|
|
41
|
-
// Add values for the score-summary table to the query.
|
|
42
|
-
const rows = {
|
|
43
|
-
summaryRows: [],
|
|
44
|
-
issueRows: []
|
|
45
|
-
};
|
|
46
|
-
['total', 'issue', 'tool', 'prevention', 'log', 'latency'].forEach(sumItem => {
|
|
47
|
-
query[sumItem] = summary[sumItem];
|
|
48
|
-
rows.summaryRows.push(getScoreRow(sumItem, query[sumItem]));
|
|
49
|
-
});
|
|
50
|
-
// Sort the issue IDs in descending score order.
|
|
51
|
-
const issueIDs = Object.keys(details.issue);
|
|
52
|
-
issueIDs.sort((a, b) => details.issue[b].score - details.issue[a].score);
|
|
53
|
-
// Get rows for the issue-score table.
|
|
54
|
-
issueIDs.forEach(issueID => {
|
|
55
|
-
rows.issueRows.push(getScoreRow(issueID, details.issue[issueID].score));
|
|
56
|
-
});
|
|
57
|
-
// Add the rows to the query.
|
|
58
|
-
['summaryRows', 'issueRows'].forEach(rowType => {
|
|
59
|
-
query[rowType] = rows[rowType].join(innerJoiner);
|
|
60
|
-
});
|
|
61
|
-
// Add paragraph groups about the issue details to the query.
|
|
62
|
-
const issueDetailRows = [];
|
|
63
|
-
issueIDs.forEach(issueID => {
|
|
64
|
-
issueDetailRows.push(`<h3 class="bars">Issue <code>${issueID}</code></h3>`);
|
|
65
|
-
issueDetailRows.push(`<p>WCAG: ${issues[issueID].wcag || 'N/A'}</p>`);
|
|
66
|
-
const issueData = details.issue[issueID];
|
|
67
|
-
issueDetailRows.push(`<p>Score: ${issueData.score}</p>`);
|
|
68
|
-
const toolIDs = Object.keys(issueData.tools);
|
|
69
|
-
toolIDs.forEach(toolID => {
|
|
70
|
-
issueDetailRows.push(`<h4>Complaints by <code>${toolID}</code></h5>`);
|
|
71
|
-
const ruleIDs = Object.keys(issueData.tools[toolID]);
|
|
72
|
-
ruleIDs.forEach(ruleID => {
|
|
73
|
-
const ruleData = issueData.tools[toolID][ruleID];
|
|
74
|
-
issueDetailRows.push(`<h5>Rule <code>${ruleID}</code></h5>`);
|
|
75
|
-
issueDetailRows.push(`<p>Description: ${ruleData.what}</p>`);
|
|
76
|
-
issueDetailRows.push(`<p>Count of instances: ${ruleData.complaints.countTotal}</p>`);
|
|
77
|
-
issueDetailRows.push('<h6>Complaint specifics</h6>');
|
|
78
|
-
issueDetailRows.push('<ul>');
|
|
79
|
-
ruleData.complaints.texts.forEach(text => {
|
|
80
|
-
issueDetailRows.push(` <li>${htmlEscape(text || '')}</li>`);
|
|
81
|
-
});
|
|
82
|
-
issueDetailRows.push('</ul>');
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
query.issueDetailRows = issueDetailRows.join(innerJoiner);
|
|
87
|
-
// Add an HTML-safe copy of the report to the query to be appended to the digest.
|
|
88
|
-
const reportJSON = JSON.stringify(report, null, 2);
|
|
89
|
-
const reportJSONSafe = htmlEscape(reportJSON);
|
|
90
|
-
query.report = reportJSONSafe;
|
|
91
|
-
};
|
|
92
|
-
// Returns a digested report.
|
|
93
|
-
exports.digester = async report => {
|
|
94
|
-
// Create a query to replace placeholders.
|
|
95
|
-
const query = {};
|
|
96
|
-
populateQuery(report, query);
|
|
97
|
-
// Get the template.
|
|
98
|
-
let template = await fs.readFile(`${__dirname}/index.html`, 'utf8');
|
|
99
|
-
// Replace its placeholders.
|
|
100
|
-
Object.keys(query).forEach(param => {
|
|
101
|
-
template = template.replace(new RegExp(`__${param}__`, 'g'), query[param]);
|
|
102
|
-
});
|
|
103
|
-
// Return the digest.
|
|
104
|
-
return template;
|
|
105
|
-
};
|
|
@@ -1,82 +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>__total__</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
|
-
<table class="allBorder">
|
|
31
|
-
<caption>Score history</caption>
|
|
32
|
-
<thead>
|
|
33
|
-
<tr><th>Date and time</th><th>Score</th></tr>
|
|
34
|
-
</thead>
|
|
35
|
-
<tbody>
|
|
36
|
-
__scoreHistory__
|
|
37
|
-
</tbody>
|
|
38
|
-
</table>
|
|
39
|
-
</header>
|
|
40
|
-
<h2>Introduction</h2>
|
|
41
|
-
<p>This is a digest of results from a battery of <a href="https://www.w3.org/WAI/">web accessibility</a> tests.</p>
|
|
42
|
-
<p>Nine different <dfn>tools</dfn> (Alfa, Axe, Continuum, Equal Access, HTML CodeSniffer, Nu Html Checker, QualWeb, Testaro, and WAVE) tested the web page of __org__ at __url__ to check its compliance with various <dfn>rules</dfn>. There were a total of about 900 rules, classified into about 260 accessibility <dfn>issues</dfn>.</p>
|
|
43
|
-
<p>The results were interpreted to yield a total score of __total__, where 0 would be <q>perfect</q>.
|
|
44
|
-
<p>This history of total scores from this testing series on the same page is shown above.</p>
|
|
45
|
-
<h2>Total score</h2>
|
|
46
|
-
<p>The total score is the sum of five components.</p>
|
|
47
|
-
<table class="allBorder secondCellRight">
|
|
48
|
-
<caption>Score summary</caption>
|
|
49
|
-
<thead>
|
|
50
|
-
<tr><th>Component</th><th>Score</th><th>Description</th></tr>
|
|
51
|
-
</thead>
|
|
52
|
-
<tbody class="headersLeft">
|
|
53
|
-
<tr><th>total</th><td>__total__</td><td>Sum of the component scores</td></tr>
|
|
54
|
-
<tr><th>issue</th><td>__issue__</td><td>Severity and number of reported defects</td></tr>
|
|
55
|
-
<tr><th>tool</th><td>__tool__</td><td>Tool-by-tool defect ratings</td></tr>
|
|
56
|
-
<tr><th>prevention</th><td>__prevention__</td><td>Failed attempts by tools to test the page</td></tr>
|
|
57
|
-
<tr><th>log</th><td>__log__</td><td>Browser warnings about the page</td></tr>
|
|
58
|
-
<tr><th>latency</th><td>__latency__</td><td>Abnormal delay in page responses</td></tr>
|
|
59
|
-
</tbody>
|
|
60
|
-
</table>
|
|
61
|
-
<h2>Issue scores</h2>
|
|
62
|
-
<p>The score of an issue depends on the <dfn>severity</dfn> (user impact and certainty) of the issue and on how many instances were reported (by one or more tools).</p>
|
|
63
|
-
<table class="allBorder secondCellRight">
|
|
64
|
-
<caption>Issue scores</caption>
|
|
65
|
-
<thead>
|
|
66
|
-
<tr><th>Issue</th><th>Score</th></tr>
|
|
67
|
-
</thead>
|
|
68
|
-
<tbody class="headersLeft">
|
|
69
|
-
__issueRows__
|
|
70
|
-
</tbody>
|
|
71
|
-
</table>
|
|
72
|
-
<h2>Itemized issues</h2>
|
|
73
|
-
<p>The reported rule violations are itemized below, issue by issue. Additional details can be inspected in the complete report at the end of this page.</p>
|
|
74
|
-
__issueDetailRows__
|
|
75
|
-
<h2>Complete report</h2>
|
|
76
|
-
<pre>__report__</pre>
|
|
77
|
-
<footer>
|
|
78
|
-
<p class="date">Produced <time itemprop="datePublished" datetime="__dateISO__">__dateSlash__</time></p>
|
|
79
|
-
</footer>
|
|
80
|
-
</main>
|
|
81
|
-
</body>
|
|
82
|
-
</html>
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// index: digester for scoring procedure tsp28.
|
|
2
|
-
|
|
3
|
-
// IMPORTS
|
|
4
|
-
|
|
5
|
-
// Issue classification
|
|
6
|
-
const {issues} = require('../../score/tic33');
|
|
7
|
-
// Function to process files.
|
|
8
|
-
const fs = require('fs/promises');
|
|
9
|
-
|
|
10
|
-
// CONSTANTS
|
|
11
|
-
|
|
12
|
-
// Digester ID.
|
|
13
|
-
const id = 'tdp33';
|
|
14
|
-
// Newlines with indentations.
|
|
15
|
-
const joiner = '\n ';
|
|
16
|
-
const innerJoiner = '\n ';
|
|
17
|
-
|
|
18
|
-
// FUNCTIONS
|
|
19
|
-
|
|
20
|
-
// Makes strings HTML-safe.
|
|
21
|
-
const htmlEscape = textOrNumber => textOrNumber
|
|
22
|
-
.toString()
|
|
23
|
-
.replace(/&/g, '&')
|
|
24
|
-
.replace(/</g, '<');
|
|
25
|
-
// Gets a row of the score-summary table.
|
|
26
|
-
const getScoreRow
|
|
27
|
-
= (componentName, score) => `<tr><th>${componentName}</th><td class="right">${score}</td></tr>`;
|
|
28
|
-
// Adds parameters to a query for a digest.
|
|
29
|
-
const populateQuery = (report, query) => {
|
|
30
|
-
const {sources, jobData, score} = report;
|
|
31
|
-
const {script, target, requester} = sources;
|
|
32
|
-
const {scoreProcID, summary, details, history} = score;
|
|
33
|
-
query.ts = script;
|
|
34
|
-
query.sp = scoreProcID;
|
|
35
|
-
query.dp = id;
|
|
36
|
-
// Add the job data to the query.
|
|
37
|
-
query.dateISO = jobData.endTime.slice(0, 10);
|
|
38
|
-
query.dateSlash = query.dateISO.replace(/-/g, '/');
|
|
39
|
-
query.org = target.what;
|
|
40
|
-
query.url = target.which;
|
|
41
|
-
query.requester = requester;
|
|
42
|
-
// Add the score history to the query.
|
|
43
|
-
const rows = {
|
|
44
|
-
summaryRows: [],
|
|
45
|
-
historyRows: [],
|
|
46
|
-
issueRows: []
|
|
47
|
-
};
|
|
48
|
-
['total', 'issue', 'tool', 'prevention', 'log', 'latency'].forEach(sumItem => {
|
|
49
|
-
query[sumItem] = summary[sumItem];
|
|
50
|
-
rows.summaryRows.push(getScoreRow(sumItem, query[sumItem]));
|
|
51
|
-
});
|
|
52
|
-
history.forEach(event => {
|
|
53
|
-
rows.historyRows.push(getScoreRow(... event));
|
|
54
|
-
});
|
|
55
|
-
query.scoreHistory = rows.historyRows.join(innerJoiner);
|
|
56
|
-
// Sort the issue IDs in descending score order.
|
|
57
|
-
const issueIDs = Object.keys(details.issue);
|
|
58
|
-
issueIDs.sort((a, b) => details.issue[b].score - details.issue[a].score);
|
|
59
|
-
// Get rows for the issue-score table.
|
|
60
|
-
issueIDs.forEach(issueID => {
|
|
61
|
-
rows.issueRows.push(getScoreRow(issueID, details.issue[issueID].score));
|
|
62
|
-
});
|
|
63
|
-
// Add the rows to the query.
|
|
64
|
-
['summaryRows', 'issueRows'].forEach(rowType => {
|
|
65
|
-
query[rowType] = rows[rowType].join(innerJoiner);
|
|
66
|
-
});
|
|
67
|
-
// Add paragraph groups about the issue details to the query.
|
|
68
|
-
const issueDetailRows = [];
|
|
69
|
-
issueIDs.forEach(issueID => {
|
|
70
|
-
issueDetailRows.push(`<h3 class="bars">Issue <code>${issueID}</code></h3>`);
|
|
71
|
-
issueDetailRows.push(`<p>WCAG: ${issues[issueID].wcag || 'N/A'}</p>`);
|
|
72
|
-
const issueData = details.issue[issueID];
|
|
73
|
-
issueDetailRows.push(`<p>Score: ${issueData.score}</p>`);
|
|
74
|
-
const toolIDs = Object.keys(issueData.tools);
|
|
75
|
-
toolIDs.forEach(toolID => {
|
|
76
|
-
issueDetailRows.push(`<h4>Complaints by <code>${toolID}</code></h5>`);
|
|
77
|
-
const ruleIDs = Object.keys(issueData.tools[toolID]);
|
|
78
|
-
ruleIDs.forEach(ruleID => {
|
|
79
|
-
const ruleData = issueData.tools[toolID][ruleID];
|
|
80
|
-
issueDetailRows.push(`<h5>Rule <code>${ruleID}</code></h5>`);
|
|
81
|
-
issueDetailRows.push(`<p>Description: ${ruleData.what}</p>`);
|
|
82
|
-
issueDetailRows.push(`<p>Count of instances: ${ruleData.complaints.countTotal}</p>`);
|
|
83
|
-
issueDetailRows.push('<h6>Complaint specifics</h6>');
|
|
84
|
-
issueDetailRows.push('<ul>');
|
|
85
|
-
ruleData.complaints.texts.forEach(text => {
|
|
86
|
-
issueDetailRows.push(` <li>${htmlEscape(text || '')}</li>`);
|
|
87
|
-
});
|
|
88
|
-
issueDetailRows.push('</ul>');
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
query.issueDetailRows = issueDetailRows.join(innerJoiner);
|
|
93
|
-
// Add an HTML-safe copy of the report to the query to be appended to the digest.
|
|
94
|
-
const reportJSON = JSON.stringify(report, null, 2);
|
|
95
|
-
const reportJSONSafe = htmlEscape(reportJSON);
|
|
96
|
-
query.report = reportJSONSafe;
|
|
97
|
-
};
|
|
98
|
-
// Returns a digested report.
|
|
99
|
-
exports.digester = async report => {
|
|
100
|
-
// Create a query to replace placeholders.
|
|
101
|
-
const query = {};
|
|
102
|
-
populateQuery(report, query);
|
|
103
|
-
// Get the template.
|
|
104
|
-
let template = await fs.readFile(`${__dirname}/index.html`, 'utf8');
|
|
105
|
-
// Replace its placeholders.
|
|
106
|
-
Object.keys(query).forEach(param => {
|
|
107
|
-
template = template.replace(new RegExp(`__${param}__`, 'g'), query[param]);
|
|
108
|
-
});
|
|
109
|
-
// Return the digest.
|
|
110
|
-
return template;
|
|
111
|
-
};
|