testaro 18.3.0 → 18.4.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/testaro/hrRisk.js +67 -0
- package/tests/testaro.js +1 -0
- package/validation/tests/jobs/hrRisk.json +134 -0
- package/validation/tests/targets/hrRisk/index.html +18 -0
- /package/aslint/app/rules/aslint/{empty-title-attribute → redundant/empty-title-attribute}/empty-title-attribute.documentation.md +0 -0
- /package/aslint/app/rules/aslint/{empty-title-attribute → redundant/empty-title-attribute}/empty-title-attribute.test.ts +0 -0
- /package/aslint/app/rules/aslint/{empty-title-attribute → redundant/empty-title-attribute}/empty-title-attribute.ts +0 -0
- /package/aslint/app/rules/aslint/{flash-content → redundant/flash-content}/flash-content.documentation.md +0 -0
- /package/aslint/app/rules/aslint/{flash-content → redundant/flash-content}/flash-content.test.ts +0 -0
- /package/aslint/app/rules/aslint/{flash-content → redundant/flash-content}/flash-content.ts +0 -0
- /package/aslint/app/rules/aslint/{font-style-italic → redundant/font-style-italic}/font-style-italic.documentation.md +0 -0
- /package/aslint/app/rules/aslint/{font-style-italic → redundant/font-style-italic}/font-style-italic.test.ts +0 -0
- /package/aslint/app/rules/aslint/{font-style-italic → redundant/font-style-italic}/font-style-italic.ts +0 -0
- /package/aslint/app/rules/aslint/{h1-must-be → redundant/h1-must-be}/h1-must-be.documentation.md +0 -0
- /package/aslint/app/rules/aslint/{h1-must-be → redundant/h1-must-be}/h1-must-be.test.ts +0 -0
- /package/aslint/app/rules/aslint/{h1-must-be → redundant/h1-must-be}/h1-must-be.ts +0 -0
- /package/aslint/app/rules/aslint/{horizontal-rule → used/horizontal-rule}/horizontal-rule.documentation.md +0 -0
- /package/aslint/app/rules/aslint/{horizontal-rule → used/horizontal-rule}/horizontal-rule.test.ts +0 -0
- /package/aslint/app/rules/aslint/{horizontal-rule → used/horizontal-rule}/horizontal-rule.ts +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
hrRisk
|
|
3
|
+
Related to ASLint test horizontal-rule.
|
|
4
|
+
This test reports the existence of hr elements. Their semantics are inconsistently defined and
|
|
5
|
+
interpreted and impair accessibility compared with stylistic segmentation.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// ########## IMPORTS
|
|
9
|
+
|
|
10
|
+
// Module to get locator data.
|
|
11
|
+
const {getLocatorData} = require('../procs/getLocatorData');
|
|
12
|
+
|
|
13
|
+
// ########## FUNCTIONS
|
|
14
|
+
|
|
15
|
+
// Performs the test.
|
|
16
|
+
exports.reporter = async (page, withItems) => {
|
|
17
|
+
// Initialize the standard result.
|
|
18
|
+
const data = {};
|
|
19
|
+
const totals = [0, 0, 0, 0];
|
|
20
|
+
const standardInstances = [];
|
|
21
|
+
// Get locators for all applicable elements.
|
|
22
|
+
const locAll = page.locator('body hr');
|
|
23
|
+
const locsAll = await locAll.all();
|
|
24
|
+
// For each of them:
|
|
25
|
+
for (const loc of locsAll) {
|
|
26
|
+
// Add to the totals.
|
|
27
|
+
totals[0]++;
|
|
28
|
+
// If itemization is required:
|
|
29
|
+
if (withItems) {
|
|
30
|
+
// Get data on the element.
|
|
31
|
+
const elData = await getLocatorData(loc);
|
|
32
|
+
// Add a standard instance.
|
|
33
|
+
standardInstances.push({
|
|
34
|
+
ruleID: 'hrRisk',
|
|
35
|
+
what: 'Element instead of styling is used for vertical segmentation',
|
|
36
|
+
ordinalSeverity: 0,
|
|
37
|
+
tagName: 'HR',
|
|
38
|
+
id: elData.id,
|
|
39
|
+
location: elData.location,
|
|
40
|
+
excerpt: elData.excerpt
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// If itemization is not required and there are instances:
|
|
45
|
+
if (! withItems && totals[0]) {
|
|
46
|
+
// Add a summary instance.
|
|
47
|
+
standardInstances.push({
|
|
48
|
+
ruleID: 'hrRisk',
|
|
49
|
+
what: 'Elements instead of styling are used for vertical segmentation',
|
|
50
|
+
ordinalSeverity: 0,
|
|
51
|
+
count: totals[0],
|
|
52
|
+
tagName: 'HR',
|
|
53
|
+
id: '',
|
|
54
|
+
location: {
|
|
55
|
+
doc: '',
|
|
56
|
+
type: '',
|
|
57
|
+
spec: ''
|
|
58
|
+
},
|
|
59
|
+
excerpt: ''
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
data,
|
|
64
|
+
totals,
|
|
65
|
+
standardInstances
|
|
66
|
+
};
|
|
67
|
+
};
|
package/tests/testaro.js
CHANGED
|
@@ -25,6 +25,7 @@ const evalRules = {
|
|
|
25
25
|
headingAmb: 'same-level sibling headings with identical texts',
|
|
26
26
|
hover: 'hover-caused content changes',
|
|
27
27
|
hovInd: 'hover indication nonstandard',
|
|
28
|
+
hrRisk: 'hr element instead of styles used for vertical segmentation',
|
|
28
29
|
labClash: 'labeling inconsistencies',
|
|
29
30
|
lineHeight: 'text with a line height less than 1.5 times its font size',
|
|
30
31
|
linkExt: 'links that automatically open new windows',
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "hrRisk",
|
|
3
|
+
"what": "validation of hrRisk test",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"timeLimit": 20,
|
|
6
|
+
"acts": [
|
|
7
|
+
{
|
|
8
|
+
"type": "launch",
|
|
9
|
+
"which": "chromium",
|
|
10
|
+
"what": "usual browser"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "url",
|
|
14
|
+
"which": "__targets__/hrRisk/index.html",
|
|
15
|
+
"what": "page with an hr element"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "test",
|
|
19
|
+
"which": "testaro",
|
|
20
|
+
"withItems": true,
|
|
21
|
+
"stopOnFail": true,
|
|
22
|
+
"expect": [
|
|
23
|
+
[
|
|
24
|
+
"standardResult.totals.0",
|
|
25
|
+
"=",
|
|
26
|
+
1
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"standardResult.totals.1",
|
|
30
|
+
"=",
|
|
31
|
+
0
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"standardResult.instances.0.ruleID",
|
|
35
|
+
"=",
|
|
36
|
+
"hrRisk"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"standardResult.instances.0.what",
|
|
40
|
+
"i",
|
|
41
|
+
"Element instead"
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"standardResult.instances.0.ordinalSeverity",
|
|
45
|
+
"=",
|
|
46
|
+
0
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
"standardResult.instances.0.tagName",
|
|
50
|
+
"=",
|
|
51
|
+
"HR"
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"standardResult.instances.0.location.doc",
|
|
55
|
+
"=",
|
|
56
|
+
"dom"
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"standardResult.instances.0.location.type",
|
|
60
|
+
"=",
|
|
61
|
+
"box"
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"standardResult.instances.0.location.spec.y",
|
|
65
|
+
">",
|
|
66
|
+
0
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
"standardResult.instances.0.excerpt",
|
|
70
|
+
"i",
|
|
71
|
+
"hr"
|
|
72
|
+
]
|
|
73
|
+
],
|
|
74
|
+
"rules": [
|
|
75
|
+
"y",
|
|
76
|
+
"hrRisk"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "test",
|
|
81
|
+
"which": "testaro",
|
|
82
|
+
"withItems": false,
|
|
83
|
+
"stopOnFail": true,
|
|
84
|
+
"expect": [
|
|
85
|
+
[
|
|
86
|
+
"standardResult.totals.0",
|
|
87
|
+
"=",
|
|
88
|
+
1
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
"standardResult.totals.2",
|
|
92
|
+
"=",
|
|
93
|
+
0
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"standardResult.instances.length",
|
|
97
|
+
"=",
|
|
98
|
+
1
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
"standardResult.instances.0.ruleID",
|
|
102
|
+
"=",
|
|
103
|
+
"hrRisk"
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"standardResult.instances.0.what",
|
|
107
|
+
"i",
|
|
108
|
+
"Elements instead"
|
|
109
|
+
],
|
|
110
|
+
[
|
|
111
|
+
"standardResult.instances.0.ordinalSeverity",
|
|
112
|
+
"=",
|
|
113
|
+
0
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
"standardResult.instances.0.tagName",
|
|
117
|
+
"=",
|
|
118
|
+
"HR"
|
|
119
|
+
]
|
|
120
|
+
],
|
|
121
|
+
"rules": [
|
|
122
|
+
"y",
|
|
123
|
+
"hrRisk"
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"sources": {
|
|
128
|
+
"script": "",
|
|
129
|
+
"host": {},
|
|
130
|
+
"requester": ""
|
|
131
|
+
},
|
|
132
|
+
"creationTime": "2013-05-28T12:00:00",
|
|
133
|
+
"timeStamp": "00000"
|
|
134
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-US">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Page with an hr element</title>
|
|
6
|
+
<meta name="description" content="tester">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<main>
|
|
11
|
+
<h1>Page with an hr element</h1>
|
|
12
|
+
<p>This is the start of the main text.</p>
|
|
13
|
+
<p>This is the end of the main text.</p>
|
|
14
|
+
<hr>
|
|
15
|
+
<p>This is the postscript to the main text.</p>
|
|
16
|
+
</main>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/aslint/app/rules/aslint/{flash-content → redundant/flash-content}/flash-content.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/aslint/app/rules/aslint/{h1-must-be → redundant/h1-must-be}/h1-must-be.documentation.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/aslint/app/rules/aslint/{horizontal-rule → used/horizontal-rule}/horizontal-rule.test.ts
RENAMED
|
File without changes
|
/package/aslint/app/rules/aslint/{horizontal-rule → used/horizontal-rule}/horizontal-rule.ts
RENAMED
|
File without changes
|