axe-playwright
Advanced tools
Comparing version 1.2.1 to 1.2.3
@@ -55,3 +55,3 @@ import { Page } from 'playwright'; | ||
*/ | ||
export declare const checkA11y: (page: Page, context?: ElementContext | undefined, axeOptions?: AxeOptions | undefined, skipFailures?: boolean, reporter?: Reporter | 'default' | 'v2', options?: Options | undefined) => Promise<void>; | ||
export declare const checkA11y: (page: Page, context?: ElementContext | undefined, axeOptions?: AxeOptions | undefined, skipFailures?: boolean, reporter?: Reporter | 'default' | 'html' | 'v2', options?: Options | undefined) => Promise<void>; | ||
export { DefaultTerminalReporter }; |
@@ -108,7 +108,2 @@ "use strict"; | ||
const violations = yield (0, exports.getViolations)(page, context, axeOptions === null || axeOptions === void 0 ? void 0 : axeOptions.axeOptions); | ||
if (violations.length > 0) { | ||
yield (0, axe_html_reporter_1.createHtmlReport)({ results: { violations }, options }); | ||
} | ||
else | ||
console.log("There were no violations to save in report"); | ||
const impactedViolations = (0, utils_1.getImpactedViolations)(violations, axeOptions === null || axeOptions === void 0 ? void 0 : axeOptions.includedImpacts); | ||
@@ -122,9 +117,17 @@ let reporterWithOptions; | ||
} | ||
else if (reporter === 'html') { | ||
if (violations.length > 0) { | ||
yield (0, axe_html_reporter_1.createHtmlReport)({ results: { violations }, options }); | ||
} | ||
else | ||
console.log("There were no violations to save in report"); | ||
} | ||
else { | ||
reporterWithOptions = reporter; | ||
} | ||
yield (0, exports.reportViolations)(impactedViolations, reporterWithOptions); | ||
if (reporter !== 'v2') | ||
if (reporter !== 'html') | ||
yield (0, exports.reportViolations)(impactedViolations, reporterWithOptions); | ||
if (reporter === 'v2' || reporter !== 'html') | ||
(0, utils_1.testResultDependsOnViolations)(impactedViolations, skipFailures); | ||
}); | ||
exports.checkA11y = checkA11y; |
{ | ||
"name": "axe-playwright", | ||
"version": "1.2.1", | ||
"version": "1.2.3", | ||
"description": "Custom Playwright commands to inject axe-core and test for a11y", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -123,4 +123,6 @@ ![logo](./docs/logo.png) | ||
A class instance that implements the `Reporter` interface or values `default` and `v2`. Custom reporter instances can be supplied to override default reporting behaviour dictated by `DefaultTerminalReporter` set by the value `default`. `v2` is the new TerminalReporter inspired by the reports from [jest-axe](https://github.com/nickcolley/jest-axe). | ||
A class instance that implements the `Reporter` interface or values `default`, `v2` and `html`. Custom reporter instances can be supplied to override default reporting behaviour dictated by `DefaultTerminalReporter` set by the value `default`. `v2` is the new TerminalReporter inspired by the reports from [jest-axe](https://github.com/nickcolley/jest-axe). `html` reporter will generate external HTML file. | ||
Note! `html` reporter will disable printed to logs violations. | ||
##### skipFailures (optional, defaults to false) | ||
@@ -127,0 +129,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31564
426
321