testaro 30.0.7 → 32.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.
Files changed (212) hide show
  1. package/CONTRIBUTING.md +26 -4
  2. package/LICENSE +1 -1
  3. package/README.md +24 -2
  4. package/aceconfig.js +27 -0
  5. package/actSpecs.js +28 -1
  6. package/call.js +22 -1
  7. package/data/template.js +22 -0
  8. package/dirWatch.js +22 -0
  9. package/package.json +1 -1
  10. package/procs/aslint.js +24 -0
  11. package/procs/getLocatorData.js +29 -1
  12. package/procs/getSource.js +30 -3
  13. package/procs/isInlineLink.js +23 -0
  14. package/procs/operable.js +23 -2
  15. package/procs/sample.js +22 -0
  16. package/procs/standardize.js +28 -7
  17. package/procs/tellServer.js +24 -2
  18. package/procs/testaro.js +26 -1
  19. package/procs/visChange.js +22 -0
  20. package/run.js +371 -83
  21. package/testaro/allCaps.js +22 -0
  22. package/testaro/allHidden.js +22 -0
  23. package/testaro/allSlanted.js +22 -0
  24. package/testaro/attVal.js +22 -0
  25. package/testaro/autocomplete.js +22 -0
  26. package/testaro/bulk.js +22 -0
  27. package/testaro/buttonMenu.js +22 -0
  28. package/testaro/distortion.js +22 -0
  29. package/testaro/docType.js +22 -0
  30. package/testaro/dupAtt.js +22 -0
  31. package/testaro/elements.js +22 -0
  32. package/testaro/embAc.js +22 -0
  33. package/testaro/filter.js +22 -0
  34. package/testaro/focAll.js +22 -0
  35. package/testaro/focInd.js +22 -0
  36. package/testaro/focOp.js +22 -0
  37. package/testaro/focVis.js +22 -0
  38. package/testaro/headEl.js +22 -0
  39. package/testaro/headingAmb.js +22 -0
  40. package/testaro/hovInd.js +21 -24
  41. package/testaro/hover.js +22 -0
  42. package/testaro/labClash.js +22 -0
  43. package/testaro/lineHeight.js +22 -0
  44. package/testaro/linkAmb.js +22 -0
  45. package/testaro/linkTitle.js +22 -0
  46. package/testaro/linkUl.js +22 -0
  47. package/testaro/miniText.js +22 -0
  48. package/testaro/motion.js +22 -0
  49. package/testaro/nonTable.js +22 -0
  50. package/testaro/opFoc.js +22 -0
  51. package/testaro/pseudoP.js +25 -3
  52. package/testaro/radioSet.js +22 -0
  53. package/testaro/role.js +22 -0
  54. package/testaro/styleDiff.js +80 -1
  55. package/testaro/tabNav.js +99 -2
  56. package/testaro/targetSize.js +22 -0
  57. package/testaro/textNodes.js +25 -3
  58. package/testaro/title.js +22 -0
  59. package/testaro/zIndex.js +22 -0
  60. package/tests/alfa.js +34 -12
  61. package/tests/aslint.js +55 -17
  62. package/tests/axe.js +35 -9
  63. package/tests/htmlcs.js +109 -78
  64. package/tests/ibm.js +111 -45
  65. package/tests/nuVal.js +39 -9
  66. package/tests/qualWeb.js +49 -25
  67. package/tests/testaro.js +50 -22
  68. package/tests/wave.js +36 -10
  69. package/validation/executors/run.js +26 -2
  70. package/validation/executors/test.js +27 -3
  71. package/validation/executors/tests.js +26 -2
  72. package/validation/executors/watchDir.js +26 -2
  73. package/validation/executors/watchNet.js +26 -2
  74. package/validation/jobs/todo/README.md +22 -0
  75. package/validation/tests/targets/adbID/index.html +21 -0
  76. package/validation/tests/targets/allCaps/index.html +21 -0
  77. package/validation/tests/targets/allHidden/ariaHiddenBody.html +21 -0
  78. package/validation/tests/targets/allHidden/good.html +21 -0
  79. package/validation/tests/targets/allHidden/hiddenMain.html +21 -0
  80. package/validation/tests/targets/allHidden/mixedHidden.html +22 -1
  81. package/validation/tests/targets/allHidden/noBody.html +21 -0
  82. package/validation/tests/targets/allHidden/noMain.html +21 -0
  83. package/validation/tests/targets/allHidden/noneDoc.html +21 -0
  84. package/validation/tests/targets/allHidden/visHiddenMain.html +21 -0
  85. package/validation/tests/targets/allSlanted/index.html +21 -0
  86. package/validation/tests/targets/altScheme/index.html +21 -0
  87. package/validation/tests/targets/attVal/bad.html +21 -0
  88. package/validation/tests/targets/attVal/good.html +21 -0
  89. package/validation/tests/targets/autocomplete/bad.html +21 -0
  90. package/validation/tests/targets/autocomplete/good.html +21 -0
  91. package/validation/tests/targets/bulk/bad.html +21 -0
  92. package/validation/tests/targets/bulk/good.html +21 -0
  93. package/validation/tests/targets/buttonMenu/bad.html +21 -0
  94. package/validation/tests/targets/buttonMenu/bad.js +27 -0
  95. package/validation/tests/targets/buttonMenu/good.html +21 -0
  96. package/validation/tests/targets/buttonMenu/good.js +27 -0
  97. package/validation/tests/targets/buttonMenu/style.css +27 -0
  98. package/validation/tests/targets/captionLoc/index.html +21 -0
  99. package/validation/tests/targets/datalistRef/index.html +21 -0
  100. package/validation/tests/targets/distortion/index.html +21 -0
  101. package/validation/tests/targets/docType/bad.html +21 -0
  102. package/validation/tests/targets/docType/good.html +21 -0
  103. package/validation/tests/targets/dupAtt/bad.html +21 -0
  104. package/validation/tests/targets/dupAtt/good.html +21 -0
  105. package/validation/tests/targets/elements/index.html +21 -0
  106. package/validation/tests/targets/embAc/bad.html +21 -0
  107. package/validation/tests/targets/embAc/good.html +21 -0
  108. package/validation/tests/targets/filter/bad.html +21 -0
  109. package/validation/tests/targets/filter/good.html +21 -0
  110. package/validation/tests/targets/focAll/good.html +21 -0
  111. package/validation/tests/targets/focAll/less.html +21 -0
  112. package/validation/tests/targets/focAll/more.html +21 -0
  113. package/validation/tests/targets/focInd/bad.html +21 -0
  114. package/validation/tests/targets/focInd/good.html +21 -0
  115. package/validation/tests/targets/focOp/bad.html +21 -0
  116. package/validation/tests/targets/focOp/good.html +21 -0
  117. package/validation/tests/targets/focVis/index.html +21 -0
  118. package/validation/tests/targets/headEl/index.html +21 -0
  119. package/validation/tests/targets/headingAmb/index.html +21 -0
  120. package/validation/tests/targets/hovInd/index.html +21 -0
  121. package/validation/tests/targets/hover/bad.html +21 -0
  122. package/validation/tests/targets/hover/good.html +21 -0
  123. package/validation/tests/targets/hr/index.html +21 -0
  124. package/validation/tests/targets/imageLink/index.html +21 -0
  125. package/validation/tests/targets/labClash/bad.html +21 -0
  126. package/validation/tests/targets/labClash/good.html +21 -0
  127. package/validation/tests/targets/legendLoc/index.html +21 -0
  128. package/validation/tests/targets/lineHeight/index.html +21 -0
  129. package/validation/tests/targets/linkAmb/index.html +21 -0
  130. package/validation/tests/targets/linkExt/index.html +21 -0
  131. package/validation/tests/targets/linkOldAtt/index.html +21 -0
  132. package/validation/tests/targets/linkTitle/index.html +21 -0
  133. package/validation/tests/targets/linkTo/index.html +21 -0
  134. package/validation/tests/targets/linkUl/bad.html +21 -0
  135. package/validation/tests/targets/linkUl/good.html +21 -0
  136. package/validation/tests/targets/linkUl/na.html +21 -0
  137. package/validation/tests/targets/miniText/index.html +21 -0
  138. package/validation/tests/targets/motion/bad.css +27 -0
  139. package/validation/tests/targets/motion/bad.html +21 -0
  140. package/validation/tests/targets/motion/good.html +21 -0
  141. package/validation/tests/targets/nonTable/index.html +21 -0
  142. package/validation/tests/targets/opFoc/bad.html +21 -0
  143. package/validation/tests/targets/opFoc/good.html +21 -0
  144. package/validation/tests/targets/optRoleSel/index.html +21 -0
  145. package/validation/tests/targets/phOnly/index.html +21 -0
  146. package/validation/tests/targets/pseudoP/index.html +21 -0
  147. package/validation/tests/targets/radioSet/bad.html +21 -0
  148. package/validation/tests/targets/radioSet/good.html +21 -0
  149. package/validation/tests/targets/role/bad.html +21 -0
  150. package/validation/tests/targets/role/good.html +21 -0
  151. package/validation/tests/targets/secHeading/index.html +21 -0
  152. package/validation/tests/targets/styleDiff/bad.html +21 -0
  153. package/validation/tests/targets/styleDiff/good.html +21 -0
  154. package/validation/tests/targets/tabNav/bad.html +21 -0
  155. package/validation/tests/targets/tabNav/bad.js +27 -0
  156. package/validation/tests/targets/tabNav/good.html +21 -0
  157. package/validation/tests/targets/tabNav/good.js +27 -0
  158. package/validation/tests/targets/tabNav/style.css +27 -0
  159. package/validation/tests/targets/targetSize/index.html +21 -0
  160. package/validation/tests/targets/textNodes/index.html +21 -0
  161. package/validation/tests/targets/textSem/index.html +21 -0
  162. package/validation/tests/targets/title/bad.html +21 -0
  163. package/validation/tests/targets/title/good.html +21 -0
  164. package/validation/tests/targets/titledEl/index.html +21 -0
  165. package/validation/tests/targets/zIndex/bad.html +21 -0
  166. package/validation/tests/targets/zIndex/good.html +21 -0
  167. package/validation/validateTest.js +26 -2
  168. package/validation/watch/done/README.md +23 -1
  169. package/validation/watch/todo/README.md +23 -1
  170. package/watch.js +32 -7
  171. package/call-old.js +0 -86
  172. package/procs/allText.js +0 -76
  173. package/procs/allVis.js +0 -17
  174. package/procs/getTextNodes.js +0 -39
  175. package/procs/linksByType.js +0 -54
  176. package/procs/nav.js +0 -259
  177. package/procs/textOf.txt +0 -73
  178. package/test copy.js +0 -38
  179. package/validation/tests/old/allCaps.json +0 -102
  180. package/validation/tests/old/allHidden.json +0 -314
  181. package/validation/tests/old/attVal.json +0 -60
  182. package/validation/tests/old/autocomplete.json +0 -51
  183. package/validation/tests/old/bulk.json +0 -48
  184. package/validation/tests/old/docType.json +0 -46
  185. package/validation/tests/old/dupAtt.json +0 -51
  186. package/validation/tests/old/elements.json +0 -140
  187. package/validation/tests/old/embAc.json +0 -54
  188. package/validation/tests/old/filter.json +0 -55
  189. package/validation/tests/old/focAll.json +0 -68
  190. package/validation/tests/old/focInd.json +0 -69
  191. package/validation/tests/old/focOp.json +0 -62
  192. package/validation/tests/old/focVis.json +0 -35
  193. package/validation/tests/old/hover.json +0 -118
  194. package/validation/tests/old/labClash.json +0 -52
  195. package/validation/tests/old/linkTo.json +0 -35
  196. package/validation/tests/old/linkUl.json +0 -71
  197. package/validation/tests/old/menuNav.json +0 -106
  198. package/validation/tests/old/miniText.json +0 -36
  199. package/validation/tests/old/motion.json +0 -62
  200. package/validation/tests/old/nonTable.json +0 -37
  201. package/validation/tests/old/radioSet.json +0 -52
  202. package/validation/tests/old/role.json +0 -60
  203. package/validation/tests/old/styleDiff.json +0 -71
  204. package/validation/tests/old/tabNav.json +0 -106
  205. package/validation/tests/old/temp.js +0 -28
  206. package/validation/tests/old/textNodes.json +0 -98
  207. package/validation/tests/old/title.json +0 -46
  208. package/validation/tests/old/titledEl.json +0 -37
  209. package/validation/tests/old/zIndex.json +0 -49
  210. package/validation/tests/targets/tabNav/goodMoz.js +0 -206
  211. package/watch-old.js +0 -275
  212. package/watch-temp.js +0 -45
@@ -1,71 +0,0 @@
1
- {
2
- "id": "styleDiff",
3
- "what": "validation of styleDiff 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__/styleDiff/good.html",
15
- "what": "page with consistent styles"
16
- },
17
- {
18
- "type": "test",
19
- "which": "styleDiff",
20
- "withItems": true,
21
- "what": "styleDiff",
22
- "expect": [
23
- ["totals.adjacentLink.total", "=", 2],
24
- ["totals.listLink.total", "=", 2],
25
- ["totals.button.total", "=", 2],
26
- ["totals.h1.total", "=", 1],
27
- ["totals.h2.total", "=", 4],
28
- ["totals.adjacentLink.subtotals"],
29
- ["totals.listLink.subtotals"],
30
- ["totals.button.subtotals"],
31
- ["totals.h1.subtotals"],
32
- ["totals.h2.subtotals"]
33
- ]
34
- },
35
- {
36
- "type": "url",
37
- "which": "__targets__/styleDiff/bad.html",
38
- "what": "page with consistent styles"
39
- },
40
- {
41
- "type": "test",
42
- "which": "styleDiff",
43
- "withItems": true,
44
- "what": "styleDiff",
45
- "expect": [
46
- ["totals.adjacentLink.total", "=", 2],
47
- ["totals.listLink.total", "=", 2],
48
- ["totals.button.total", "=", 2],
49
- ["totals.h1.total", "=", 1],
50
- ["totals.h2.total", "=", 4],
51
- ["totals.adjacentLink.subtotals.0", "=", 1],
52
- ["totals.adjacentLink.subtotals.1", "=", 1],
53
- ["totals.listLink.subtotals.0", "=", 1],
54
- ["totals.listLink.subtotals.1", "=", 1],
55
- ["totals.button.subtotals.0", "=", 1],
56
- ["totals.button.subtotals.1", "=", 1],
57
- ["totals.h1.subtotals"],
58
- ["totals.h2.subtotals.0", "=", 3],
59
- ["totals.h2.subtotals.1", "=", 1],
60
- ["items.adjacentLink.textDecorationStyle.double.0", "=", "French information"]
61
- ]
62
- }
63
- ],
64
- "sources": {
65
- "script": "",
66
- "host": {},
67
- "requester": ""
68
- },
69
- "creationTime": "2002-11-12T09:31:00",
70
- "timeStamp": "00000"
71
- }
@@ -1,106 +0,0 @@
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
- }
@@ -1,28 +0,0 @@
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
- });
@@ -1,98 +0,0 @@
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
- }
@@ -1,46 +0,0 @@
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
- }
@@ -1,37 +0,0 @@
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
- }
@@ -1,49 +0,0 @@
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
- }
@@ -1,206 +0,0 @@
1
- /*
2
- * This content is licensed according to the W3C Software License at
3
- * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
4
- */
5
- const manageTabs = () => {
6
- const tablist = document.querySelectorAll('[role="tablist"]')[0];
7
- let tabs;
8
- let panels;
9
-
10
- const generateArrays = () => {
11
- tabs = document.querySelectorAll('[role="tab"]');
12
- panels = document.querySelectorAll('[role="tabpanel"]');
13
- };
14
-
15
- generateArrays();
16
-
17
- // For easy reference
18
- const keys = {
19
- end: 35,
20
- home: 36,
21
- left: 37,
22
- up: 38,
23
- right: 39,
24
- down: 40
25
- };
26
-
27
- // Add or substract depending on key pressed
28
- const direction = {
29
- 37: -1,
30
- 38: -1,
31
- 39: 1,
32
- 40: 1
33
- };
34
-
35
- // When a tab is clicked, activateTab is fired to activate it
36
- const clickEventListener = event => {
37
- const tab = event.target;
38
- activateTab(tab, false);
39
- };
40
-
41
- // Handle keydown on tabs
42
- const keydownEventListener = event => {
43
- const key = event.keyCode;
44
-
45
- switch (key) {
46
- case keys.end:
47
- event.preventDefault();
48
- // Activate last tab
49
- activateTab(tabs[tabs.length - 1]);
50
- break;
51
- case keys.home:
52
- event.preventDefault();
53
- // Activate first tab
54
- activateTab(tabs[0]);
55
- break;
56
-
57
- // Up and down are in keydown
58
- // because we need to prevent page scroll >:)
59
- case keys.up:
60
- case keys.down:
61
- determineOrientation(event);
62
- break;
63
- }
64
- };
65
-
66
- // Handle keyup on tabs
67
- const keyupEventListener = event => {
68
- const key = event.keyCode;
69
-
70
- switch (key) {
71
- case keys.left:
72
- case keys.right:
73
- determineOrientation(event);
74
- break;
75
- }
76
- };
77
-
78
- const addListeners = index => {
79
- tabs[index].addEventListener('click', clickEventListener);
80
- tabs[index].addEventListener('keydown', keydownEventListener);
81
- tabs[index].addEventListener('keyup', keyupEventListener);
82
-
83
- // Build an array with all tabs (<button>s) in it
84
- tabs[index].index = index;
85
- };
86
-
87
- // Bind listeners
88
- for (let i = 0; i < tabs.length; ++i) {
89
- addListeners(i);
90
- }
91
-
92
- // When a tablist’s aria-orientation is set to vertical,
93
- // only up and down arrow should function.
94
- // In all other cases only left and right arrow function.
95
- const determineOrientation = event => {
96
- const key = event.keyCode;
97
- const vertical = tablist.getAttribute('aria-orientation') == 'vertical';
98
- let proceed = false;
99
-
100
- if (vertical) {
101
- if (key === keys.up || key === keys.down) {
102
- event.preventDefault();
103
- proceed = true;
104
- }
105
- }
106
- else {
107
- if (key === keys.left || key === keys.right) {
108
- proceed = true;
109
- }
110
- }
111
-
112
- if (proceed) {
113
- switchTabOnArrowPress(event);
114
- }
115
- };
116
-
117
- // Either focus the next, previous, first, or last tab
118
- // depening on key pressed
119
- function switchTabOnArrowPress (event) {
120
- const pressed = event.keyCode;
121
-
122
- for (let x = 0; x < tabs.length; x++) {
123
- tabs[x].addEventListener('focus', focusEventHandler);
124
- }
125
-
126
- if (direction[pressed]) {
127
- const target = event.target;
128
- if (target.index !== undefined) {
129
- if (tabs[target.index + direction[pressed]]) {
130
- tabs[target.index + direction[pressed]].focus();
131
- }
132
- else if (pressed === keys.left || pressed === keys.up) {
133
- focusLastTab();
134
- }
135
- else if (pressed === keys.right || pressed == keys.down) {
136
- focusFirstTab();
137
- }
138
- }
139
- }
140
- }
141
-
142
- // Activates any given tab panel
143
- const activateTab = (tab, setFocus) => {
144
- setFocus = setFocus || true;
145
- // Deactivate all other tabs
146
- deactivateTabs();
147
-
148
- // Remove tabindex attribute
149
- tab.removeAttribute('tabindex');
150
-
151
- // Set the tab as selected
152
- tab.setAttribute('aria-selected', 'true');
153
-
154
- // Get the value of aria-controls (which is an ID)
155
- var controls = tab.getAttribute('aria-controls');
156
-
157
- // Remove hidden attribute from tab panel to make it visible
158
- document.getElementById(controls).removeAttribute('hidden');
159
-
160
- // Set focus when required
161
- if (setFocus) {
162
- tab.focus();
163
- }
164
- };
165
-
166
- // Deactivate all tabs and tab panels
167
- const deactivateTabs = () => {
168
- for (let t = 0; t < tabs.length; t++) {
169
- tabs[t].setAttribute('tabindex', '-1');
170
- tabs[t].setAttribute('aria-selected', 'false');
171
- tabs[t].removeEventListener('focus', focusEventHandler);
172
- }
173
-
174
- for (let p = 0; p < panels.length; p++) {
175
- panels[p].setAttribute('hidden', 'hidden');
176
- }
177
- };
178
-
179
- // Make a guess
180
- const focusFirstTab = () => {
181
- tabs[0].focus();
182
- };
183
-
184
- // Make a guess
185
- const focusLastTab = () => {
186
- tabs[tabs.length - 1].focus();
187
- };
188
-
189
- //
190
- const focusEventHandler = event => {
191
- const target = event.target;
192
-
193
- setTimeout(checkTabFocus, 0, target);
194
- };
195
-
196
- // Only activate tab on focus if it still has focus after the delay
197
- const checkTabFocus = target => {
198
- const focused = document.activeElement;
199
-
200
- if (target === focused) {
201
- activateTab(target, false);
202
- }
203
- };
204
- };
205
-
206
- manageTabs();