Repository URL to install this package:
|
Version:
0.0.10 ▾
|
The library provides the infrastructure, you need to create the specs for each frontend to test.
Each spec should be an object with a specific structure:
id, used to generate report namesurl to testsetup method, called before the testcleanup method, called after the testconfig object, passed to the test runner (pa11y)You can refer to the JSDoc of A11yTestDefinition in index.js for more details: click here.
Example:
// API used to interact with doodle const { createPoll, deletePoll } = require('../api/doodleApi'); let pollId; module.exports = { id: 'participationPage', get url() { return `https://doodle.com/poll/${pollId}`; }, get config() { return { rootElement: '#d-app', actions: [ 'wait for element #d-participationPage to be visible' ] }; }, setup: async () => { pollId = await createPoll(); }, cleanup: async () => { await deletePoll(pollId); } };
Add a .a11y.js suffix to your files or put them inside a __a11y__ folder. The a11ytester will automatically find them.
Yes. You can use pa11y actions to navigate to the right page.
Headless Chrome has some issues running pages with an invalid certificate. You have to test somewhere else (e.g. staging) until we solve the issue with local certificates.
You can either set headless: false in pa11y.chromeLaunchConfig or set verbose: true in the configuration.