Skip to main content

Accessibility Automation on Nightwatch.js

Quick start guide to integrate Accessibility Automation with Nightwatch.js

Pre-requisites

  • You have an account with BrowserStack (even a free trial works) and can get your Username and Access Key from Account & Profile.
  • You have a Nightwatch.js test suite which runs on BrowserStack Automate.
  • You are using Node.js version 12 or above.

Integrate with Accessibility Automation

Follow the steps below to get started with adding Accessibility Automation to your test suite:

Install or update to the latest version of the Nightwatch BrowserStack plugin

Go to your Nightwatch.js project’s root directory and run the following commands to update or install @nightwatch/browserstack and later check the installed version using the following commands:

Terminal
npm install @nightwatch/browserstack
npm list @nightwatch/browserstack


Please ensure that you have @nightwatch/browserstack version 3.2.0 or above, and nightwatch version 3.2.0 or above before proceeding.

Set up the config file

Your nightwatch.conf.js should include the following keys as shown below:

The projectName and buildName config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack Automate since Accessibility Automation will automatically identify different build runs.

nightwatch.conf.js
module.exports = {
  //...
  plugins: ['@nightwatch/browserstack'],

  '@nightwatch/browserstack': {
    accessibility: true,
    // Optional configuration options
    accessibilityOptions: {
      wcagVersion: 'wcag21a',
      includeIssueType: {
        bestPractice: false,
        needsReview: true
      },
      includeTagsInTestingScope: ['Specify tags of test cases to be included'],
      excludeTagsInTestingScope: ['Specify tags of test cases to be excluded']
    }
  }
  //...
};

Accessibility testing will only run on Desktops (Mac & Windows) with Chrome 95 & above on Automate.

Run your suite with BrowserStack Accessibility Automation

Use your pre-existing command that you use to trigger an automated build. Once the build has completed and the Accessibility report is ready, it will automatically get sent to the Accessibility Automation dashboard.

Visit Accessibility Automation Dashboard

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy