Skip to main content

Automated tests on Nightwatch.js (Beta)

Quick start guide to integrate Automated tests on BrowserStack Accessibility Testing with Nightwatch.js.

Prerequisites

  • 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 Automated tests

Follow these steps to get started with adding Automated tests 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.

Terminal
Copy icon Copy snippet


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 file should include the keys shown in the following sample.

Especially ensure that the accessibility flag is set to true and the accessibilityOptions are added.

nightwatch.conf.js
Copy icon Copy snippet

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 Automated tests will automatically identify different build runs.

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

Run your suite with Automated tests

Use your pre-existing command that you use to trigger an automated build.

You can check the Accessibility report for your build through the Automated tests dashboard.

Visit Automated tests 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