0.3.2 • Published 2 years ago

taiko-accessibility v0.3.2

Weekly downloads
101
License
MIT
Repository
github
Last release
2 years ago

Taiko Accessibility Plugin

A plugin to perform accessibility testing with Taiko. For now, the plugin is utilizing the Axe Core library (https://github.com/dequelabs/axe-core).

Install

npm install --save-dev taiko-accessibility

Example

  npm init -y
  npm install --save-dev taiko taiko-accessibility jest

Add this test in a file accessibility.test.js.

const { accessibility, closeBrowser, goto, openBrowser } = require('taiko');

describe('accessibility', () => {

    beforeEach(async () => {
        jest.setTimeout(20000);
        await openBrowser();
    });
    
    afterEach(async () => {
        await closeBrowser();
    });
    
    test('Should be accessible', async () => {
        await goto('https://taiko.dev');
        const audit = await accessibility.runAudit();

        expect(audit.violations.length).toEqual(0);
    });

});

Run script with:

jest accessibility.test.js 

Or if Jest in not installed globally:

./node_modules/jest/bin/jest.js accessibility.test.js 

API

runAudit() currently returns an object with the following keys:

score

A score between 0-100 which shows how well the page is doing in terms of accessibility. This is based on the ration of fulfilled rules to applied rules (100 is best, 0 worst).

violations

An array with detailed information of the accessibility violations.

License

MIT

0.3.2

2 years ago

0.3.1

3 years ago

0.3.0

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago