New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cypress-axe

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-axe

Custom cypress commands to inject axe-core and test for a11y

0.7.0
Source
npm
Version published
Weekly downloads
364K
-17.39%
Maintainers
1
Weekly downloads
 
Created

What is cypress-axe?

The cypress-axe npm package is a plugin for Cypress that integrates the axe-core accessibility testing engine. It allows you to automate accessibility testing within your Cypress end-to-end tests, making it easier to identify and fix accessibility issues in your web applications.

What are cypress-axe's main functionalities?

Injecting axe-core

This feature allows you to inject the axe-core library into your application. This is a necessary step before running any accessibility checks.

cy.injectAxe();

Running accessibility checks

This feature allows you to run accessibility checks on the entire page or a specific element. It will log any accessibility violations to the Cypress test runner.

cy.checkA11y();

Customizing axe-core options

This feature allows you to customize the axe-core options, such as specifying which accessibility standards to test against. In this example, it runs checks only for WCAG 2.0 A and AA standards.

cy.checkA11y(null, { runOnly: ['wcag2a', 'wcag2aa'] });

Excluding elements from checks

This feature allows you to exclude specific elements from accessibility checks. In this example, elements with the class 'ignore-this' will be excluded from the checks.

cy.checkA11y({ exclude: ['.ignore-this'] });

Other packages similar to cypress-axe

Keywords

a11y

FAQs

Package last updated on 28 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts