testaro 30.0.8 → 32.0.1
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/CONTRIBUTING.md +26 -4
- package/LICENSE +1 -1
- package/README.md +24 -2
- package/aceconfig.js +27 -0
- package/actSpecs.js +28 -1
- package/call.js +22 -1
- package/data/template.js +22 -0
- package/dirWatch.js +22 -0
- package/package.json +1 -1
- package/procs/aslint.js +24 -0
- package/procs/getLocatorData.js +29 -1
- package/procs/getSource.js +30 -3
- package/procs/isInlineLink.js +23 -0
- package/procs/operable.js +23 -2
- package/procs/sample.js +22 -0
- package/procs/standardize.js +28 -7
- package/procs/tellServer.js +24 -2
- package/procs/testaro.js +26 -1
- package/procs/visChange.js +22 -0
- package/run.js +373 -83
- package/testaro/allCaps.js +22 -0
- package/testaro/allHidden.js +22 -0
- package/testaro/allSlanted.js +22 -0
- package/testaro/attVal.js +22 -0
- package/testaro/autocomplete.js +22 -0
- package/testaro/bulk.js +22 -0
- package/testaro/buttonMenu.js +22 -0
- package/testaro/distortion.js +22 -0
- package/testaro/docType.js +22 -0
- package/testaro/dupAtt.js +22 -0
- package/testaro/elements.js +22 -0
- package/testaro/embAc.js +22 -0
- package/testaro/filter.js +22 -0
- package/testaro/focAll.js +22 -0
- package/testaro/focInd.js +22 -0
- package/testaro/focOp.js +22 -0
- package/testaro/focVis.js +22 -0
- package/testaro/headEl.js +22 -0
- package/testaro/headingAmb.js +22 -0
- package/testaro/hovInd.js +21 -24
- package/testaro/hover.js +22 -0
- package/testaro/labClash.js +22 -0
- package/testaro/lineHeight.js +22 -0
- package/testaro/linkAmb.js +22 -0
- package/testaro/linkTitle.js +22 -0
- package/testaro/linkUl.js +22 -0
- package/testaro/miniText.js +22 -0
- package/testaro/motion.js +22 -0
- package/testaro/nonTable.js +22 -0
- package/testaro/opFoc.js +22 -0
- package/testaro/pseudoP.js +25 -3
- package/testaro/radioSet.js +22 -0
- package/testaro/role.js +22 -0
- package/testaro/styleDiff.js +80 -1
- package/testaro/tabNav.js +99 -2
- package/testaro/targetSize.js +22 -0
- package/testaro/textNodes.js +25 -3
- package/testaro/title.js +22 -0
- package/testaro/zIndex.js +22 -0
- package/tests/alfa.js +34 -12
- package/tests/aslint.js +55 -17
- package/tests/axe.js +35 -9
- package/tests/htmlcs.js +109 -78
- package/tests/ibm.js +111 -45
- package/tests/nuVal.js +39 -9
- package/tests/qualWeb.js +49 -25
- package/tests/testaro.js +50 -22
- package/tests/wave.js +36 -10
- package/validation/executors/run.js +26 -2
- package/validation/executors/test.js +27 -3
- package/validation/executors/tests.js +26 -2
- package/validation/executors/watchDir.js +26 -2
- package/validation/executors/watchNet.js +26 -2
- package/validation/jobs/todo/README.md +22 -0
- package/validation/tests/targets/adbID/index.html +21 -0
- package/validation/tests/targets/allCaps/index.html +21 -0
- package/validation/tests/targets/allHidden/ariaHiddenBody.html +21 -0
- package/validation/tests/targets/allHidden/good.html +21 -0
- package/validation/tests/targets/allHidden/hiddenMain.html +21 -0
- package/validation/tests/targets/allHidden/mixedHidden.html +22 -1
- package/validation/tests/targets/allHidden/noBody.html +21 -0
- package/validation/tests/targets/allHidden/noMain.html +21 -0
- package/validation/tests/targets/allHidden/noneDoc.html +21 -0
- package/validation/tests/targets/allHidden/visHiddenMain.html +21 -0
- package/validation/tests/targets/allSlanted/index.html +21 -0
- package/validation/tests/targets/altScheme/index.html +21 -0
- package/validation/tests/targets/attVal/bad.html +21 -0
- package/validation/tests/targets/attVal/good.html +21 -0
- package/validation/tests/targets/autocomplete/bad.html +21 -0
- package/validation/tests/targets/autocomplete/good.html +21 -0
- package/validation/tests/targets/bulk/bad.html +21 -0
- package/validation/tests/targets/bulk/good.html +21 -0
- package/validation/tests/targets/buttonMenu/bad.html +21 -0
- package/validation/tests/targets/buttonMenu/bad.js +27 -0
- package/validation/tests/targets/buttonMenu/good.html +21 -0
- package/validation/tests/targets/buttonMenu/good.js +27 -0
- package/validation/tests/targets/buttonMenu/style.css +27 -0
- package/validation/tests/targets/captionLoc/index.html +21 -0
- package/validation/tests/targets/datalistRef/index.html +21 -0
- package/validation/tests/targets/distortion/index.html +21 -0
- package/validation/tests/targets/docType/bad.html +21 -0
- package/validation/tests/targets/docType/good.html +21 -0
- package/validation/tests/targets/dupAtt/bad.html +21 -0
- package/validation/tests/targets/dupAtt/good.html +21 -0
- package/validation/tests/targets/elements/index.html +21 -0
- package/validation/tests/targets/embAc/bad.html +21 -0
- package/validation/tests/targets/embAc/good.html +21 -0
- package/validation/tests/targets/filter/bad.html +21 -0
- package/validation/tests/targets/filter/good.html +21 -0
- package/validation/tests/targets/focAll/good.html +21 -0
- package/validation/tests/targets/focAll/less.html +21 -0
- package/validation/tests/targets/focAll/more.html +21 -0
- package/validation/tests/targets/focInd/bad.html +21 -0
- package/validation/tests/targets/focInd/good.html +21 -0
- package/validation/tests/targets/focOp/bad.html +21 -0
- package/validation/tests/targets/focOp/good.html +21 -0
- package/validation/tests/targets/focVis/index.html +21 -0
- package/validation/tests/targets/headEl/index.html +21 -0
- package/validation/tests/targets/headingAmb/index.html +21 -0
- package/validation/tests/targets/hovInd/index.html +21 -0
- package/validation/tests/targets/hover/bad.html +21 -0
- package/validation/tests/targets/hover/good.html +21 -0
- package/validation/tests/targets/hr/index.html +21 -0
- package/validation/tests/targets/imageLink/index.html +21 -0
- package/validation/tests/targets/labClash/bad.html +21 -0
- package/validation/tests/targets/labClash/good.html +21 -0
- package/validation/tests/targets/legendLoc/index.html +21 -0
- package/validation/tests/targets/lineHeight/index.html +21 -0
- package/validation/tests/targets/linkAmb/index.html +21 -0
- package/validation/tests/targets/linkExt/index.html +21 -0
- package/validation/tests/targets/linkOldAtt/index.html +21 -0
- package/validation/tests/targets/linkTitle/index.html +21 -0
- package/validation/tests/targets/linkTo/index.html +21 -0
- package/validation/tests/targets/linkUl/bad.html +21 -0
- package/validation/tests/targets/linkUl/good.html +21 -0
- package/validation/tests/targets/linkUl/na.html +21 -0
- package/validation/tests/targets/miniText/index.html +21 -0
- package/validation/tests/targets/motion/bad.css +27 -0
- package/validation/tests/targets/motion/bad.html +21 -0
- package/validation/tests/targets/motion/good.html +21 -0
- package/validation/tests/targets/nonTable/index.html +21 -0
- package/validation/tests/targets/opFoc/bad.html +21 -0
- package/validation/tests/targets/opFoc/good.html +21 -0
- package/validation/tests/targets/optRoleSel/index.html +21 -0
- package/validation/tests/targets/phOnly/index.html +21 -0
- package/validation/tests/targets/pseudoP/index.html +21 -0
- package/validation/tests/targets/radioSet/bad.html +21 -0
- package/validation/tests/targets/radioSet/good.html +21 -0
- package/validation/tests/targets/role/bad.html +21 -0
- package/validation/tests/targets/role/good.html +21 -0
- package/validation/tests/targets/secHeading/index.html +21 -0
- package/validation/tests/targets/styleDiff/bad.html +21 -0
- package/validation/tests/targets/styleDiff/good.html +21 -0
- package/validation/tests/targets/tabNav/bad.html +21 -0
- package/validation/tests/targets/tabNav/bad.js +27 -0
- package/validation/tests/targets/tabNav/good.html +21 -0
- package/validation/tests/targets/tabNav/good.js +27 -0
- package/validation/tests/targets/tabNav/style.css +27 -0
- package/validation/tests/targets/targetSize/index.html +21 -0
- package/validation/tests/targets/textNodes/index.html +21 -0
- package/validation/tests/targets/textSem/index.html +21 -0
- package/validation/tests/targets/title/bad.html +21 -0
- package/validation/tests/targets/title/good.html +21 -0
- package/validation/tests/targets/titledEl/index.html +21 -0
- package/validation/tests/targets/zIndex/bad.html +21 -0
- package/validation/tests/targets/zIndex/good.html +21 -0
- package/validation/validateTest.js +39 -3
- package/validation/watch/done/README.md +23 -1
- package/validation/watch/todo/README.md +23 -1
- package/watch.js +32 -7
- package/call-old.js +0 -86
- package/procs/allText.js +0 -76
- package/procs/allVis.js +0 -17
- package/procs/getTextNodes.js +0 -39
- package/procs/linksByType.js +0 -54
- package/procs/nav.js +0 -259
- package/procs/textOf.txt +0 -73
- package/test copy.js +0 -38
- package/validation/tests/old/allCaps.json +0 -102
- package/validation/tests/old/allHidden.json +0 -314
- package/validation/tests/old/attVal.json +0 -60
- package/validation/tests/old/autocomplete.json +0 -51
- package/validation/tests/old/bulk.json +0 -48
- package/validation/tests/old/docType.json +0 -46
- package/validation/tests/old/dupAtt.json +0 -51
- package/validation/tests/old/elements.json +0 -140
- package/validation/tests/old/embAc.json +0 -54
- package/validation/tests/old/filter.json +0 -55
- package/validation/tests/old/focAll.json +0 -68
- package/validation/tests/old/focInd.json +0 -69
- package/validation/tests/old/focOp.json +0 -62
- package/validation/tests/old/focVis.json +0 -35
- package/validation/tests/old/hover.json +0 -118
- package/validation/tests/old/labClash.json +0 -52
- package/validation/tests/old/linkTo.json +0 -35
- package/validation/tests/old/linkUl.json +0 -71
- package/validation/tests/old/menuNav.json +0 -106
- package/validation/tests/old/miniText.json +0 -36
- package/validation/tests/old/motion.json +0 -62
- package/validation/tests/old/nonTable.json +0 -37
- package/validation/tests/old/radioSet.json +0 -52
- package/validation/tests/old/role.json +0 -60
- package/validation/tests/old/styleDiff.json +0 -71
- package/validation/tests/old/tabNav.json +0 -106
- package/validation/tests/old/temp.js +0 -28
- package/validation/tests/old/textNodes.json +0 -98
- package/validation/tests/old/title.json +0 -46
- package/validation/tests/old/titledEl.json +0 -37
- package/validation/tests/old/zIndex.json +0 -49
- package/validation/tests/targets/tabNav/goodMoz.js +0 -206
- package/watch-old.js +0 -275
- package/watch-temp.js +0 -45
package/testaro/linkUl.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
linkUl
|
|
3
25
|
This test reports failures to underline inline links. Underlining and color are the traditional
|
package/testaro/miniText.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2022–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
miniText
|
|
3
25
|
Derived from the bbc-a11y textCannotBeTooSmall test.
|
package/testaro/motion.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
motion
|
|
3
25
|
This test reports motion in a page. For minimal accessibility, standards require motion to be
|
package/testaro/nonTable.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2022–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
nonTable
|
|
3
25
|
Derived from the bbc-a11y useTablesForData test. Crude heuristics omitted.
|
package/testaro/opFoc.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
opFoc
|
|
3
25
|
Related to Tenon rule 190.
|
package/testaro/pseudoP.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
pseudoP
|
|
3
25
|
Related to Tenon rule 242.
|
|
@@ -24,15 +46,15 @@ exports.reporter = async (page, withItems) => {
|
|
|
24
46
|
const previousSib = el.previousSibling;
|
|
25
47
|
return previousSib.nodeType === Node.ELEMENT_NODE
|
|
26
48
|
|| previousSib.nodeType === Node.TEXT_NODE && /^\s+$/.test(previousSib)
|
|
27
|
-
|
|
28
|
-
|
|
49
|
+
? el.parentElement.tagName
|
|
50
|
+
: false;
|
|
29
51
|
});
|
|
30
52
|
// If it does:
|
|
31
53
|
if (parentTagNameIfBad) {
|
|
32
54
|
// Add the locator to the array of violators.
|
|
33
55
|
all.locs.push([loc, parentTagNameIfBad]);
|
|
34
56
|
}
|
|
35
|
-
}
|
|
57
|
+
}
|
|
36
58
|
// Populate and return the result.
|
|
37
59
|
const whats = [
|
|
38
60
|
'Adjacent br elements within a __param__ element may be pseudo-paragraphs',
|
package/testaro/radioSet.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
radioSet
|
|
3
25
|
This test reports nonstandard grouping of radio buttons. It defines standard grouping to require
|
package/testaro/role.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
role
|
|
3
25
|
This test reports role assignment that violate either an applicable standard or an applicable
|
package/testaro/styleDiff.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
styleDiff
|
|
3
25
|
This test reports style differences among links, buttons, and headings. It assumes
|
|
@@ -5,9 +27,66 @@
|
|
|
5
27
|
for list links, buttons, and headings at each level. The test considers only
|
|
6
28
|
particular style properties, listed in the 'mainStyles' and 'headingStyles' arrays.
|
|
7
29
|
*/
|
|
30
|
+
|
|
31
|
+
// FUNCTIONS
|
|
32
|
+
|
|
33
|
+
// Returns an object classifying the links in a page by layout.
|
|
34
|
+
const linksByType = async page => await page.evaluateHandle(() => {
|
|
35
|
+
// FUNCTION DEFINITIONS START
|
|
36
|
+
// Removes spacing characters from a text.
|
|
37
|
+
const despace = text => text.replace(/\s/g, '');
|
|
38
|
+
// Returns whether a list is a list entirely of links.
|
|
39
|
+
const isLinkList = list => {
|
|
40
|
+
const listItems = Array.from(list.children);
|
|
41
|
+
if (listItems.length > 1) {
|
|
42
|
+
return listItems.length > 1 && listItems.every(item => {
|
|
43
|
+
if (item.tagName === 'LI') {
|
|
44
|
+
const {children} = item;
|
|
45
|
+
if (children.length === 1) {
|
|
46
|
+
const link = children[0];
|
|
47
|
+
if (link.tagName === 'A') {
|
|
48
|
+
const itemText = despace(item.textContent);
|
|
49
|
+
const linkText = despace(link.textContent);
|
|
50
|
+
return itemText.length === linkText.length;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
// FUNCTION DEFINITIONS END
|
|
70
|
+
// Identify the list links in the page.
|
|
71
|
+
const lists = Array.from(document.body.querySelectorAll('ul, ol'));
|
|
72
|
+
const listLinks = [];
|
|
73
|
+
lists.forEach(list => {
|
|
74
|
+
if (isLinkList(list)) {
|
|
75
|
+
listLinks.push(... Array.from(list.querySelectorAll('a')));
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
// Identify the inline links in the page.
|
|
79
|
+
const allLinks = Array.from(document.body.querySelectorAll('a'));
|
|
80
|
+
const inlineLinks = allLinks.filter(link => ! listLinks.includes(link));
|
|
81
|
+
// Return the data.
|
|
82
|
+
return {
|
|
83
|
+
adjacent: inlineLinks,
|
|
84
|
+
list: listLinks
|
|
85
|
+
};
|
|
86
|
+
});
|
|
8
87
|
exports.reporter = async (page, withItems) => {
|
|
9
88
|
// Get an object with arrays of list links and adjacent links as properties.
|
|
10
|
-
const linkTypes = await
|
|
89
|
+
const linkTypes = await linksByType(page);
|
|
11
90
|
return await page.evaluate(args => {
|
|
12
91
|
const linkTypes = args[0];
|
|
13
92
|
const withItems = args[1];
|
package/testaro/tabNav.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
tabNav
|
|
3
25
|
This test reports nonstandard keyboard navigation among tab elements in visible tab lists.
|
|
@@ -73,12 +95,87 @@ exports.reporter = async (page, withItems) => {
|
|
|
73
95
|
correct: []
|
|
74
96
|
};
|
|
75
97
|
}
|
|
76
|
-
//
|
|
98
|
+
// Get an array of element handles for the visible tablists.
|
|
77
99
|
const tabLists = await page.$$('[role=tablist]:visible');
|
|
78
100
|
if (tabLists.length) {
|
|
79
101
|
// FUNCTION DEFINITIONS START
|
|
80
102
|
// Returns text associated with an element.
|
|
81
|
-
|
|
103
|
+
// Returns the text associated with an element.
|
|
104
|
+
const allText = async (page, elementHandle) => await page.evaluate(element => {
|
|
105
|
+
// Identify the element, if specified, or else the focused element.
|
|
106
|
+
const el = element || document.activeElement;
|
|
107
|
+
// Initialize an array of its texts.
|
|
108
|
+
const texts = [];
|
|
109
|
+
// FUNCTION DEFINITION START
|
|
110
|
+
// Removes excess spacing from a string.
|
|
111
|
+
const debloat = text => text.trim().replace(/\s+/g, ' ');
|
|
112
|
+
// FUNCTION DEFINITION END
|
|
113
|
+
// Add any attribute label to the array.
|
|
114
|
+
const ariaLabel = el.getAttribute('aria-label');
|
|
115
|
+
if (ariaLabel) {
|
|
116
|
+
const trimmedLabel = debloat(ariaLabel);
|
|
117
|
+
if (trimmedLabel) {
|
|
118
|
+
texts.push(trimmedLabel);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Add any explicit and implicit labels to the array.
|
|
122
|
+
const labelNodeList = el.labels;
|
|
123
|
+
if (labelNodeList && labelNodeList.length) {
|
|
124
|
+
const labels = Array.from(labelNodeList);
|
|
125
|
+
const labelTexts = labels
|
|
126
|
+
.map(label => label.textContent && debloat(label.textContent))
|
|
127
|
+
.filter(text => text);
|
|
128
|
+
if (labelTexts.length) {
|
|
129
|
+
texts.push(...labelTexts);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Add any referenced labels to the array.
|
|
133
|
+
if (el.hasAttribute('aria-labelledby')) {
|
|
134
|
+
const labelerIDs = el.getAttribute('aria-labelledby').split(/\s+/);
|
|
135
|
+
labelerIDs.forEach(id => {
|
|
136
|
+
const labeler = document.getElementById(id);
|
|
137
|
+
if (labeler) {
|
|
138
|
+
const labelerText = debloat(labeler.textContent);
|
|
139
|
+
if (labelerText) {
|
|
140
|
+
texts.push(labelerText);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// Add any image text alternatives to the array.
|
|
146
|
+
const altTexts = Array
|
|
147
|
+
.from(element.querySelectorAll('img[alt]:not([alt=""])'))
|
|
148
|
+
.map(img => debloat(img.alt))
|
|
149
|
+
.join('; ');
|
|
150
|
+
if (altTexts.length) {
|
|
151
|
+
texts.push(altTexts);
|
|
152
|
+
}
|
|
153
|
+
// Add the first 100 characters of any text content of the element to the array.
|
|
154
|
+
const ownText = element.textContent;
|
|
155
|
+
if (ownText) {
|
|
156
|
+
const minText = debloat(ownText);
|
|
157
|
+
if (minText) {
|
|
158
|
+
texts.push(minText.slice(0, 100));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// Add any ID of the element to the array.
|
|
162
|
+
const id = element.id;
|
|
163
|
+
if (id) {
|
|
164
|
+
texts.push(`#${id}`);
|
|
165
|
+
}
|
|
166
|
+
// Identify a concatenation of the texts.
|
|
167
|
+
let textChain = texts.join('; ');
|
|
168
|
+
// If it is empty:
|
|
169
|
+
if (! textChain) {
|
|
170
|
+
// Substitute the HTML of the element.
|
|
171
|
+
textChain = `{${debloat(element.outerHTML)}}`;
|
|
172
|
+
if (textChain === '{}') {
|
|
173
|
+
textChain = '';
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// Return a concatenation of the texts in the array.
|
|
177
|
+
return textChain;
|
|
178
|
+
}, elementHandle);
|
|
82
179
|
// Returns the index of the focused tab in an array of tabs.
|
|
83
180
|
const focusedTab = async tabs => await page.evaluate(tabs => {
|
|
84
181
|
const focus = document.activeElement;
|
package/testaro/targetSize.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
targetSize
|
|
3
25
|
Related to Tenon rule 152, but stricter.
|
package/testaro/textNodes.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
textNodes
|
|
3
25
|
This test reports data about specified text nodes.
|
|
@@ -25,7 +47,7 @@ exports.reporter = async (page, withItems, detailLevel, text = '') => {
|
|
|
25
47
|
// Compacts a string.
|
|
26
48
|
const compact = string => string.replace(/\s+/g, ' ').trim();
|
|
27
49
|
// Compacts and lower-cases a string.
|
|
28
|
-
const
|
|
50
|
+
const toStandardString = string => compact(string).toLowerCase();
|
|
29
51
|
/*
|
|
30
52
|
Gets data (tagName, text if specified, attributes, refLabels, labels, and children)
|
|
31
53
|
on an element.
|
|
@@ -80,7 +102,7 @@ exports.reporter = async (page, withItems, detailLevel, text = '') => {
|
|
|
80
102
|
return data;
|
|
81
103
|
};
|
|
82
104
|
// FUNCTION DEFINITIONS END
|
|
83
|
-
const stdText =
|
|
105
|
+
const stdText = toStandardString(text);
|
|
84
106
|
// Create a collection of the text nodes.
|
|
85
107
|
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
|
86
108
|
// Get their count.
|
|
@@ -88,7 +110,7 @@ exports.reporter = async (page, withItems, detailLevel, text = '') => {
|
|
|
88
110
|
let more = true;
|
|
89
111
|
while(more) {
|
|
90
112
|
if (walker.nextNode()) {
|
|
91
|
-
const stdCurrent =
|
|
113
|
+
const stdCurrent = toStandardString(walker.currentNode.nodeValue);
|
|
92
114
|
if (stdCurrent.includes(stdText)) {
|
|
93
115
|
data.nodeCount++;
|
|
94
116
|
matchNodes.push(walker.currentNode);
|
package/testaro/title.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2022–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
title
|
|
3
25
|
This test reports the page title.
|
package/testaro/zIndex.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
zIndex
|
|
3
25
|
This test reports elements with non-auto z indexes. It assumes that pages are most accessible
|
package/tests/alfa.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
/*
|
|
2
24
|
alfa
|
|
3
25
|
This test implements the alfa ruleset for accessibility.
|
|
@@ -26,8 +48,9 @@ exports.reporter = async (page, options) => {
|
|
|
26
48
|
const msgText = msg.text();
|
|
27
49
|
console.log(msgText);
|
|
28
50
|
});
|
|
29
|
-
// Initialize the
|
|
30
|
-
|
|
51
|
+
// Initialize the act report.
|
|
52
|
+
const data = {};
|
|
53
|
+
const result = {
|
|
31
54
|
totals: {
|
|
32
55
|
failures: 0,
|
|
33
56
|
warnings: 0
|
|
@@ -113,24 +136,23 @@ exports.reporter = async (page, options) => {
|
|
|
113
136
|
outcomeData.etcTags = etcTags;
|
|
114
137
|
}
|
|
115
138
|
if (outcomeData.verdict === 'failed') {
|
|
116
|
-
|
|
139
|
+
result.totals.failures++;
|
|
117
140
|
}
|
|
118
141
|
else if (outcomeData.verdict === 'cantTell') {
|
|
119
|
-
|
|
142
|
+
result.totals.warnings++;
|
|
120
143
|
}
|
|
121
|
-
|
|
144
|
+
result.items.push(outcomeData);
|
|
122
145
|
}
|
|
123
146
|
}
|
|
124
147
|
});
|
|
125
148
|
}
|
|
126
149
|
catch(error) {
|
|
127
150
|
console.log(`ERROR: navigation to URL timed out (${error})`);
|
|
128
|
-
data =
|
|
129
|
-
|
|
130
|
-
prevented: true,
|
|
131
|
-
error: 'ERROR: navigation to URL timed out'
|
|
132
|
-
}
|
|
133
|
-
};
|
|
151
|
+
data.prevented = true;
|
|
152
|
+
data.error = 'ERROR: Act failed';
|
|
134
153
|
}
|
|
135
|
-
return {
|
|
154
|
+
return {
|
|
155
|
+
data,
|
|
156
|
+
result
|
|
157
|
+
};
|
|
136
158
|
};
|