testilo 22.0.0 → 22.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.
- package/package.json +1 -1
- package/procs/score/tic40.js +39 -2
- package/procs/digest/tdp39/index.html +0 -56
- package/procs/digest/tdp39/index.js +0 -105
- package/procs/score/tic39.js +0 -8355
- package/procs/score/tsp39.js +0 -308
package/package.json
CHANGED
package/procs/score/tic40.js
CHANGED
|
@@ -4403,6 +4403,13 @@ exports.issues = {
|
|
|
4403
4403
|
what: 'Heading levels do not increase by only one'
|
|
4404
4404
|
}
|
|
4405
4405
|
},
|
|
4406
|
+
ed11y: {
|
|
4407
|
+
headingLevelSkipped: {
|
|
4408
|
+
variable: false,
|
|
4409
|
+
quality: 1,
|
|
4410
|
+
what: 'Heading level is more than 1 greater than that of the previous heading'
|
|
4411
|
+
}
|
|
4412
|
+
},
|
|
4406
4413
|
wave: {
|
|
4407
4414
|
heading_skipped: {
|
|
4408
4415
|
variable: false,
|
|
@@ -4588,6 +4595,21 @@ exports.issues = {
|
|
|
4588
4595
|
}
|
|
4589
4596
|
}
|
|
4590
4597
|
},
|
|
4598
|
+
headingLength: {
|
|
4599
|
+
summary: 'heading abnormally long',
|
|
4600
|
+
why: 'User has difficulty understanding the topic of a part of the document',
|
|
4601
|
+
wcag: '1.3.1',
|
|
4602
|
+
weight: 1,
|
|
4603
|
+
tools: {
|
|
4604
|
+
ed11y: {
|
|
4605
|
+
headingIsLong: {
|
|
4606
|
+
variable: false,
|
|
4607
|
+
quality: 1,
|
|
4608
|
+
what: 'Heading is longer than 160 characters'
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4611
|
+
}
|
|
4612
|
+
},
|
|
4591
4613
|
justification: {
|
|
4592
4614
|
summary: 'text fully justified',
|
|
4593
4615
|
why: 'Text is difficult to read',
|
|
@@ -6921,8 +6943,8 @@ exports.issues = {
|
|
|
6921
6943
|
}
|
|
6922
6944
|
}
|
|
6923
6945
|
},
|
|
6924
|
-
|
|
6925
|
-
summary: 'link name
|
|
6946
|
+
linkVaguenessRisk: {
|
|
6947
|
+
summary: 'link name vague',
|
|
6926
6948
|
why: 'User may misunderstand what a link points to',
|
|
6927
6949
|
wcag: '2.4.4',
|
|
6928
6950
|
weight: 1,
|
|
@@ -6950,6 +6972,21 @@ exports.issues = {
|
|
|
6950
6972
|
}
|
|
6951
6973
|
}
|
|
6952
6974
|
},
|
|
6975
|
+
linkFileName: {
|
|
6976
|
+
summary: 'link names a file instead of a purpose',
|
|
6977
|
+
why: 'User may fail to understand what a link points to',
|
|
6978
|
+
wcag: '2.4.4',
|
|
6979
|
+
weight: 1,
|
|
6980
|
+
tools: {
|
|
6981
|
+
ed11y: {
|
|
6982
|
+
linkTextIsURL: {
|
|
6983
|
+
variable: false,
|
|
6984
|
+
quality: 1,
|
|
6985
|
+
what: 'Name of the element is a file reference instead of a link purpose'
|
|
6986
|
+
}
|
|
6987
|
+
}
|
|
6988
|
+
}
|
|
6989
|
+
},
|
|
6953
6990
|
nonWebLink: {
|
|
6954
6991
|
summary: 'link to non-web resource',
|
|
6955
6992
|
why: 'Document points to harder-to-use resources',
|
|
@@ -1,56 +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
|
-
<tr>
|
|
30
|
-
<th>Full report</th><td><a href="__reportURL__"><code>__reportURL__</code></a></td>
|
|
31
|
-
</tr>
|
|
32
|
-
</table>
|
|
33
|
-
</header>
|
|
34
|
-
<h2>Introduction</h2>
|
|
35
|
-
<p>How <a href="https://www.w3.org/WAI/">accessible</a> is the __org__ web page at <a href="__url__"><code>__url__</code></a>?</p>
|
|
36
|
-
<p>This digest can help answer that question. Nine different tools (Alfa, ASLint, Axe, Equal Access, HTML CodeSniffer, Nu Html Checker, QualWeb, Testaro, and WAVE) tested the page to check its compliance with their accessibility rules. In all, the tools define about 915 rules, which are classified here into about 300 accessibility issues.</p>
|
|
37
|
-
<p>The results were interpreted to yield a score, with 0 being ideal. The score for this page was __total__, the sum of __issueCount__ for the count of issues, __issue__ for specific issues, __solo__ for unclassified rule violations, __tool__ for tool-by-tool ratings, __prevention__ for the page preventing tools from running, __log__ for browser warnings, and __latency__ for delayed page responses.</p>
|
|
38
|
-
<h2>Issue summary</h2>
|
|
39
|
-
<table class="allBorder thirdCellRight">
|
|
40
|
-
<caption>Summary of issues</caption>
|
|
41
|
-
<thead>
|
|
42
|
-
<tr><th>Issue</th><th>WCAG</th><th>Score</th><th>Tools reporting the issue</th></tr>
|
|
43
|
-
</thead>
|
|
44
|
-
<tbody class="headersLeft">
|
|
45
|
-
__issueRows__
|
|
46
|
-
</tbody>
|
|
47
|
-
</table>
|
|
48
|
-
<h2>Itemized issues</h2>
|
|
49
|
-
<p>The reported rule violations are itemized below, issue by issue. Additional details can be inspected in the <a href="__reportURL__">full report</a>.</p>
|
|
50
|
-
__issueDetailRows__
|
|
51
|
-
<footer>
|
|
52
|
-
<p class="date">Produced <time itemprop="datePublished" datetime="__dateISO__">__dateSlash__</time></p>
|
|
53
|
-
</footer>
|
|
54
|
-
</main>
|
|
55
|
-
</body>
|
|
56
|
-
</html>
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// index: digester for scoring procedure tsp39.
|
|
2
|
-
|
|
3
|
-
// IMPORTS
|
|
4
|
-
|
|
5
|
-
// Module to classify tool rules into issues
|
|
6
|
-
const {issues} = require('../../score/tic39');
|
|
7
|
-
// Module to process files.
|
|
8
|
-
const fs = require('fs/promises');
|
|
9
|
-
|
|
10
|
-
// CONSTANTS
|
|
11
|
-
|
|
12
|
-
// Digester ID.
|
|
13
|
-
const id = 'tdp39';
|
|
14
|
-
// Newline with indentations.
|
|
15
|
-
const innerJoiner = '\n ';
|
|
16
|
-
|
|
17
|
-
// FUNCTIONS
|
|
18
|
-
|
|
19
|
-
// Gets a row of the score-summary table.
|
|
20
|
-
const getScoreRow = (componentName, score) => `<tr><th>${componentName}</th><td>${score}</td></tr>`;
|
|
21
|
-
// Gets a row of the issue-score-summary table.
|
|
22
|
-
const getIssueScoreRow = (summary, wcag, score, tools) => {
|
|
23
|
-
const toolList = tools.map(tool => `<code>${tool}</code>`).join(', ');
|
|
24
|
-
return `<tr><th>${summary}</th><td>${wcag}<td>${score}</td><td>${toolList}</tr>`;
|
|
25
|
-
};
|
|
26
|
-
// Adds parameters to a query for a digest.
|
|
27
|
-
const populateQuery = (report, query) => {
|
|
28
|
-
const {sources, jobData, score} = report;
|
|
29
|
-
const {script, target, requester} = sources;
|
|
30
|
-
const {scoreProcID, summary, details} = score;
|
|
31
|
-
query.ts = script;
|
|
32
|
-
query.sp = scoreProcID;
|
|
33
|
-
query.dp = id;
|
|
34
|
-
// Add the job data to the query.
|
|
35
|
-
query.dateISO = jobData.endTime.slice(0, 10);
|
|
36
|
-
query.dateSlash = query.dateISO.replace(/-/g, '/');
|
|
37
|
-
query.org = target.what;
|
|
38
|
-
query.url = target.which;
|
|
39
|
-
query.requester = requester;
|
|
40
|
-
query.reportURL = `report?jobID=${report.id}`;
|
|
41
|
-
// Add values for the score-summary table to the query.
|
|
42
|
-
const rows = {
|
|
43
|
-
summaryRows: [],
|
|
44
|
-
issueRows: []
|
|
45
|
-
};
|
|
46
|
-
['total', 'issueCount', 'issue', 'solo', 'tool', 'prevention', 'log', 'latency']
|
|
47
|
-
.forEach(sumItem => {
|
|
48
|
-
query[sumItem] = summary[sumItem];
|
|
49
|
-
rows.summaryRows.push(getScoreRow(sumItem, query[sumItem]));
|
|
50
|
-
});
|
|
51
|
-
// Sort the issue IDs in descending score order.
|
|
52
|
-
const issueIDs = Object.keys(details.issue);
|
|
53
|
-
issueIDs.sort((a, b) => details.issue[b].score - details.issue[a].score);
|
|
54
|
-
// Get rows for the issue-score table.
|
|
55
|
-
issueIDs.forEach(issueID => {
|
|
56
|
-
const {score, tools} = details.issue[issueID];
|
|
57
|
-
if (issues[issueID]) {
|
|
58
|
-
rows.issueRows.push(
|
|
59
|
-
getIssueScoreRow(issues[issueID].summary, issues[issueID].wcag, score, Object.keys(tools))
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
console.log(`ERROR: Issue ${issueID} not found`);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
// Add the rows to the query.
|
|
67
|
-
['summaryRows', 'issueRows'].forEach(rowType => {
|
|
68
|
-
query[rowType] = rows[rowType].join(innerJoiner);
|
|
69
|
-
});
|
|
70
|
-
// Add paragraph groups about the issue details to the query.
|
|
71
|
-
const issueDetailRows = [];
|
|
72
|
-
issueIDs.forEach(issueID => {
|
|
73
|
-
issueDetailRows.push(`<h3 class="bars">Issue: ${issues[issueID].summary}</h3>`);
|
|
74
|
-
issueDetailRows.push(`<p>Impact: ${issues[issueID].why || 'N/A'}</p>`);
|
|
75
|
-
issueDetailRows.push(`<p>WCAG: ${issues[issueID].wcag || 'N/A'}</p>`);
|
|
76
|
-
const issueData = details.issue[issueID];
|
|
77
|
-
issueDetailRows.push(`<p>Score: ${issueData.score}</p>`);
|
|
78
|
-
const toolIDs = Object.keys(issueData.tools);
|
|
79
|
-
toolIDs.forEach(toolID => {
|
|
80
|
-
issueDetailRows.push(`<h4>Violations of <code>${toolID}</code> rules</h5>`);
|
|
81
|
-
const ruleIDs = Object.keys(issueData.tools[toolID]);
|
|
82
|
-
ruleIDs.forEach(ruleID => {
|
|
83
|
-
const ruleData = issueData.tools[toolID][ruleID];
|
|
84
|
-
issueDetailRows.push(`<h5>Rule <code>${ruleID}</code></h5>`);
|
|
85
|
-
issueDetailRows.push(`<p>Description: ${ruleData.what}</p>`);
|
|
86
|
-
issueDetailRows.push(`<p>Count of instances: ${ruleData.complaints.countTotal}</p>`);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
query.issueDetailRows = issueDetailRows.join(innerJoiner);
|
|
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
|
-
};
|