Getting Started with Accessibility Scanner

Last updated on
23 September 2021

The Accessibility Scanner module uses Deque's @axe-core/cli toolset for performing web accessibility scans.

Prerequisites

System Dependencies

To use the accessibility scanner module, you must install the following dependencies:

  • Web Page Archive Drupal module
    While the archiving and visual regression features of this module aren't needed for accessibility scanning, it does provide some basic capture and compare functionality that made for a good framework to build upon.
  • npm/node 14+
    Since the accessibility scanner module relies on a node-based third-party tool set, you must have node.js/npm installed somewhere on the server, and it must be accessible via the same user your web server runs as. Please note, there are security risks with allowing the web server access node/npm, which is why it is highly recommended that you don't install this module on the same system you run your other Drupal sites on.
  • @axe-core/cli node module
    The @axe-core/cli node module should be installed somewhere on your system.

Permissions

To follow along with this guide, you will need the following permissions:

  • administer web page archive
  • view web page archive results
  • process axe cli historical results
  • view axe cli historical results

Setting Up Accessibility Scanner for the First Time

When you first install the module, you will need to configure your system:

  1. Go to Configuration -> System -> Web Page Archive.
    Screenshot showing how to navigate to Configuration -> System -> Web Page Archive
  2. Click on the Settings tab.
    Screenshot illustrating where the Settings tab is located
  3. Under System Settings specify the full path to the NodeJS and NPM.
    Screenshot showing example node configuration
  4. Under @axe-core/cli - Accessibility Scanner Settings -> System Settings:

    Screenshot showing example Axe System settings

    • Set Path to @axe-core/cli to the axe binary on your system
    • It is highly recommended that you keep the "Verify binary checksum before executing?" checked. This means if that binary every got compromised, Drupal will not attempt to execute it. However, if you do this, you must manually set your expected checksum here. To get the current checksum you can run the following command on your system:
      md5 /path/to/axe

      Alternatively, you can save the settings and come back to this screen and Drupal will tell you what the current checksum is the next time the page loads. 

    • If you did not install axe globally, you will need to set the node_modules path to the parent directory of the node_modules directory. So for example, if your node_modules directory is located at /path/to/node_modules, set this value to /path/to.
  5. Under @axe-core/cli - Accessibility Scanner Settings -> Default Values you can set your default preferences, including which accessibility guidelines you want to adhere to and which CSS selectors either what to include/exclude by default. These can get overridden on a per-job basis, but this will help setup new jobs more quickly.
    Screenshot showing some example default rules

Configuring a Scanner Job

  1. Familiarize yourself with creating capture jobs in web page archive. When you get to the Configuring Capture Utilities section, specify @axe-core/cli - Accessibility Scanner and then click the Add button.
    Screenshot showing how to add capture utility to job
  2. Configure the job according to your accessibility requirements.Screenshot illustrating sample capture utility configuration
    • For reference, please review the axe tool's rule descriptions to know which rules are included in each guideline.
    • It is specifically important to realize that stricter rulesets don't inherit their less-strict counterparts.
    • For example, if you want WCAG 2.1 AA full compliance, if you only select the WCAG 2.1 Level AA guideline, it will not check for any violations against WCAG 2.1A, WCAG 2A or WCAG 2AA. It only will check for violations of rules that are tagged with wcag21aa. Instead you should include all four guidelines. 
  3. Next learn about running capture jobs on web page archive.
  4. For information how to analyze reports:

Help improve this page

Page status: No known problems

You can: