testilo 10.3.1 → 11.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/README.md +188 -190
- package/batch.js +60 -0
- package/call.js +9 -4
- package/compare.js +2 -2
- package/merge.js +0 -6
- package/package.json +1 -1
- package/procs/compare/cp20sqrt/index.js +7 -10
- package/procs/compare/{cp15b → tcp24}/index.html +5 -5
- package/procs/compare/{cp12a → tcp24}/index.js +13 -20
- package/procs/score/{tic24.js → tic26.js} +205 -199
- package/procs/score/tsp24.js +8 -2
- package/procs/score/tsp26.js +120 -0
- package/score.js +2 -8
- package/procs/compare/cp0/index.html +0 -46
- package/procs/compare/cp0/index.js +0 -70
- package/procs/compare/cp1/index.html +0 -46
- package/procs/compare/cp1/index.js +0 -71
- package/procs/compare/cp12a/index.html +0 -47
- package/procs/compare/cp12b/index.html +0 -47
- package/procs/compare/cp12b/index.js +0 -71
- package/procs/compare/cp14a/index.html +0 -47
- package/procs/compare/cp14a/index.js +0 -71
- package/procs/compare/cp15a/index.html +0 -47
- package/procs/compare/cp15a/index.js +0 -71
- package/procs/compare/cp15b/index.js +0 -74
- package/procs/compare/cp16a/index.html +0 -47
- package/procs/compare/cp16a/index.js +0 -74
- package/procs/compare/cp16b/index.html +0 -47
- package/procs/compare/cp16b/index.js +0 -74
- package/procs/digest/dp10a/index.html +0 -137
- package/procs/digest/dp10a/index.js +0 -402
- package/procs/digest/dp10b/index.html +0 -74
- package/procs/digest/dp10b/index.js +0 -130
- package/procs/digest/dp10c/index.html +0 -55
- package/procs/digest/dp10c/index.js +0 -129
- package/procs/digest/dp11a/index.html +0 -76
- package/procs/digest/dp11a/index.js +0 -127
- package/procs/digest/dp12a/index.html +0 -78
- package/procs/digest/dp12a/index.js +0 -126
- package/procs/digest/dp12b/index.html +0 -78
- package/procs/digest/dp12b/index.js +0 -126
- package/procs/digest/dp13a/index.html +0 -78
- package/procs/digest/dp13a/index.js +0 -126
- package/procs/digest/dp14a/index.html +0 -79
- package/procs/digest/dp14a/index.js +0 -126
- package/procs/digest/dp15a/index.html +0 -80
- package/procs/digest/dp15a/index.js +0 -126
- package/procs/digest/dp16a/index.html +0 -80
- package/procs/digest/dp16a/index.js +0 -126
- package/procs/digest/dp16b/index.html +0 -80
- package/procs/digest/dp16b/index.js +0 -126
- package/procs/digest/dp18a/index.html +0 -80
- package/procs/digest/dp18a/index.js +0 -129
- package/procs/digest/dp20c/index.html +0 -54
- package/procs/digest/dp20c/index.js +0 -117
- package/procs/digest/dp20d/index.html +0 -54
- package/procs/digest/dp20d/index.js +0 -121
- package/procs/digest/tdp09a/index.html +0 -126
- package/procs/digest/tdp09a/index.js +0 -381
- package/procs/digest/tdp22/index.html +0 -54
- package/procs/digest/tdp22/index.js +0 -120
- package/procs/score/tic21.js +0 -6868
- package/procs/score/tic22.js +0 -6911
- package/procs/score/tic23.js +0 -6924
- package/procs/score/tsp21.js +0 -720
- package/procs/score/tsp22.js +0 -720
- package/procs/score/tsp23.js +0 -720
- package/specs/batches/orgs.json +0 -43
- package/specs/scripts/ts21.json +0 -213
- package/specs/scripts/ts23.json +0 -219
- package/specs/scripts/ts24.json +0 -225
package/call.js
CHANGED
|
@@ -124,11 +124,16 @@ const callDigest = async (digesterID, selector = '') => {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
// Fulfills a comparison request.
|
|
127
|
+
// Get the scored reports to be scored.
|
|
127
128
|
const callCompare = async (compareProcID, comparisonNameBase) => {
|
|
128
|
-
await
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
);
|
|
129
|
+
const reports = await getReports('scored');
|
|
130
|
+
const comparerDir = `${functionDir}/compare/${compareProcID}`;
|
|
131
|
+
const comparisonTemplate = await fs.readFile(`${comparerDir}/index.html`, 'utf8');
|
|
132
|
+
const comparer = require(`${comparerDir}/index`).getQuery;
|
|
133
|
+
const comparison = await compare(comparisonTemplate, comparer, reports);
|
|
134
|
+
const comparisonDir = `${reportDir}/comparative`;
|
|
135
|
+
await fs.writeFile(`${comparisonDir}/${comparisonNameBase}.html`, comparison);
|
|
136
|
+
console.log(`Comparison completed. Proc: ${compareProcID}. Directory: ${comparisonDir}.`);
|
|
132
137
|
};
|
|
133
138
|
|
|
134
139
|
// ########## OPERATION
|
package/compare.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
const replaceHolders = (template, query) => template
|
|
10
10
|
.replace(/__([a-zA-Z]+)__/g, (ph, qp) => query[qp]);
|
|
11
11
|
// Compares the scored reports and returns a comparison.
|
|
12
|
-
exports.compare = (comparisonTemplate, comparer, reports) => {
|
|
12
|
+
exports.compare = async (comparisonTemplate, comparer, reports) => {
|
|
13
13
|
// Create a query.
|
|
14
14
|
const query = {};
|
|
15
15
|
// Populate the query.
|
|
16
|
-
comparer(reports, query);
|
|
16
|
+
await comparer(reports, query);
|
|
17
17
|
// Use it to create a comparison.
|
|
18
18
|
const comparison = replaceHolders(comparisonTemplate, query);
|
|
19
19
|
// Return the comparison.
|
package/merge.js
CHANGED
|
@@ -19,14 +19,8 @@ const stdRequester = process.env.REQUESTER;
|
|
|
19
19
|
const contaminantNames = new Set([
|
|
20
20
|
'axe',
|
|
21
21
|
'continuum',
|
|
22
|
-
'focAll',
|
|
23
|
-
'focInd',
|
|
24
|
-
'focOp',
|
|
25
|
-
'hover',
|
|
26
22
|
'htmlcs',
|
|
27
23
|
'ibm',
|
|
28
|
-
'menuNav',
|
|
29
|
-
'textNodes',
|
|
30
24
|
'wave'
|
|
31
25
|
]);
|
|
32
26
|
// Tests that are immune to page alteration.
|
package/package.json
CHANGED
|
@@ -14,26 +14,24 @@ const fs = require('fs/promises');
|
|
|
14
14
|
|
|
15
15
|
// ########## CONSTANTS
|
|
16
16
|
|
|
17
|
-
const reportDirScored = process.env.REPORTDIR_SCORED || 'reports/scored';
|
|
18
17
|
const query = {};
|
|
19
18
|
|
|
20
19
|
// ########## FUNCTIONS
|
|
21
20
|
|
|
22
21
|
// Returns data on the targets.
|
|
23
22
|
const getData = async scoredReports => {
|
|
24
|
-
const reportCount = scoredReports.length;
|
|
25
23
|
const bodyData = [];
|
|
26
24
|
for (const report of scoredReports) {
|
|
27
|
-
const {id,
|
|
25
|
+
const {id, acts, sources, score} = report;
|
|
28
26
|
bodyData.push({
|
|
29
27
|
id,
|
|
30
|
-
org:
|
|
31
|
-
url:
|
|
28
|
+
org: sources.target.what,
|
|
29
|
+
url: acts[1].which,
|
|
32
30
|
score: score.summary.total
|
|
33
31
|
});
|
|
34
32
|
};
|
|
35
33
|
return {
|
|
36
|
-
pageCount,
|
|
34
|
+
pageCount: scoredReports.length,
|
|
37
35
|
bodyData
|
|
38
36
|
}
|
|
39
37
|
};
|
|
@@ -57,13 +55,12 @@ const getTableBody = async bodyData => {
|
|
|
57
55
|
});
|
|
58
56
|
return rows.join('\n ');
|
|
59
57
|
};
|
|
60
|
-
//
|
|
61
|
-
exports.getQuery = async () => {
|
|
62
|
-
const data = await getData();
|
|
58
|
+
// Populates a query for a comparative table.
|
|
59
|
+
exports.getQuery = async (scoredReports, query) => {
|
|
60
|
+
const data = await getData(scoredReports);
|
|
63
61
|
query.pageCount = data.pageCount;
|
|
64
62
|
query.tableBody = await getTableBody(data.bodyData);
|
|
65
63
|
const date = new Date();
|
|
66
64
|
query.dateISO = date.toISOString().slice(0, 10);
|
|
67
65
|
query.dateSlash = query.dateISO.replace(/-/g, '/');
|
|
68
|
-
return query;
|
|
69
66
|
};
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
<p>The table below compares __pageCount__ web pages on <a href="https://www.w3.org/WAI/fundamentals/accessibility-intro/">accessibility</a>. The page names are links to the pages on the web. The scores are links to digests that explain in detail how the scores were computed.</p>
|
|
22
22
|
<p>The pages were:</p>
|
|
23
23
|
<ol id="summary">
|
|
24
|
-
<li>Tested by <a href="https://www.npmjs.com/package/testaro">Testaro</a> with
|
|
25
|
-
<li>Scored by <a href="https://www.npmjs.com/package/testilo">Testilo</a> with procedure <code>
|
|
26
|
-
<li>Digested by Testilo with procedure <code>
|
|
27
|
-
<li>Compared by Testilo with procedure <code>
|
|
24
|
+
<li>Tested by <a href="https://www.npmjs.com/package/testaro">Testaro</a> with script <code>ts20</code></li>
|
|
25
|
+
<li>Scored by <a href="https://www.npmjs.com/package/testilo">Testilo</a> with procedure <code>sp20b</code></li>
|
|
26
|
+
<li>Digested by Testilo with procedure <code>dp20d</code></li>
|
|
27
|
+
<li>Compared by Testilo with procedure <code>cp20a</code></li>
|
|
28
28
|
</ol>
|
|
29
|
-
<p>The Testaro
|
|
29
|
+
<p>The script made Testaro perform 1230 automated accessibility tests drawn from nine different packages: Alfa, Axe, Continuum, Equal Access, HTML CodeSniffer, Nu Html Checker, Tenon, Testaro, and WAVE. The scoring procedure made Testilo assign a score to each page, with 0 being perfect.</p>
|
|
30
30
|
<h2>Comparison</h2>
|
|
31
31
|
<table class="allBorder">
|
|
32
32
|
<caption>Accessibility scores of web pages</caption>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
|
|
3
|
-
Returns a query for
|
|
2
|
+
cp24.js
|
|
3
|
+
Returns a query for replacing placeholders in the associated template.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// ########## IMPORTS
|
|
@@ -12,31 +12,24 @@ const fs = require('fs/promises');
|
|
|
12
12
|
|
|
13
13
|
// ########## CONSTANTS
|
|
14
14
|
|
|
15
|
-
const reportDirScored = process.env.REPORTDIR_SCORED || 'reports/scored';
|
|
16
15
|
const query = {};
|
|
17
16
|
|
|
18
17
|
// ########## FUNCTIONS
|
|
19
18
|
|
|
20
|
-
// Returns data on the
|
|
21
|
-
const getData = async
|
|
22
|
-
const reportDirAbs = `${__dirname}/../../../${reportDirScored}`;
|
|
23
|
-
const reportFileNamesAll = await fs.readdir(reportDirAbs);
|
|
24
|
-
const reportFileNamesSource = reportFileNamesAll.filter(fileName => fileName.endsWith('.json'));
|
|
25
|
-
const pageCount = reportFileNamesSource.length;
|
|
19
|
+
// Returns data on the targets.
|
|
20
|
+
const getData = async scoredReports => {
|
|
26
21
|
const bodyData = [];
|
|
27
|
-
for (const
|
|
28
|
-
const
|
|
29
|
-
const file = JSON.parse(fileJSON);
|
|
30
|
-
const {id, host, score} = file;
|
|
22
|
+
for (const report of scoredReports) {
|
|
23
|
+
const {id, acts, sources, score} = report;
|
|
31
24
|
bodyData.push({
|
|
32
25
|
id,
|
|
33
|
-
org:
|
|
34
|
-
url:
|
|
26
|
+
org: sources.target.what,
|
|
27
|
+
url: acts[1].which,
|
|
35
28
|
score: score.summary.total
|
|
36
29
|
});
|
|
37
30
|
};
|
|
38
31
|
return {
|
|
39
|
-
pageCount,
|
|
32
|
+
pageCount: scoredReports.length,
|
|
40
33
|
bodyData
|
|
41
34
|
}
|
|
42
35
|
};
|
|
@@ -51,6 +44,7 @@ const getTableBody = async bodyData => {
|
|
|
51
44
|
const {id, org, url, score} = item;
|
|
52
45
|
const pageCell = `<th scope="row"><a href="${url}">${org}</a></th>`;
|
|
53
46
|
const numCell = `<td><a href="digests/${id}.html">${score}</a></td>`;
|
|
47
|
+
// Make the bar width proportional.
|
|
54
48
|
const barWidth = 100 * score / maxScore;
|
|
55
49
|
const bar = `<rect height="100%" width="${barWidth}%" fill="red"></rect>`;
|
|
56
50
|
const barCell = `<td aria-hidden="true"><svg width="100%" height="0.7em">${bar}</svg></td>`;
|
|
@@ -59,13 +53,12 @@ const getTableBody = async bodyData => {
|
|
|
59
53
|
});
|
|
60
54
|
return rows.join('\n ');
|
|
61
55
|
};
|
|
62
|
-
//
|
|
63
|
-
exports.getQuery = async () => {
|
|
64
|
-
const data = await getData();
|
|
56
|
+
// Populates a query for a comparative table.
|
|
57
|
+
exports.getQuery = async (scoredReports, query) => {
|
|
58
|
+
const data = await getData(scoredReports);
|
|
65
59
|
query.pageCount = data.pageCount;
|
|
66
60
|
query.tableBody = await getTableBody(data.bodyData);
|
|
67
61
|
const date = new Date();
|
|
68
62
|
query.dateISO = date.toISOString().slice(0, 10);
|
|
69
63
|
query.dateSlash = query.dateISO.replace(/-/g, '/');
|
|
70
|
-
return query;
|
|
71
64
|
};
|