testaro 60.11.0 → 60.13.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/UPGRADES.md +68 -0
- package/package.json +1 -1
- package/procs/doTestAct.js +1 -1
- package/procs/screenShot.js +1 -1
- package/procs/testaro.js +116 -6
- package/run.js +1 -1
- package/testaro/adbID.js +1 -3
- package/testaro/altScheme.js +1 -3
- package/testaro/captionLoc.js +1 -3
- package/testaro/datalistRef.js +1 -1
- package/testaro/embAc.js +1 -1
- package/testaro/focAndOp.js +144 -0
- package/testaro/focInd.js +2 -3
- package/testaro/focVis.js +23 -35
- package/testaro/hover-draft0.js +110 -0
- package/testaro/hover-draft1.js +185 -0
- package/testaro/hover-draft2.js +183 -0
- package/testaro/hover-draft3.js +143 -0
- package/testaro/hover-orig.js +109 -0
- package/testaro/hover.js +66 -58
- package/testaro/lineHeight.js +1 -3
- package/testaro/miniText.js +1 -1
- package/tests/testaro.js +24 -24
- package/procs/operable.js +0 -108
- package/testaro/focOp.js +0 -75
- package/testaro/miniText-orig.js +0 -62
- package/testaro/opFoc.js +0 -76
package/testaro/opFoc.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
© 2023–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool. All rights reserved.
|
|
4
|
-
|
|
5
|
-
MIT License
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/*
|
|
27
|
-
opFoc
|
|
28
|
-
Related to Tenon rule 190.
|
|
29
|
-
|
|
30
|
-
This test reports operable elements that are not Tab-focusable. The standard practice is to make
|
|
31
|
-
operable elements focusable. If operable elements are not focusable, users who navigate with a
|
|
32
|
-
keyboard are prevented from operating those elements. The test considers an element operable if
|
|
33
|
-
it has a non-inherited pointer cursor and is not a 'LABEL' element, has an operable tag name, has
|
|
34
|
-
an interactive explicit role, or has an 'onclick' attribute. The test considers an element
|
|
35
|
-
Tab-focusable if its tabIndex property has the value 0.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
// ########## IMPORTS
|
|
39
|
-
|
|
40
|
-
// Module to perform common operations.
|
|
41
|
-
const {init, getRuleResult} = require('../procs/testaro');
|
|
42
|
-
// Module to get operabilities.
|
|
43
|
-
const {isOperable} = require('../procs/operable');
|
|
44
|
-
|
|
45
|
-
// ########## FUNCTIONS
|
|
46
|
-
|
|
47
|
-
// Runs the test and returns the result.
|
|
48
|
-
exports.reporter = async (page, withItems) => {
|
|
49
|
-
// Initialize the locators and result.
|
|
50
|
-
const all = await init(100, page, 'body *');
|
|
51
|
-
all.result.data.operableCount = 0;
|
|
52
|
-
// For each locator:
|
|
53
|
-
for (const loc of all.allLocs) {
|
|
54
|
-
// Get whether and, if so, how its element is operable.
|
|
55
|
-
const operabilities = await isOperable(loc);
|
|
56
|
-
// If it is:
|
|
57
|
-
if (operabilities.length) {
|
|
58
|
-
// Add this to the report.
|
|
59
|
-
all.result.data.operableCount++;
|
|
60
|
-
// Get whether it is focusable.
|
|
61
|
-
const isFocusable = await loc.evaluate(el => el.tabIndex === 0);
|
|
62
|
-
// If it is not:
|
|
63
|
-
if (! isFocusable) {
|
|
64
|
-
// Add the locator to the array of violators.
|
|
65
|
-
all.locs.push([loc, operabilities.join(', ')]);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
// Populate and return the result.
|
|
70
|
-
const whats = [
|
|
71
|
-
'Element is operable (__param__) but not Tab-focusable',
|
|
72
|
-
'Elements are operable but not Tab-focusable'
|
|
73
|
-
];
|
|
74
|
-
const result = await getRuleResult(withItems, all, 'opFoc', whats, 3);
|
|
75
|
-
return result;
|
|
76
|
-
};
|