Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

axe-testcafe

1.1.0 • Public • Published

axe-testcafe

The TestCafe module that allows you to use the aXe accessibility engine in TestCafe tests.

Installation

npm install axe-testcafe

How to use

You can write a TestCafe test with automated accessibility checks like this.

import axeCheck from 'axe-testcafe';
 
fixture `TestCafe tests with Axe`
    .page `http://example.com`;
 
test('Automated accessibility testing', async t => {
    await axeCheck(t);
});

If any accessibility issues are found, you will see a detailed report.

Accessibility errors

aXe options

The axe-testcafe module allows you to define the context and options axe.run parameters in a TestCafe test.

test('Automated accessibility testing', async () => {
    var axeContext = { exclude: [['select']] };
    var axeOptions = { rules: { 'html-has-lang': { enabled: false } } };
 
    await axeCheck(t, axeContext, axeOptions);
});

install

npm i axe-testcafe

Downloadsweekly downloads

1,587

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability