axe-playwright 2.0.2 → 2.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/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/reporter/junitReporter.js +1 -1
- package/package.json +15 -15
package/dist/index.d.ts
CHANGED
|
@@ -52,5 +52,5 @@ export declare const reportViolations: (violations: Result[], reporter: Reporter
|
|
|
52
52
|
* @param reporter
|
|
53
53
|
* @param options
|
|
54
54
|
*/
|
|
55
|
-
export declare const checkA11y: (page: Page, context?: ElementContext | undefined, axeOptions?: AxeOptions | undefined, skipFailures?: boolean, reporter?: Reporter |
|
|
55
|
+
export declare const checkA11y: (page: Page, context?: ElementContext | undefined, axeOptions?: AxeOptions | undefined, skipFailures?: boolean, reporter?: Reporter | "default" | "html" | "junit" | "v2", options?: Options | undefined) => Promise<void>;
|
|
56
56
|
export { DefaultTerminalReporter };
|
package/dist/index.js
CHANGED
|
@@ -60,7 +60,7 @@ exports.injectAxe = injectAxe;
|
|
|
60
60
|
* @param page
|
|
61
61
|
* @param configurationOptions
|
|
62
62
|
*/
|
|
63
|
-
const configureAxe = (
|
|
63
|
+
const configureAxe = (page_1, ...args_1) => __awaiter(void 0, [page_1, ...args_1], void 0, function* (page, configurationOptions = {}) {
|
|
64
64
|
yield page.evaluate((configOptions) => window.axe.configure(configOptions), configurationOptions);
|
|
65
65
|
});
|
|
66
66
|
exports.configureAxe = configureAxe;
|
|
@@ -106,7 +106,7 @@ exports.reportViolations = reportViolations;
|
|
|
106
106
|
* @param reporter
|
|
107
107
|
* @param options
|
|
108
108
|
*/
|
|
109
|
-
const checkA11y = (page, context = undefined, axeOptions = undefined, skipFailures = false, reporter = 'default', options = undefined)
|
|
109
|
+
const checkA11y = (page_1, ...args_1) => __awaiter(void 0, [page_1, ...args_1], void 0, function* (page, context = undefined, axeOptions = undefined, skipFailures = false, reporter = 'default', options = undefined) {
|
|
110
110
|
var _a, _b, _c;
|
|
111
111
|
const violations = yield (0, exports.getViolations)(page, context, axeOptions === null || axeOptions === void 0 ? void 0 : axeOptions.axeOptions);
|
|
112
112
|
const impactedViolations = (0, utils_1.getImpactedViolations)(violations, axeOptions === null || axeOptions === void 0 ? void 0 : axeOptions.includedImpacts);
|
|
@@ -123,6 +123,7 @@ const checkA11y = (page, context = undefined, axeOptions = undefined, skipFailur
|
|
|
123
123
|
results: { violations },
|
|
124
124
|
options,
|
|
125
125
|
});
|
|
126
|
+
(0, utils_1.testResultDependsOnViolations)(violations, skipFailures);
|
|
126
127
|
}
|
|
127
128
|
else
|
|
128
129
|
console.log('There were no violations to save in report');
|
|
@@ -46,8 +46,8 @@ class JUnitReporter {
|
|
|
46
46
|
this.outputFilename = outputFilename;
|
|
47
47
|
}
|
|
48
48
|
report(violations) {
|
|
49
|
-
var _a;
|
|
50
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
var _a;
|
|
51
51
|
let lineBreak = '\n';
|
|
52
52
|
let pageUrl = ((_a = this.page) === null || _a === void 0 ? void 0 : _a.url()) || 'Page';
|
|
53
53
|
let suite = junit_report_builder_1.default.testSuite().name(pageUrl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axe-playwright",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Custom Playwright commands to inject axe-core and test for a11y",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"author": "Abhinaba Ghosh",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/jest": "^
|
|
33
|
-
"@types/node": "^
|
|
34
|
-
"jest": "^
|
|
35
|
-
"jest-each": "^
|
|
36
|
-
"jest-playwright-preset": "^
|
|
37
|
-
"playwright": "^1.
|
|
38
|
-
"prettier": "^
|
|
39
|
-
"ts-jest": "^
|
|
40
|
-
"typescript": "^
|
|
32
|
+
"@types/jest": "^29.5.13",
|
|
33
|
+
"@types/node": "^22.7.8",
|
|
34
|
+
"jest": "^29.7.0",
|
|
35
|
+
"jest-each": "^29.7.0",
|
|
36
|
+
"jest-playwright-preset": "^4.0.0",
|
|
37
|
+
"playwright": "^1.48.1",
|
|
38
|
+
"prettier": "^3.3.3",
|
|
39
|
+
"ts-jest": "^29.2.5",
|
|
40
|
+
"typescript": "^5.6.3"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@types/junit-report-builder": "^3.0.
|
|
44
|
-
"axe-core": "^4.
|
|
45
|
-
"axe-html-reporter": "2.2.
|
|
46
|
-
"junit-report-builder": "^
|
|
47
|
-
"picocolors": "^1.
|
|
43
|
+
"@types/junit-report-builder": "^3.0.2",
|
|
44
|
+
"axe-core": "^4.10.1",
|
|
45
|
+
"axe-html-reporter": "2.2.11",
|
|
46
|
+
"junit-report-builder": "^5.1.1",
|
|
47
|
+
"picocolors": "^1.1.1"
|
|
48
48
|
},
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|