testilo 3.1.2 → 3.3.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 +34 -18
- package/compare.js +38 -0
- package/digest.js +19 -10
- package/package.json +1 -1
- package/procs/compare/cp0/index.html +46 -0
- package/procs/compare/cp0/index.js +70 -0
- package/procs/digest/{tsp10a → dp10a}/index.html +13 -5
- package/procs/digest/{tsp10a → dp10a}/index.js +8 -2
- package/procs/digest/{tsp09a → tdp09a}/index.html +0 -0
- package/procs/digest/{tsp09a → tdp09a}/index.js +0 -0
- package/procs/score/{tsp10a.js → sp10a.js} +4 -3
- package/reports/comparative/comparison.html +46 -0
- package/reports/comparative/style.css +89 -0
- package/reports/digested/35k1r-railpass.html +8994 -5
- package/reports/digested/style.css +4 -0
- package/reports/raw/35k1r-railpass.json +6 -1
- package/reports/scored/35k1r-railpass.json +7 -2
- package/score.js +17 -9
package/README.md
CHANGED
|
@@ -17,39 +17,55 @@ To score a report, Testilo needs to be told where to find the report, and also w
|
|
|
17
17
|
|
|
18
18
|
Similarly, once a report has been scored, Testilo can digest it, provided that Testilo is told where to find the scored report and which _digest proc_ to use. Different digest procs could produce different human-oriented explanations of the same scored report, such as for different audiences.
|
|
19
19
|
|
|
20
|
-
Testilo includes some score procs and
|
|
20
|
+
Testilo includes some score procs, digest procs, and comparison procs. You can add others.
|
|
21
21
|
|
|
22
22
|
## Execution
|
|
23
23
|
|
|
24
24
|
### Scoring
|
|
25
25
|
|
|
26
|
-
To score
|
|
26
|
+
To score Testaro reports, execute the statement `node score abc xyz`. Replace (here and below) `abc` with the base of the name of the file containing the report, or the prefix of the file name. Replace `xyz` with the base of the name of the score proc.
|
|
27
|
+
|
|
28
|
+
If you replace `abc` with the entire name base, Testilo will score one report. If you replace `abc` with a prefix (such as `35k1r-`), Testilo will score all the reports whose names begin with that prefix.
|
|
27
29
|
|
|
28
30
|
This procedure has some preconditions:
|
|
29
|
-
- The score proc is compatible with the report.
|
|
30
|
-
- The
|
|
31
|
-
-
|
|
32
|
-
- Testilo can read
|
|
33
|
-
-
|
|
31
|
+
- The score proc is compatible with the script that produced the report(s).
|
|
32
|
+
- The filename extension is `.json`.
|
|
33
|
+
- Testilo can find the report file(s) in the directory whose relative path (relative to the project directory of Testilo) is the value of the `REPORTDIR_RAW` environment variable.
|
|
34
|
+
- Testilo can read in the `REPORTDIR_RAW` directory.
|
|
35
|
+
- There is a `REPORTDIR_SCORED` environment variable, whose value is the relative path of a directory that Testilo can write to.
|
|
34
36
|
- The `procs/score` directory contains a file named `xyz.js`.
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
When Testilo scores a report, Testilo saves the scored report in the directory whose relative path is the value of the `REPORTDIR_SCORED`. The scored report file has the same name as the original.
|
|
38
|
+
When Testilo scores a report, Testilo saves the scored report in the directory whose relative path is the value of the `REPORTDIR_SCORED`. The scored report file has the same name as the original. The scored report has the same content as the original, plus a new property named `score`.
|
|
39
39
|
|
|
40
40
|
### Digesting
|
|
41
41
|
|
|
42
|
-
To make
|
|
42
|
+
To make scored Testaro reports more useful for humans, Testilo can create digests of scored reports. A digest is an HTML document (a web page) summarizing and explaining the findings, with the scored report appended to it.
|
|
43
43
|
|
|
44
|
-
To make Testilo digest
|
|
44
|
+
To make Testilo digest reports, execute the statement `node digest abc xyz`, replacing `abc` (here and below) with a whole base name or prefix, as with scoring, and `xyz` with the base of the name of the digest proc.
|
|
45
45
|
|
|
46
46
|
This procedure has some preconditions:
|
|
47
|
-
- The digest proc is compatible with the report.
|
|
48
|
-
- The
|
|
49
|
-
-
|
|
50
|
-
- Testilo can read
|
|
51
|
-
-
|
|
47
|
+
- The digest proc is compatible with the score proc that scored the report.
|
|
48
|
+
- The filename extension is `.json`.
|
|
49
|
+
- Testilo can find the scored report file(s) in the directory whose relative path (relative to the project directory of Testilo) is the value of the `REPORTDIR_SCORED` environment variable.
|
|
50
|
+
- Testilo can read in the `REPORTDIR_SCORED` directory.
|
|
51
|
+
- There is a `REPORTDIR_DIGESTED` environment variable, whose value is the relative path of a directory that Testilo can write to.
|
|
52
52
|
- The `procs/digest` directory contains a subdirectory named `xyz`, which in turn contains files named `index.html` and `index.js`.
|
|
53
53
|
- You have copied the `reports/digested/style.css` file into the `REPORTDIR_DIGESTED` directory.
|
|
54
54
|
|
|
55
|
-
When Testilo digests a report, Testilo saves the digest in the directory whose relative path is the value of the `REPORTDIR_DIGESTED
|
|
55
|
+
When Testilo digests a report, Testilo saves the digest in the directory whose relative path is the value of the `REPORTDIR_DIGESTED` environment variable. The digest has the same name as the report on which it is based, except with `.html` as the extension.
|
|
56
|
+
|
|
57
|
+
### Comparing
|
|
58
|
+
|
|
59
|
+
You can use Testilo to publish comparisons of accessibility scores. To do this, execute the statement `node compare abc xyz`, replacing `abc` with a filename base for the comparison and `xyz` with the name of a subdirectory of the `procs/compare` directory.
|
|
60
|
+
|
|
61
|
+
Testilo will examine all of the scored reports in the `REPORTDIR_SCORED` directory. The comparison proc in the `xyz` directory will construct a web page. Testilo will save the page in the `COMPARISONDIR` directory. The name of the file will be `abc.html`.
|
|
62
|
+
|
|
63
|
+
Comparison procs can design various pages on the basis of a set of scored reports. As an example, the `cp0` comparison proc creates a page that contains a table of scores, shown both numerically and with a bar graph. In the table, the first column contains descriptions of the pages (the `what` property of the hosts in the batch), such as “Wikipedia English”. Each such description is a link to the page on the web. The second column contains the scores of the pages. Each score is a link to the digest for its page. The link points to a digest located in a `digests` directory adjacent to the page itself. Thus, to use the `cp0` comparison proc, you would copy its output file to a web server, create a `digests` directory on the server as a sibling of that file, and copy the digest files into the `digests` directory.
|
|
64
|
+
|
|
65
|
+
This procedure has some preconditions:
|
|
66
|
+
- The comparison proc is compatible with the score proc that scored the report.
|
|
67
|
+
- Testilo can find the scored report files in the directory whose relative path (relative to the project directory of Testilo) is the value of the `REPORTDIR_SCORED` environment variable.
|
|
68
|
+
- Testilo can read in the `REPORTDIR_SCORED` directory.
|
|
69
|
+
- There is a `COMPARISONDIR` environment variable, whose value is the relative path of a directory that Testilo can write to.
|
|
70
|
+
- The `procs/compare` directory contains a subdirectory named `xyz`, which in turn contains files named `index.html` and `index.js`.
|
|
71
|
+
- You have copied the `reports/comparative/style.css` file into the `COMPARISONDIR` directory.
|
package/compare.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
compare.js
|
|
3
|
+
Testilo comparison script.
|
|
4
|
+
Usage example: node compare 35k1r cp0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// ########## IMPORTS
|
|
8
|
+
|
|
9
|
+
// Module to keep secrets.
|
|
10
|
+
require('dotenv').config();
|
|
11
|
+
// Module to read and write files.
|
|
12
|
+
const fs = require('fs/promises');
|
|
13
|
+
|
|
14
|
+
// ########## CONSTANTS
|
|
15
|
+
|
|
16
|
+
const comparisonDir = process.env.COMPARISONDIR || 'reports/comparative';
|
|
17
|
+
const comparisonNameBase = process.argv[2];
|
|
18
|
+
const compareProcID = process.argv[3];
|
|
19
|
+
|
|
20
|
+
// ########## FUNCTIONS
|
|
21
|
+
|
|
22
|
+
// Replaces the placeholders in content with eponymous query parameters.
|
|
23
|
+
const replaceHolders = (content, query) => content
|
|
24
|
+
.replace(/__([a-zA-Z]+)__/g, (ph, qp) => query[qp]);
|
|
25
|
+
// Creates and saves a web page containing a comparative table.
|
|
26
|
+
const compare = async () => {
|
|
27
|
+
const comparisonDirAbs = `${__dirname}/${comparisonDir}`;
|
|
28
|
+
const {getQuery} = require(`./procs/compare/${compareProcID}/index`);
|
|
29
|
+
const query = await getQuery();
|
|
30
|
+
const pageRaw = await fs.readFile(`${__dirname}/procs/compare/${compareProcID}/index.html`, 'utf8');
|
|
31
|
+
const page = replaceHolders(pageRaw, query);
|
|
32
|
+
await fs.writeFile(`${comparisonDirAbs}/${comparisonNameBase}.html`, page);
|
|
33
|
+
console.log(`Page ${comparisonNameBase}.html created and saved`);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// ########## OPERATION
|
|
37
|
+
|
|
38
|
+
compare();
|
package/digest.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
digest.js
|
|
3
3
|
Testilo digesting script.
|
|
4
|
+
Usage example: node digest 35k1r-railpass dp10a
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
// ########## IMPORTS
|
|
@@ -8,13 +9,13 @@
|
|
|
8
9
|
// Module to keep secrets.
|
|
9
10
|
require('dotenv').config();
|
|
10
11
|
// Module to read and write files.
|
|
11
|
-
const fs = require('fs')
|
|
12
|
+
const fs = require('fs/promises');
|
|
12
13
|
|
|
13
14
|
// ########## CONSTANTS
|
|
14
15
|
|
|
15
16
|
const reportDirScored = process.env.REPORTDIR_SCORED || 'reports/scored';
|
|
16
17
|
const reportDirDigested = process.env.REPORTDIR_DIGESTED || 'reports/digested';
|
|
17
|
-
const
|
|
18
|
+
const reportIDStart = process.argv[2];
|
|
18
19
|
const digesterID = process.argv[3];
|
|
19
20
|
|
|
20
21
|
// ########## FUNCTIONS
|
|
@@ -24,15 +25,23 @@ const replaceHolders = (content, query) => content
|
|
|
24
25
|
.replace(/__([a-zA-Z]+)__/g, (ph, qp) => query[qp]);
|
|
25
26
|
// Creates a digest.
|
|
26
27
|
const digest = async () => {
|
|
27
|
-
const
|
|
28
|
-
const
|
|
28
|
+
const reportDirScoredAbs = `${__dirname}/${reportDirScored}`;
|
|
29
|
+
const allReportFileNames = await fs.readdir(reportDirScoredAbs);
|
|
30
|
+
const sourceReportFileNames = allReportFileNames
|
|
31
|
+
.filter(fileName => fileName.startsWith(reportIDStart) && fileName.endsWith('.json'));
|
|
29
32
|
const {makeQuery} = require(`${__dirname}/procs/digest/${digesterID}/index.js`);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
for (const fileName of sourceReportFileNames) {
|
|
34
|
+
const reportJSON = await fs.readFile(`${reportDirScoredAbs}/${fileName}`, 'utf8');
|
|
35
|
+
const report = JSON.parse(reportJSON);
|
|
36
|
+
const query = {};
|
|
37
|
+
makeQuery(report, query);
|
|
38
|
+
const template = await fs
|
|
39
|
+
.readFile(`${__dirname}/procs/digest/${digesterID}/index.html`, 'utf8');
|
|
40
|
+
const digest = replaceHolders(template, query);
|
|
41
|
+
const fileNameBase = fileName.slice(0, -5);
|
|
42
|
+
await fs.writeFile(`${__dirname}/${reportDirDigested}/${fileNameBase}.html`, digest);
|
|
43
|
+
console.log(`Report ${fileNameBase} digested and saved`);
|
|
44
|
+
};
|
|
36
45
|
};
|
|
37
46
|
|
|
38
47
|
// ########## OPERATION
|
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
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 __pageCount__ 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
|
+
__tableBody__
|
|
39
|
+
</tbody>
|
|
40
|
+
</table>
|
|
41
|
+
<footer>
|
|
42
|
+
<p class="date">Produced <time itemprop="datePublished" datetime="__dateISO__">__dateSlash__</time></p>
|
|
43
|
+
</footer>
|
|
44
|
+
</main>
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
ttp0.js
|
|
3
|
+
Returns a query for an HTML page including a bar-graph table.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// ########## IMPORTS
|
|
7
|
+
|
|
8
|
+
// Module to keep secrets local.
|
|
9
|
+
require('dotenv').config();
|
|
10
|
+
// Module to access files.
|
|
11
|
+
const fs = require('fs/promises');
|
|
12
|
+
|
|
13
|
+
// ########## CONSTANTS
|
|
14
|
+
|
|
15
|
+
const reportDirScored = process.env.REPORTDIR_SCORED || 'reports/scored';
|
|
16
|
+
const query = {};
|
|
17
|
+
|
|
18
|
+
// ########## FUNCTIONS
|
|
19
|
+
|
|
20
|
+
// Gets data on the hosts and their scores and adds query parameter.
|
|
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;
|
|
26
|
+
const bodyData = [];
|
|
27
|
+
for (const fileName of reportFileNamesSource) {
|
|
28
|
+
const fileJSON = await fs.readFile(`${reportDirAbs}/${fileName}`, 'utf8');
|
|
29
|
+
const file = JSON.parse(fileJSON);
|
|
30
|
+
const {id, host, score} = file;
|
|
31
|
+
bodyData.push({
|
|
32
|
+
id,
|
|
33
|
+
host,
|
|
34
|
+
score: score.scores.total
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
pageCount,
|
|
39
|
+
bodyData
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
// Gets the maximum score.
|
|
43
|
+
const getMaxScore = tableData => tableData.reduce((max, item) => Math.max(max, item.score), 0);
|
|
44
|
+
// Converts report data to a table body.
|
|
45
|
+
const getTableBody = async bodyData => {
|
|
46
|
+
const maxScore = getMaxScore(bodyData);
|
|
47
|
+
const rows = bodyData
|
|
48
|
+
.sort((a, b) => a.score - b.score)
|
|
49
|
+
.map(item => {
|
|
50
|
+
const {id, host, score} = item;
|
|
51
|
+
const pageCell = `<th scope="row"><a href="${host.which}">${host.what}</a></th>`;
|
|
52
|
+
const numCell = `<td><a href="digests/${id}.html">${score}</a></td>`;
|
|
53
|
+
const barWidth = 100 * score / maxScore;
|
|
54
|
+
const bar = `<rect height="100%" width="${barWidth}%" fill="red"></rect>`;
|
|
55
|
+
const barCell = `<td aria-hidden="true"><svg width="100%" height="0.7em">${bar}</svg></td>`;
|
|
56
|
+
const row = `<tr>${pageCell}${numCell}${barCell}</tr>`;
|
|
57
|
+
return row;
|
|
58
|
+
});
|
|
59
|
+
return rows.join('\n ');
|
|
60
|
+
};
|
|
61
|
+
// Returns a query for a comparative table.
|
|
62
|
+
exports.getQuery = async () => {
|
|
63
|
+
const data = await getData();
|
|
64
|
+
query.pageCount = data.pageCount;
|
|
65
|
+
query.tableBody = await getTableBody(data.bodyData);
|
|
66
|
+
const date = new Date();
|
|
67
|
+
query.dateISO = date.toISOString().slice(0, 10);
|
|
68
|
+
query.dateSlash = query.dateISO.replace(/-/g, '/');
|
|
69
|
+
return query;
|
|
70
|
+
};
|
|
@@ -16,14 +16,20 @@
|
|
|
16
16
|
<main>
|
|
17
17
|
<header>
|
|
18
18
|
<h1>Accessibility test digest</h1>
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
19
|
+
<h2>Summary</h2>
|
|
20
|
+
<div id="summary">
|
|
21
|
+
<p>Page: __org__</p>
|
|
22
|
+
<p>URL: __url__</p>
|
|
23
|
+
<p>Score: __totalScore__</p>
|
|
24
|
+
<p>Tested by: Testaro, <code>tp10</code></p>
|
|
25
|
+
<p>Scored by: Testilo, <code>sp10a</code></p>
|
|
26
|
+
<p>Digested by: Testilo, <code>dp10a</code></p>
|
|
27
|
+
</div>
|
|
22
28
|
</header>
|
|
23
29
|
<h2>Introduction</h2>
|
|
24
|
-
<p>The <code>
|
|
30
|
+
<p>The <code>tp10</code> <a href="https://www.w3.org/WAI/fundamentals/accessibility-intro/">accessibility</a> testing procedure was executed by <a href="https://www.npmjs.com/package/testaro">Testaro</a> on the web page at <a href="__url__">__url__</a>, belonging to __org__, on __dateSlash__. The procedure performed 808 tests. Of these, 16 tests are custom tests defined by Testaro, and the others belong to packages of tests created by others. Testaro produced a report enumerating the test results. The report is appended, below, to this page.</p>
|
|
25
31
|
<p>These tests—like all tests—are fallible. The failures described below merit investigation as <strong>potential</strong> opportunities for improved accessibility. But some reported faults may not actually harm accessibility, and some accessibility faults can escape detection by any of these tests.</p>
|
|
26
|
-
<p>Given the report produced by Testaro, another procedure, <code>
|
|
32
|
+
<p>Given the report produced by Testaro, another procedure, <code>sp10a</code>, was executed by <a href="https://www.npmjs.com/package/testilo">Testilo</a>. The procedure assigned weights to the tests and computed a total score for the page, __totalScore__ (where 0 is the best possible score). Just as tests are fallible, any scoring procedure is subjective, and different reasonable procedures could assign different scores on the basis of the same report. Testilo used procedure <code>dp10a</code> to produce this digest, explaining how <code>sp10a</code> computed the score.</p>
|
|
27
33
|
<h2>Summary</h2>
|
|
28
34
|
<p>The packages’ and custom tests’ contributions to the score were:</p>
|
|
29
35
|
<table class="allBorder secondCellRight">
|
|
@@ -121,6 +127,8 @@
|
|
|
121
127
|
<li>Measuring success is a prerequisite for achieving success, so interfering with accessibility measurement interferes with accessibility.</li>
|
|
122
128
|
<li>Users with disabilities often rely on assistive technologies to mediate between them and web applications. Applications that interfere with automated testing are at risk of interfering with some assistive technologies, too.</li>
|
|
123
129
|
</ul>
|
|
130
|
+
<h2>Report</h2>
|
|
131
|
+
<pre>__report__</pre>
|
|
124
132
|
<footer>
|
|
125
133
|
<p class="date">Produced <time itemprop="datePublished" datetime="__dateISO__">__dateSlash__</time></p>
|
|
126
134
|
</footer>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
index: digester for procedure
|
|
2
|
+
index: digester for scoring procedure sp10.
|
|
3
3
|
Creator of parameters for substitution into index.html.
|
|
4
|
+
Usage example: node digest 35k1r-railpass dp10a
|
|
4
5
|
*/
|
|
5
6
|
exports.makeQuery = (report, query) => {
|
|
6
7
|
// Makes strings HTML-safe.
|
|
@@ -12,7 +13,12 @@ exports.makeQuery = (report, query) => {
|
|
|
12
13
|
const joiner = '\n ';
|
|
13
14
|
const innerJoiner = '\n ';
|
|
14
15
|
// Create an HTML identification of the host report.
|
|
15
|
-
const {
|
|
16
|
+
const {script, host, score} = report;
|
|
17
|
+
const reportJSON = JSON.stringify(report, null, 2);
|
|
18
|
+
const reportJSONSafe = reportJSON
|
|
19
|
+
.replace(/</g, '<')
|
|
20
|
+
.replace(/&/g, '&');
|
|
21
|
+
query.report = reportJSONSafe;
|
|
16
22
|
// Creates a packaged-test success message.
|
|
17
23
|
const packageSucceedText = package =>
|
|
18
24
|
`<p>The page <strong>passed</strong> the <code>${package}</code> test.</p>`;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
|
|
2
|
+
sp10a
|
|
3
3
|
Testilo score proc 10a
|
|
4
|
-
Computes scores from script
|
|
5
|
-
discounting is planned future work.
|
|
4
|
+
Computes scores from Testaro script tp10 and adds them to a report. Does not discount tenon.
|
|
5
|
+
Tenon discounting is planned future work.
|
|
6
|
+
Usage example: node score 35k1r sp10a
|
|
6
7
|
*/
|
|
7
8
|
exports.scorer = report => {
|
|
8
9
|
// CONSTANTS
|
|
@@ -0,0 +1,46 @@
|
|
|
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 1 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="100%" fill="red"></rect></svg></td></tr>
|
|
39
|
+
</tbody>
|
|
40
|
+
</table>
|
|
41
|
+
<footer>
|
|
42
|
+
<p class="date">Produced <time itemprop="datePublished" datetime="2022-06-08">2022/06/08</time></p>
|
|
43
|
+
</footer>
|
|
44
|
+
</main>
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
*:focus {
|
|
2
|
+
outline: solid 0.2rem #00f;
|
|
3
|
+
outline-offset: 0.2rem;
|
|
4
|
+
}
|
|
5
|
+
body {
|
|
6
|
+
margin: 2rem;
|
|
7
|
+
font-size: large;
|
|
8
|
+
}
|
|
9
|
+
.bold {
|
|
10
|
+
font-weight: 700;
|
|
11
|
+
}
|
|
12
|
+
button {
|
|
13
|
+
min-height: 44px;
|
|
14
|
+
min-width: 44px;
|
|
15
|
+
padding: 0.5rem;
|
|
16
|
+
border: solid 0.2rem #03a;
|
|
17
|
+
border-radius: 1rem;
|
|
18
|
+
font-size: inherit;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
color: #fff;
|
|
21
|
+
background-color: #03a;
|
|
22
|
+
}
|
|
23
|
+
button:hover {
|
|
24
|
+
color: #000;
|
|
25
|
+
background-color: #9df;
|
|
26
|
+
}
|
|
27
|
+
caption {
|
|
28
|
+
margin: 1rem 0;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
font-style: italic;
|
|
31
|
+
}
|
|
32
|
+
code {
|
|
33
|
+
font-family: sans-serif;
|
|
34
|
+
color: #832703;
|
|
35
|
+
}
|
|
36
|
+
.error {
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
color: #c00;
|
|
39
|
+
}
|
|
40
|
+
fieldset {
|
|
41
|
+
width: max-content;
|
|
42
|
+
margin-top: 1rem;
|
|
43
|
+
}
|
|
44
|
+
.firstCellRight td:nth-child(1) {
|
|
45
|
+
text-align: right;
|
|
46
|
+
}
|
|
47
|
+
form {
|
|
48
|
+
margin-top: 1rem;
|
|
49
|
+
}
|
|
50
|
+
h2 {
|
|
51
|
+
margin: 1rem auto 0.5rem auto;
|
|
52
|
+
color: #006666;
|
|
53
|
+
}
|
|
54
|
+
input {
|
|
55
|
+
margin: 0.5rem 0;
|
|
56
|
+
font-size: inherit;
|
|
57
|
+
}
|
|
58
|
+
legend {
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
}
|
|
61
|
+
.secondCellRight td:nth-child(2) {
|
|
62
|
+
text-align: right;
|
|
63
|
+
}
|
|
64
|
+
section:not(.wide) {
|
|
65
|
+
max-width: 36rem;
|
|
66
|
+
}
|
|
67
|
+
#summary > p {
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
}
|
|
71
|
+
table {
|
|
72
|
+
border-collapse: collapse;
|
|
73
|
+
}
|
|
74
|
+
table.allBorder th {
|
|
75
|
+
padding-bottom: 0;
|
|
76
|
+
}
|
|
77
|
+
table.allBorder th, table.allBorder td, tbody td {
|
|
78
|
+
border: 1px gray solid;
|
|
79
|
+
}
|
|
80
|
+
tbody th {
|
|
81
|
+
padding-right: 1rem;
|
|
82
|
+
text-align: right;
|
|
83
|
+
}
|
|
84
|
+
td, th {
|
|
85
|
+
padding: 0 0.5rem;
|
|
86
|
+
}
|
|
87
|
+
thead th {
|
|
88
|
+
padding-bottom: 1rem;
|
|
89
|
+
}
|