npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

axe-cypress-a11y

v1.0.1

Published

axe-core plugin for cypress

Readme

axe-cypress-a11y

Provides a chainable axe API for CypressIO.

Automated accessibility testing builder for Cypress powered by axe-core®, following the same patterns as other @axe-core/xyz packages developed by Deque Systems, Inc. axe®, and axe-core® are trademarks of Deque Systems, Inc. Click to find out more detaila about Axe tools.

Getting Started

Install Node.js if you haven't already.

Install Cypress: npm install cypress

Install axe-cypress-a11y: npm install axe-core axe-cypress-a11y

Usage

This module uses a chainable API to assist in injecting, configuring, and analyzing axe with Cypress.

Here is an example of a script that will drive Cypress to a page, perform an analysis, and then log results.

import AxeBuilder from 'axe-cypress-a11y';

describe('Accessibility Tests', () => {
  it('should have no accessibility violations', () => {
    cy.visit('/');
    
    new AxeBuilder()
      .include('.main-content')
      .exclude('.ads')
      .withTags(['wcag2a', 'wcag2aa'])
      .analyze()
      .then((results) => {
       cy.log(`Violations: ${JSON.stringify(results.violations, null, 2)}`);
      });
  });
});

API

new AxeBuilder()

Creates a new AxeBuilder instance.

.include(selector: string)

Add a CSS selector to include in the analysis.

.exclude(selector: string)

Add a CSS selector to exclude from the analysis.

.withTags(tags: string | string[])

Limit analysis to rules with specific tags (e.g., 'wcag2a', 'wcag2aa', 'wcag21a').

.withRules(rules: string | string[])

Limit analysis to specific rule IDs.

.disableRules(rules: string | string[])

Disable specific rules from the analysis.

.options(options: RunOptions)

Pass custom options to axe.run().

.configure(config: Spec)

Configure axe with custom settings.

.analyze()

Run the accessibility analysis and return results.

Examples

Basic Usage

new AxeBuilder()
  .analyze()
  .then((results) => {
    cy.log(`Found ${results.violations.length} violations`);
  });

With Specific Tags

new AxeBuilder()
  .withTags(['wcag2a', 'wcag2aa'])
  .analyze()
  .then((results) => {
    expect(results.violations).to.have.length(0);
  });

Exclude Elements

new AxeBuilder()
  .exclude('.third-party-widget')
  .exclude('#ads')
  .analyze()
  .then((results) => {
    expect(results.violations).to.have.length(0);
  });

Custom Configuration

new AxeBuilder()
  .configure({
    rules: [{
      id: 'color-contrast',
      enabled: false
    }]
  })
  .analyze();

License

MIT