testaro 13.0.2 → 14.1.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 +190 -94
- package/actSpecs.js +17 -158
- package/package.json +1 -1
- package/run.js +31 -31
- package/standardize.js +338 -0
- package/{tests → testaro}/allHidden.js +36 -1
- package/{tests → testaro}/attVal.js +36 -2
- package/{tests → testaro}/autocomplete.js +34 -1
- package/{tests → testaro}/bulk.js +15 -1
- package/{tests → testaro}/docType.js +15 -1
- package/{tests → testaro}/dupAtt.js +34 -1
- package/{tests → testaro}/elements.js +9 -3
- package/testaro/embAc.js +78 -0
- package/{tests → testaro}/filter.js +35 -1
- package/{tests → testaro}/focAll.js +20 -3
- package/{tests → testaro}/focInd.js +45 -3
- package/{tests → testaro}/focOp.js +61 -2
- package/{tests → testaro}/focVis.js +35 -1
- package/{tests → testaro}/hover.js +67 -5
- package/{tests → testaro}/labClash.js +54 -4
- package/{tests → testaro}/linkTo.js +33 -1
- package/{tests → testaro}/linkUl.js +43 -5
- package/{tests → testaro}/menuNav.js +42 -1
- package/{tests → testaro}/miniText.js +32 -1
- package/{tests → testaro}/motion.js +27 -4
- package/{tests → testaro}/nonTable.js +32 -1
- package/{tests → testaro}/radioSet.js +33 -2
- package/{tests → testaro}/role.js +38 -1
- package/{tests → testaro}/styleDiff.js +43 -2
- package/{tests → testaro}/tabNav.js +42 -1
- package/{tests → testaro}/textNodes.js +6 -2
- package/{tests → testaro}/title.js +8 -4
- package/{tests → testaro}/titledEl.js +32 -1
- package/{tests → testaro}/zIndex.js +40 -2
- package/tests/alfa.js +72 -75
- package/tests/continuum.js +6 -2
- package/tests/ibm.js +14 -42
- package/tests/testaro.js +73 -0
- package/validation/tests/jobs/allHidden.json +877 -174
- package/validation/tests/jobs/attVal.json +57 -19
- package/validation/tests/jobs/autocomplete.json +34 -8
- package/validation/tests/jobs/bulk.json +33 -7
- package/validation/tests/jobs/docType.json +23 -5
- package/validation/tests/jobs/dupAtt.json +47 -8
- package/validation/tests/jobs/elements.json +231 -70
- package/validation/tests/jobs/embAc.json +70 -15
- package/validation/tests/jobs/filter.json +56 -12
- package/validation/tests/jobs/focAll.json +64 -16
- package/validation/tests/jobs/focInd.json +107 -23
- package/validation/tests/jobs/focOp.json +93 -21
- package/validation/tests/jobs/focVis.json +16 -4
- package/validation/tests/jobs/hover.json +246 -56
- package/validation/tests/jobs/labClash.json +43 -11
- package/validation/tests/jobs/linkTo.json +16 -4
- package/validation/tests/jobs/linkUl.json +79 -19
- package/validation/tests/jobs/menuNav.json +313 -65
- package/validation/tests/jobs/miniText.json +21 -5
- package/validation/tests/jobs/motion.json +81 -23
- package/validation/tests/jobs/nonTable.json +26 -6
- package/validation/tests/jobs/radioSet.json +43 -11
- package/validation/tests/jobs/role.json +93 -19
- package/validation/tests/jobs/styleDiff.json +124 -28
- package/validation/tests/jobs/tabNav.json +313 -65
- package/validation/tests/jobs/textNodes.json +190 -49
- package/validation/tests/jobs/title.json +23 -5
- package/validation/tests/jobs/titledEl.json +26 -6
- package/validation/tests/jobs/zIndex.json +28 -8
- package/validation/tests/old/allHidden.json +314 -0
- package/validation/tests/old/attVal.json +60 -0
- package/validation/tests/old/autocomplete.json +51 -0
- package/validation/tests/old/bulk.json +48 -0
- package/validation/tests/old/docType.json +46 -0
- package/validation/tests/old/dupAtt.json +51 -0
- package/validation/tests/old/elements.json +140 -0
- package/validation/tests/old/embAc.json +54 -0
- package/validation/tests/old/filter.json +55 -0
- package/validation/tests/old/focAll.json +68 -0
- package/validation/tests/old/focInd.json +69 -0
- package/validation/tests/old/focOp.json +62 -0
- package/validation/tests/old/focVis.json +35 -0
- package/validation/tests/old/hover.json +118 -0
- package/validation/tests/old/labClash.json +52 -0
- package/validation/tests/old/linkTo.json +35 -0
- package/validation/tests/old/linkUl.json +71 -0
- package/validation/tests/old/menuNav.json +106 -0
- package/validation/tests/old/miniText.json +36 -0
- package/validation/tests/old/motion.json +62 -0
- package/validation/tests/old/nonTable.json +37 -0
- package/validation/tests/old/radioSet.json +52 -0
- package/validation/tests/old/role.json +60 -0
- package/validation/tests/old/styleDiff.json +71 -0
- package/validation/tests/old/tabNav.json +106 -0
- package/validation/tests/old/temp.js +28 -0
- package/validation/tests/old/textNodes.json +98 -0
- package/validation/tests/old/title.json +46 -0
- package/validation/tests/old/titledEl.json +37 -0
- package/validation/tests/old/zIndex.json +49 -0
- package/validation/tests/targets/attVal/good.html +1 -1
- package/validation/tests/targets/elements/index.html +1 -0
- package/tests/embAc.js +0 -36
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "tabNav",
|
|
3
|
+
"what": "validation of tabNav 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__/tabNav/good.html",
|
|
15
|
+
"what": "page with standard menu navigation"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "test",
|
|
19
|
+
"which": "tabNav",
|
|
20
|
+
"what": "tab-list navigation",
|
|
21
|
+
"withItems": false,
|
|
22
|
+
"expect": [
|
|
23
|
+
["totals.navigations.all.total", "=", 21],
|
|
24
|
+
["totals.navigations.all.correct", "=", 21],
|
|
25
|
+
["totals.navigations.all.incorrect", "=", 0],
|
|
26
|
+
["totals.navigations.specific.tab.total", "=", 3],
|
|
27
|
+
["totals.navigations.specific.tab.correct", "=", 3],
|
|
28
|
+
["totals.navigations.specific.tab.incorrect", "=", 0],
|
|
29
|
+
["totals.navigations.specific.left.total", "=", 3],
|
|
30
|
+
["totals.navigations.specific.left.correct", "=", 3],
|
|
31
|
+
["totals.navigations.specific.left.incorrect", "=", 0],
|
|
32
|
+
["totals.navigations.specific.right.total", "=", 3],
|
|
33
|
+
["totals.navigations.specific.right.correct", "=", 3],
|
|
34
|
+
["totals.navigations.specific.right.incorrect", "=", 0],
|
|
35
|
+
["totals.navigations.specific.up.total", "=", 3],
|
|
36
|
+
["totals.navigations.specific.up.correct", "=", 3],
|
|
37
|
+
["totals.navigations.specific.up.incorrect", "=", 0],
|
|
38
|
+
["totals.navigations.specific.down.total", "=", 3],
|
|
39
|
+
["totals.navigations.specific.down.correct", "=", 3],
|
|
40
|
+
["totals.navigations.specific.down.incorrect", "=", 0],
|
|
41
|
+
["totals.navigations.specific.home.total", "=", 3],
|
|
42
|
+
["totals.navigations.specific.home.correct", "=", 3],
|
|
43
|
+
["totals.navigations.specific.home.incorrect", "=", 0],
|
|
44
|
+
["totals.navigations.specific.end.total", "=", 3],
|
|
45
|
+
["totals.navigations.specific.end.correct", "=", 3],
|
|
46
|
+
["totals.navigations.specific.end.incorrect", "=", 0],
|
|
47
|
+
["totals.tabElements.total", "=", 3],
|
|
48
|
+
["totals.tabElements.correct", "=", 3],
|
|
49
|
+
["totals.tabElements.incorrect", "=", 0],
|
|
50
|
+
["totals.tabLists.total", "=", 1],
|
|
51
|
+
["totals.tabLists.correct", "=", 1],
|
|
52
|
+
["totals.tabLists.incorrect", "=", 0]
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "url",
|
|
57
|
+
"which": "__targets__/tabNav/bad.html",
|
|
58
|
+
"what": "page with deviant menu navigation"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "test",
|
|
62
|
+
"which": "tabNav",
|
|
63
|
+
"what": "tab-list navigation",
|
|
64
|
+
"withItems": false,
|
|
65
|
+
"expect": [
|
|
66
|
+
["totals.navigations.all.total", "=", 21],
|
|
67
|
+
["totals.navigations.all.correct", "=", 9],
|
|
68
|
+
["totals.navigations.all.incorrect", "=", 12],
|
|
69
|
+
["totals.navigations.specific.tab.total", "=", 3],
|
|
70
|
+
["totals.navigations.specific.tab.correct", "=", 1],
|
|
71
|
+
["totals.navigations.specific.tab.incorrect", "=", 2],
|
|
72
|
+
["totals.navigations.specific.left.total", "=", 3],
|
|
73
|
+
["totals.navigations.specific.left.correct", "=", 0],
|
|
74
|
+
["totals.navigations.specific.left.incorrect", "=", 3],
|
|
75
|
+
["totals.navigations.specific.right.total", "=", 3],
|
|
76
|
+
["totals.navigations.specific.right.correct", "=", 0],
|
|
77
|
+
["totals.navigations.specific.right.incorrect", "=", 3],
|
|
78
|
+
["totals.navigations.specific.up.total", "=", 3],
|
|
79
|
+
["totals.navigations.specific.up.correct", "=", 3],
|
|
80
|
+
["totals.navigations.specific.up.incorrect", "=", 0],
|
|
81
|
+
["totals.navigations.specific.down.total", "=", 3],
|
|
82
|
+
["totals.navigations.specific.down.correct", "=", 3],
|
|
83
|
+
["totals.navigations.specific.down.incorrect", "=", 0],
|
|
84
|
+
["totals.navigations.specific.home.total", "=", 3],
|
|
85
|
+
["totals.navigations.specific.home.correct", "=", 1],
|
|
86
|
+
["totals.navigations.specific.home.incorrect", "=", 2],
|
|
87
|
+
["totals.navigations.specific.end.total", "=", 3],
|
|
88
|
+
["totals.navigations.specific.end.correct", "=", 1],
|
|
89
|
+
["totals.navigations.specific.end.incorrect", "=", 2],
|
|
90
|
+
["totals.tabElements.total", "=", 3],
|
|
91
|
+
["totals.tabElements.correct", "=", 0],
|
|
92
|
+
["totals.tabElements.incorrect", "=", 3],
|
|
93
|
+
["totals.tabLists.total", "=", 1],
|
|
94
|
+
["totals.tabLists.correct", "=", 0],
|
|
95
|
+
["totals.tabLists.incorrect", "=", 1]
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"sources": {
|
|
100
|
+
"script": "",
|
|
101
|
+
"host": {},
|
|
102
|
+
"requester": ""
|
|
103
|
+
},
|
|
104
|
+
"creationTime": "2002-11-12T09:31:00",
|
|
105
|
+
"timeStamp": "00000"
|
|
106
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// temp.js
|
|
2
|
+
// Validation job converter.
|
|
3
|
+
|
|
4
|
+
const fs = require('fs/promises');
|
|
5
|
+
fs.readdir('.').then(async fileNames => {
|
|
6
|
+
const jobNames = fileNames.filter(fileName => fileName.endsWith('.json'));
|
|
7
|
+
for (const jobName of jobNames) {
|
|
8
|
+
const jobJSON = await fs.readFile(jobName, 'utf8');
|
|
9
|
+
const job = JSON.parse(jobJSON);
|
|
10
|
+
const {acts} = job;
|
|
11
|
+
acts.forEach(act => {
|
|
12
|
+
if (act.type === 'test') {
|
|
13
|
+
const {which, expect} = act;
|
|
14
|
+
act.which = 'testaro';
|
|
15
|
+
act.withItems = true;
|
|
16
|
+
act.rules = [
|
|
17
|
+
'y',
|
|
18
|
+
which
|
|
19
|
+
];
|
|
20
|
+
expect.forEach((expectation, index) => {
|
|
21
|
+
expect[index][0] = `result.rules.${which}.data.${expect[index][0]}`;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
job.creationTime = '2013-05-28T12:00:00';
|
|
26
|
+
await fs.writeFile(`new/${jobName}`, `${JSON.stringify(job, null, 2)}\n`);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "elements",
|
|
3
|
+
"what": "validation of elements 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__/textNodes/index.html",
|
|
15
|
+
"what": "page with a shadow root"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "test",
|
|
19
|
+
"which": "textNodes",
|
|
20
|
+
"what": "text nodes",
|
|
21
|
+
"detailLevel": 0,
|
|
22
|
+
"expect": [
|
|
23
|
+
["nodeCount", "=", 35]
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "test",
|
|
28
|
+
"which": "textNodes",
|
|
29
|
+
"what": "text nodes",
|
|
30
|
+
"detailLevel": 0,
|
|
31
|
+
"text": "alia",
|
|
32
|
+
"expect": [
|
|
33
|
+
["nodeCount", "=", 2]
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "test",
|
|
38
|
+
"which": "textNodes",
|
|
39
|
+
"what": "text nodes",
|
|
40
|
+
"detailLevel": 1,
|
|
41
|
+
"text": "alia",
|
|
42
|
+
"expect": [
|
|
43
|
+
["nodeCount", "=", 2],
|
|
44
|
+
["items.0.text", "=", "Io alia"]
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "test",
|
|
49
|
+
"which": "textNodes",
|
|
50
|
+
"what": "text nodes",
|
|
51
|
+
"detailLevel": 2,
|
|
52
|
+
"text": "This is the",
|
|
53
|
+
"expect": [
|
|
54
|
+
["nodeCount", "=", 2],
|
|
55
|
+
["items.0.text", "=", "This is the first button"],
|
|
56
|
+
["items.1.text", "=", "This is the second button"],
|
|
57
|
+
["items.0.ancestors.0.tagName", "=", "BUTTON"],
|
|
58
|
+
["items.1.ancestors.0.tagName", "=", "BUTTON"],
|
|
59
|
+
["items.0.ancestors.0.attributes.0.name", "=", "id"],
|
|
60
|
+
["items.0.ancestors.0.attributes.0.value", "=", "button0"],
|
|
61
|
+
["items.1.ancestors.0.attributes.1.name", "=", "aria-labelledby"],
|
|
62
|
+
["items.1.ancestors.0.attributes.1.value", "=", "button1Label"],
|
|
63
|
+
["items.0.ancestors.0.refLabels"],
|
|
64
|
+
["items.1.ancestors.0.refLabels.0", "=", "Click the second button."],
|
|
65
|
+
["items.0.ancestors.0.labels.0", "=", "Click the first button."],
|
|
66
|
+
["items.0.ancestors.0.labels.1", "=", "Did you click it?"],
|
|
67
|
+
["items.1.ancestors.0.labels"],
|
|
68
|
+
["items.0.ancestors.0.children"]
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "test",
|
|
73
|
+
"which": "textNodes",
|
|
74
|
+
"what": "text nodes",
|
|
75
|
+
"detailLevel": 3,
|
|
76
|
+
"text": "tute alia",
|
|
77
|
+
"expect": [
|
|
78
|
+
["nodeCount", "=", 1],
|
|
79
|
+
["items.0.text", "=", "Io tute alia"],
|
|
80
|
+
["items.0.ancestors.0.tagName", "=", "LI"],
|
|
81
|
+
["items.0.ancestors.1.tagName", "=", "UL"],
|
|
82
|
+
["items.0.ancestors.0.attributes.0.name", "=", "class"],
|
|
83
|
+
["items.0.ancestors.0.attributes.0.value", "=", "last"],
|
|
84
|
+
["items.0.ancestors.1.attributes.0.name", "=", "lang"],
|
|
85
|
+
["items.0.ancestors.1.attributes.0.value", "=", "eo"],
|
|
86
|
+
["items.0.ancestors.1.children.1.tagName", "=", "LI"],
|
|
87
|
+
["items.0.ancestors.1.children.2.attributes.1.name", "=", "hidden"]
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"sources": {
|
|
92
|
+
"script": "",
|
|
93
|
+
"host": {},
|
|
94
|
+
"requester": ""
|
|
95
|
+
},
|
|
96
|
+
"creationTime": "2002-11-12T09:31:00",
|
|
97
|
+
"timeStamp": "00000"
|
|
98
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "title",
|
|
3
|
+
"what": "validation of title 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__/title/good.html",
|
|
15
|
+
"what": "page with a title"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "test",
|
|
19
|
+
"which": "title",
|
|
20
|
+
"what": "document title",
|
|
21
|
+
"expect": [
|
|
22
|
+
["title", "=", "Test page"]
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "url",
|
|
27
|
+
"which": "__targets__/title/bad.html",
|
|
28
|
+
"what": "page without a title"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "test",
|
|
32
|
+
"which": "title",
|
|
33
|
+
"what": "document title",
|
|
34
|
+
"expect": [
|
|
35
|
+
["title", "=", ""]
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"sources": {
|
|
40
|
+
"script": "",
|
|
41
|
+
"host": {},
|
|
42
|
+
"requester": ""
|
|
43
|
+
},
|
|
44
|
+
"creationTime": "2002-11-12T09:31:00",
|
|
45
|
+
"timeStamp": "00000"
|
|
46
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "titledEl",
|
|
3
|
+
"what": "validation of titledEl 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__/titledEl/index.html",
|
|
15
|
+
"what": "page with valid and invalid title attributes"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "test",
|
|
19
|
+
"which": "titledEl",
|
|
20
|
+
"what": "title attributes on inappropriate elements",
|
|
21
|
+
"withItems": true,
|
|
22
|
+
"expect": [
|
|
23
|
+
["total", "=", 1],
|
|
24
|
+
["items.0.tagName", "=", "P"],
|
|
25
|
+
["items.0.text", "=", "This paragraph has an invalid title element."],
|
|
26
|
+
["items.0.title", "=", "invalid title"]
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"sources": {
|
|
31
|
+
"script": "",
|
|
32
|
+
"host": {},
|
|
33
|
+
"requester": ""
|
|
34
|
+
},
|
|
35
|
+
"creationTime": "2002-11-12T09:31:00",
|
|
36
|
+
"timeStamp": "00000"
|
|
37
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "zIndex",
|
|
3
|
+
"what": "validation of zIndex 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__/zIndex/good.html",
|
|
15
|
+
"what": "page with no explicit z-index attributes"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "test",
|
|
19
|
+
"which": "zIndex",
|
|
20
|
+
"what": "zIndex",
|
|
21
|
+
"withItems": false,
|
|
22
|
+
"expect": [
|
|
23
|
+
["totals.total", "=", 0]
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "url",
|
|
28
|
+
"which": "__targets__/zIndex/bad.html",
|
|
29
|
+
"what": "page with explicit z-index attributes"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "test",
|
|
33
|
+
"which": "zIndex",
|
|
34
|
+
"what": "zIndex",
|
|
35
|
+
"withItems": false,
|
|
36
|
+
"expect": [
|
|
37
|
+
["totals.total", "=", 2],
|
|
38
|
+
["totals.tagNames.BUTTON", "=", 2]
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"sources": {
|
|
43
|
+
"script": "",
|
|
44
|
+
"host": {},
|
|
45
|
+
"requester": ""
|
|
46
|
+
},
|
|
47
|
+
"creationTime": "2002-11-12T09:31:00",
|
|
48
|
+
"timeStamp": "00000"
|
|
49
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<main>
|
|
11
|
-
<h1>Page with
|
|
11
|
+
<h1>Page with licit attribute values</h1>
|
|
12
12
|
<p><q><span>lang="de-CH">Veloparkieren nicht gestattet</span></q> is Swiss German, so it is marked up with the <code>de-CH</code> language tag.</p>
|
|
13
13
|
</main>
|
|
14
14
|
</body>
|
package/tests/embAc.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
embAc
|
|
3
|
-
This test reports interactive elements (links, buttons, inputs, and select lists)
|
|
4
|
-
contained by links or buttons. Such embedding not only violates the HTML standard,
|
|
5
|
-
but also complicates user interaction and creates risks of error. It becomes
|
|
6
|
-
non-obvious what a user will activate with a click.
|
|
7
|
-
*/
|
|
8
|
-
exports.reporter = async (page, withItems) => await page.$$eval(
|
|
9
|
-
'a a, a button, a input, a select, button a, button button, button input, button select',
|
|
10
|
-
(bads, withItems) => {
|
|
11
|
-
// FUNCTION DEFINITION START
|
|
12
|
-
// Returns a space-minimized copy of a string.
|
|
13
|
-
const compact = string => string.replace(/[\t\n]/g, '').replace(/\s{2,}/g, ' ').trim();
|
|
14
|
-
// FUNCTION DEFINITION END
|
|
15
|
-
const totals = {
|
|
16
|
-
links: 0,
|
|
17
|
-
buttons: 0,
|
|
18
|
-
inputs: 0,
|
|
19
|
-
selects: 0
|
|
20
|
-
};
|
|
21
|
-
const items = [];
|
|
22
|
-
// Total and, if requested, itemize the faulty elements.
|
|
23
|
-
bads.forEach(bad => {
|
|
24
|
-
totals[Object.keys(totals)[['A', 'BUTTON', 'INPUT', 'SELECT'].indexOf(bad.tagName)]]++;
|
|
25
|
-
if (withItems) {
|
|
26
|
-
items.push(compact(bad.outerHTML));
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
// Return the result.
|
|
30
|
-
const data = {totals};
|
|
31
|
-
if (withItems) {
|
|
32
|
-
data.items = items;
|
|
33
|
-
}
|
|
34
|
-
return {result: data};
|
|
35
|
-
}, withItems
|
|
36
|
-
);
|