testaro 60.8.2 → 60.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/testaro/adbID.js +5 -11
- package/testaro/allHidden.js +5 -11
- package/testaro/lineHeight.js +5 -11
package/package.json
CHANGED
package/testaro/adbID.js
CHANGED
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
|
|
37
37
|
// Runs the test and returns the result.
|
|
38
38
|
exports.reporter = async (page, withItems) => {
|
|
39
|
-
//
|
|
40
|
-
|
|
39
|
+
// Return totals and standard instances for the rule.
|
|
40
|
+
return await page.evaluate(withItems => {
|
|
41
41
|
// Get all candidates, i.e. elements with aria-describedby attributes.
|
|
42
42
|
const candidates = document.body.querySelectorAll('[aria-describedby]');
|
|
43
43
|
let violationCount = 0;
|
|
@@ -104,15 +104,9 @@ exports.reporter = async (page, withItems) => {
|
|
|
104
104
|
instances.push(window.getInstance(null, 'adbID', what, violationCount, 3));
|
|
105
105
|
}
|
|
106
106
|
return {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
data: {},
|
|
108
|
+
totals: [0, violationCount, 0, 0],
|
|
109
|
+
standardInstances: instances
|
|
109
110
|
};
|
|
110
111
|
}, withItems);
|
|
111
|
-
const {violationCount, instances} = violationData;
|
|
112
|
-
// Return the result.
|
|
113
|
-
return {
|
|
114
|
-
data: {},
|
|
115
|
-
totals: [0, violationCount, 0, 0],
|
|
116
|
-
standardInstances: instances
|
|
117
|
-
};
|
|
118
112
|
};
|
package/testaro/allHidden.js
CHANGED
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
exports.reporter = async page => {
|
|
35
35
|
// Get a count of elements deemed visible by Playwright.
|
|
36
36
|
const visibleElementCount = await page.locator('body :visible').count();
|
|
37
|
-
//
|
|
38
|
-
|
|
37
|
+
// Return totals and standard instances for the rule.
|
|
38
|
+
return await page.evaluate(visibleElementCount => {
|
|
39
39
|
let violationCount = 0;
|
|
40
40
|
const instances = [];
|
|
41
41
|
// If no element is visible:
|
|
@@ -47,15 +47,9 @@ exports.reporter = async page => {
|
|
|
47
47
|
instances.push(window.getInstance(null, 'allHidden', what, 1, 3));
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
data: {},
|
|
51
|
+
totals: [0, 0, 0, violationCount],
|
|
52
|
+
standardInstances: instances
|
|
52
53
|
};
|
|
53
54
|
}, visibleElementCount);
|
|
54
|
-
const {violationCount, instances} = violationData;
|
|
55
|
-
// Return the result.
|
|
56
|
-
return {
|
|
57
|
-
data: {},
|
|
58
|
-
totals: [0, 0, 0, violationCount],
|
|
59
|
-
standardInstances: instances
|
|
60
|
-
};
|
|
61
55
|
};
|
package/testaro/lineHeight.js
CHANGED
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
|
|
37
37
|
// Runs the test and returns the result.
|
|
38
38
|
exports.reporter = async (page, withItems) => {
|
|
39
|
-
//
|
|
40
|
-
|
|
39
|
+
// Return totals and standard instances for the rule.
|
|
40
|
+
return await page.evaluate(withItems => {
|
|
41
41
|
// Get all elements.
|
|
42
42
|
const allElements = document.body.querySelectorAll('*');
|
|
43
43
|
// Get all violation candidates, i.e. elements that have non-empty child text nodes.
|
|
@@ -77,15 +77,9 @@ exports.reporter = async (page, withItems) => {
|
|
|
77
77
|
instances.push(window.getInstance(null, 'lineHeight', what, violationCount, 1));
|
|
78
78
|
}
|
|
79
79
|
return {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
data: {},
|
|
81
|
+
totals: [0, violationCount, 0, 0],
|
|
82
|
+
standardInstances: instances
|
|
82
83
|
};
|
|
83
84
|
}, withItems);
|
|
84
|
-
const {violationCount, instances} = violationData;
|
|
85
|
-
// Return the result.
|
|
86
|
-
return {
|
|
87
|
-
data: {},
|
|
88
|
-
totals: [0, violationCount, 0, 0],
|
|
89
|
-
standardInstances: instances
|
|
90
|
-
};
|
|
91
85
|
};
|