Socket
Socket
Sign inDemoInstall

axe-result-pretty-print

Package Overview
Dependencies
7
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    axe-result-pretty-print

The module allows to make readable output for aXe core accessibility results from raw aXe result object.


Version published
Weekly downloads
2.2K
decreased by-64.86%
Maintainers
1
Install size
374 kB
Created
Weekly downloads
 

Readme

Source

axe-result-pretty-print

The module allows to make readable output for aXe core accessibility results from raw aXe result object. Prints violations summary in a table, violations details and small summary of passed rules.

Allows skipping violations summary table print.

See sample console output

Install

npm i axe-result-pretty-print

Usage

Example usage in TestCafe

To run TestCafe tests with axe-core, install testcafe, axe-core and @testcafe-community/axe:

npm i -D axe-result-pretty-print testcafe axe-core @testcafe-community/axe

For TestCafe example add the following clientScript in your .testcaferc.json config:

{
    "clientScripts": [{ "module": "axe-core/axe.min.js" }]
}

Full TestCafe test example is bellow:

import { runAxe } from '@testcafe-community/axe';
import { prettyPrintAxeReport } from 'axe-result-pretty-print';
import { t } from 'testcafe';

fixture('TestCafe test with Axe').page('http://example.com');

test('Automated accessibility testing', async (t) => {
    const axeContext = { exclude: [['select']] };
    // example with providing specific axe rules
    const axeOptions = {
        rules: { 'color-contrast': { enabled: true }, 'duplicate-id': { enabled: true } },
    };
    const { error, results } = await runAxe(axeContext, axeOptions);
    await t.expect(error).eql(null, `axe check failed with an error: ${error.message}`);
    // prints full report with failed violations and passed rules summary
    prettyPrintAxeReport({
        violations: results.violations,
        passes: results.passes,
        url: 'www.example.com',
    });
});

Keywords

FAQs

Last updated on 27 Oct 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc