Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axe-result-pretty-print

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.8K
decreased by-29.85%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 27 Oct 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc