testilo 3.5.0 → 3.6.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/README.md +17 -56
- package/digest.js +9 -6
- package/package.json +1 -1
- package/procs/digest/dp11a/index.js +15 -15
- package/procs/digest/dp12a/index.html +78 -0
- package/procs/digest/dp12a/index.js +126 -0
- package/procs/score/sp12a.js +2207 -0
- package/score.js +14 -8
- package/reports/comparative/railsites.html +0 -47
- package/reports/digested/35k1r-railpass.html +0 -9588
- package/reports/digested/3aee6-eurail.html +0 -36233
- package/reports/digested/dp10a/35k1r-railpass.html +0 -9302
- package/reports/digested/dp10a/3aee6-eurail.html +0 -35782
- package/reports/old/2q4h4-greinerabout.json +0 -10190
- package/reports/old/2q4h4-greinercol.json +0 -4965
- package/reports/old/2q4h4-greinercontact.json +0 -7804
- package/reports/old/2q4h4-greinerhome.json +0 -4277
- package/reports/old/2q4h4-greinermasks.json +0 -18805
- package/reports/old/2q4h4-greinermeasure.json +0 -4408
- package/reports/raw/35k1r-railpass.json +0 -8792
- package/reports/raw/3aee6-eurail.json +0 -35250
- package/reports/scored/35k1r-railpass.json +0 -9366
- package/reports/scored/3aee6-eurail.json +0 -35957
package/score.js
CHANGED
|
@@ -15,23 +15,29 @@ const fs = require('fs/promises');
|
|
|
15
15
|
|
|
16
16
|
const reportDirRaw = process.env.REPORTDIR_RAW || 'reports/raw';
|
|
17
17
|
const reportDirScored = process.env.REPORTDIR_SCORED || 'reports/scored';
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const scoreProcID = process.argv[2];
|
|
19
|
+
const reportIDStart = process.argv[3];
|
|
20
20
|
|
|
21
21
|
// ########## FUNCTIONS
|
|
22
22
|
|
|
23
|
+
// Score the specified reports.
|
|
23
24
|
const score = async () => {
|
|
25
|
+
// Identify the reports to be scored.
|
|
24
26
|
const reportDirRawAbs = `${__dirname}/${reportDirRaw}`;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
let reportFileNames = await fs.readdir(reportDirRawAbs);
|
|
28
|
+
reportFileNames = reportFileNames.filter(fileName => fileName.endsWith('.json'));
|
|
29
|
+
if (reportIDStart) {
|
|
30
|
+
reportFileNames = reportFileNames.filter(fileName => fileName.startsWith(reportIDStart));
|
|
31
|
+
}
|
|
32
|
+
// For each of them:
|
|
28
33
|
const {scorer} = require(`./procs/score/${scoreProcID}`);
|
|
29
|
-
for (const fileName of
|
|
30
|
-
|
|
31
|
-
.readFile(`${reportDirRawAbs}/${fileName}`, 'utf8');
|
|
34
|
+
for (const fileName of reportFileNames) {
|
|
35
|
+
// Score it.
|
|
36
|
+
const reportJSON = await fs.readFile(`${reportDirRawAbs}/${fileName}`, 'utf8');
|
|
32
37
|
const report = JSON.parse(reportJSON);
|
|
33
38
|
await scorer(report);
|
|
34
39
|
report.score.scoreProcID = scoreProcID;
|
|
40
|
+
// Write it to a file.
|
|
35
41
|
const scoredReportJSON = JSON.stringify(report, null, 2);
|
|
36
42
|
await fs.writeFile(`${__dirname}/${reportDirScored}/${fileName}`, `${scoredReportJSON}\n`);
|
|
37
43
|
console.log(`Report ${fileName.slice(0, -5)} scored and saved`);
|
|
@@ -1,47 +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="comparison of accessibility scores from tsp10 procedure">
|
|
10
|
-
<meta name="keywords" content="accessibility a11y web testing">
|
|
11
|
-
<title>Accessibility score comparison</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 score comparison</h1>
|
|
19
|
-
</header>
|
|
20
|
-
<h2>Introduction</h2>
|
|
21
|
-
<p>The table below compares 2 web pages on <a href="https://www.w3.org/WAI/fundamentals/accessibility-intro/">accessibility</a>. The page names link to the pages on the web. The scores link to digests that explain in detail how the scores were computed.</p>
|
|
22
|
-
<p>The pages were:</p>
|
|
23
|
-
<div id="summary">
|
|
24
|
-
<p>Tested by <a href="https://www.npmjs.com/package/testaro">Testaro</a> with procedure <code>tp10</code></p>
|
|
25
|
-
<p>Scored by <a href="https://www.npmjs.com/package/testilo">Testilo</a> with procedure <code>sp10a</code></p>
|
|
26
|
-
<p>Digested by Testilo with procedure <code>dp10a</code></p>
|
|
27
|
-
<p>Compared by Testilo with procedure <code>cp0</code></p>
|
|
28
|
-
</div>
|
|
29
|
-
<p>The <code>tp10</code> procedure performs 808 tests on each page. Of these, 16 tests are custom tests defined by Testaro, and the others belong to packages of tests created by others.</p>
|
|
30
|
-
<p>Tests and scoring formulae are fallible and subjective. The reported faults merit investigation as potential opportunities for improved accessibility. But some may not actually harm accessibility, and some other accessibility faults may have escaped detection. Different reasonable procedures could yield different test results and different scores. Testaro and Testilo can be customized to fit different definitions and weightings of types of accessibility.</p>
|
|
31
|
-
<h2>Comparison</h2>
|
|
32
|
-
<table class="allBorder">
|
|
33
|
-
<caption>Accessibility scores of web pages</caption>
|
|
34
|
-
<thead>
|
|
35
|
-
<tr><th scope="col">Page</th><th scope="col" colspan="2">Score (lower is better)</tr>
|
|
36
|
-
</thead>
|
|
37
|
-
<tbody class="linkSmaller secondCellRight">
|
|
38
|
-
<tr><th scope="row"><a href="https://www.railpass.com/">Railpass</a></th><td><a href="digests/35k1r-railpass.html">1589</a></td><td aria-hidden="true"><svg width="100%" height="0.7em"><rect height="100%" width="23.159889228975366%" fill="red"></rect></svg></td></tr>
|
|
39
|
-
<tr><th scope="row"><a href="https://www.eurail.com/en">Eurail</a></th><td><a href="digests/3aee6-eurail.html">6861</a></td><td aria-hidden="true"><svg width="100%" height="0.7em"><rect height="100%" width="100%" fill="red"></rect></svg></td></tr>
|
|
40
|
-
</tbody>
|
|
41
|
-
</table>
|
|
42
|
-
<footer>
|
|
43
|
-
<p class="date">Produced <time itemprop="datePublished" datetime="2022-06-08">2022/06/08</time></p>
|
|
44
|
-
</footer>
|
|
45
|
-
</main>
|
|
46
|
-
</body>
|
|
47
|
-
</html>
|