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 🙏

© 2024 – Pkg Stats / Ryan Hefner

codeceptjs-a11y-helper

v1.5.3

Published

Accessibility Testing Helper for codeceptjs

Downloads

1,228

Readme

"Buy Me A Coffee"

codeceptjs-a11y-helper

CodeceptJS Accessibility helper wraps on top of axe-playwright to perform a11y check against your web application.

Allure reports: https://kobenguyent.github.io/codeceptjs-a11y-helper/#

NPM package: https://www.npmjs.com/package/codeceptjs-a11y-helper

Installation

npm i codeceptjs-a11y-helper --save-dev

Configuration

This helper should be added in your codeceptjs config file: codecept.conf.*

Example:

{
...
   helpers: {
     A11yHelper: {
      require: 'codeceptjs-a11y-helper',
    }
   }
...
}

Usage

  • To use this helper, you must enable Playwright helper.
  • After install the helper, you can use it by calling I.runA11yCheck()
  • If there is auto complete for actor I, try running npx codeceptjs def

Options

By default, this setting is enabled, you can either input those settings in config file or runA11yCheck(), precedence is as followed: defaults settings, settings in config, settings from runA11yCheck()

  • context: null,
  • axeOptions: { runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa', 'wcag2aaa', 'wcag21a', 'wcag21aa', 'wcag22aa', 'best-practice', 'wcag***', 'ACT', 'experimental', 'cat.*',], }, }
  • detailedReport: true
  • detailedReportOptions: { html: true },
  • skipFailures: true,
  • reporter: 'html',
  • outputDir: 'output',
  • reportFileName: 'accessibility-audit.html'

More info could be found here

Note: If you pass skipFailures=false, test would fail if violations found and there is no HTML report generated.

  • Within config file:
{
...
   helpers: {
     A11yHelper: {
      require: 'codeceptjs-a11y-helper',
      outputDir: 'hello',
      reportFileName: 'a11y-audit.html'
    }
   }
...
}
  • From runA11yCheck():
Feature('A11Y Check');

Scenario('a11y check',  async ({ I }) => {
    I.amOnPage('https://js.devexpress.com/Demos/WidgetsGallery/Demo/Slider/Overview/jQuery/Light/')
    await I.runA11yCheck({ outputDir: 'hello'})
});

Output

A11Y Check --
    [1]  Starting recording promises
    Timeouts:
 › [Session] Starting singleton browser session
  a11y check
    I am on page "https://js.devexpress.com/Demos/WidgetsGallery/Demo/Slider/Overview/jQuery/Light/"
    I run a11y check {"outputDir":"hello"}
HTML report was saved into the following directory /Users/kobenguyent/Desktop/codeceptjs-playwright-fun/hello/accessibility-audit.html
  ✔ OK in 6028ms


  OK  | 1 passed   // 7s

Screenshot 2023-06-16 at 17 33 22