Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axe-playwright

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axe-playwright - npm Package Compare versions

Comparing version 1.1.10 to 1.1.11

22

dist/index.js

@@ -34,3 +34,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.checkA11y = exports.reportViolations = exports.getViolations = exports.configureAxe = exports.injectAxe = void 0;
exports.checkA11y = exports.reportViolations = exports.getViolations = exports.getAxeResults = exports.configureAxe = exports.injectAxe = void 0;
const fs = __importStar(require("fs"));

@@ -58,2 +58,15 @@ const utils_1 = require("./utils");

/**
* Runs axe-core tools on the relevant page and returns all results
* @param page
* @param context
* @param options
*/
const getAxeResults = (page, context, options) => __awaiter(void 0, void 0, void 0, function* () {
const result = yield page.evaluate(([context, options]) => {
return window.axe.run(context || window.document, options);
}, [context, options]);
return result;
});
exports.getAxeResults = getAxeResults;
/**
* Runs axe-core tools on the relevant page and returns all accessibility violations detected on the page

@@ -65,6 +78,3 @@ * @param page

const getViolations = (page, context, options) => __awaiter(void 0, void 0, void 0, function* () {
const result = yield page.evaluate(([context, options]) => {
const axeOptions = options ? options['axeOptions'] : {};
return window.axe.run(context || window.document, axeOptions);
}, [context, options]);
const result = yield exports.getAxeResults(page, context, options);
return result.violations;

@@ -96,3 +106,3 @@ });

if (reporter === void 0) { reporter = new defaultTerminalReporter_1.default(options === null || options === void 0 ? void 0 : options.detailedReport, (_a = options === null || options === void 0 ? void 0 : options.detailedReportOptions) === null || _a === void 0 ? void 0 : _a.html); }
const violations = yield exports.getViolations(page, context, options);
const violations = yield exports.getViolations(page, context, options === null || options === void 0 ? void 0 : options.axeOptions);
const impactedViolations = utils_1.getImpactedViolations(violations, options === null || options === void 0 ? void 0 : options.includedImpacts);

@@ -99,0 +109,0 @@ yield exports.reportViolations(impactedViolations, reporter);

@@ -78,3 +78,3 @@ import { AxeResults, Check, ElementContext, ImpactValue, Locale, Result, Rule, RunOptions } from 'axe-core'

*/
export function getAxeResults(page: Page, context?: ElementContext, options?: RunOptions): Promise<AxeResults[]>
export function getAxeResults(page: Page, context?: ElementContext, options?: RunOptions): Promise<AxeResults>

@@ -81,0 +81,0 @@ /**

{
"name": "axe-playwright",
"version": "1.1.10",
"version": "1.1.11",
"description": "Custom Playwright commands to inject axe-core and test for a11y",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc