Nightwatch v3 brings in plenty of new features accross your testing workflow from authoring to executing to debugging tests.

New Features


Nightwatch inspector

Nightwatch v3 introduces a point and click tool that can help you easily find selectors. It will improve your productivity of authoring tests & help you find durable selectors for lower long term maintenance.

Angular Component testing

Nightwatch v3 has added support for Angular component testing to the component testing repertoire.s

Test doubles

With earlier versions, you could run unit & integration tests using Nightwatch. Nightwatch v3 introduces test doubles with in-build support for stubs, spies & mocks to achieve isolation in unit testing.

Brand new element APIs

With Nightwatch v3, we have revamped the element API to make test authoring simpler and more concise.

More rich & powerful selectors

New selectors are introduced as part of this latest versions

  1. .findByText()
  2. .findByPlaceholderText()
  3. .findByAltText()
  4. .findByRole()

You can also chain selectors to find elements that are more complex to find

Example:

browser.element.find('#selector').findByText('text').click();

Performance improvements

Nightwatch v3 has implemented worker threads for parallel runs and we have observed improvements of upto 25% between Nightwatch v2 & v3. Try it now

Breaking changes

We have tried to ensure that there are no breaking changes while upgrading to v3. However, in case you need migration assistance please reach out to us on our new Nightwatch v3 channel on Discord

Release notes

Please refer to the release notes section for information about the latest changes. Releases Notes.

Key highlights from Nightwatch v2


Run your tests on real & virtual mobile devices

Nightwatch v3 brings the mobile helper tool that will help you install everything needed to run web tests on mobile devices. Nightwatch supports real browsers on Android & iOS real & virtual devices.

Run mobile app tests on Android & iOS

Nightwatch uses Appium under the hood to enable native mobile app testing on Android & iOS devices. It has the following functionalities to simplify your mobile app testing workflow.

  1. Easy setup using the mobile-helper tool
  2. Native Nightwatch commands & assertions for authoring tests
  3. Integration with Appium debugger

Component testing

With Nightwatch you can test components in isolation by mounting them in the browser. Nightwatch 2 added support for component testing for popular web frameworks such as

  1. React
  2. VueJS
  3. Storybook

Visual Regression Testing

Nightwatch v3 introduces visual regression testing as an in-house plugin. The plugin takes care of

  1. Capturing screenshots
  2. Comparison with baseline to highlight visual differences
  3. Report to review the differences
  4. Approve the changes

VRT can be done on real desktop & mobile browsers. Also, VRT can be run on components as part of component testing as well.

API Testing

API testing is now available with Nightwatch v3. The following functionality can be achieved with API testing

  1. Request assertions
  2. Response assertions
  3. Viewing API tests in the HTML report
  4. Mock server

Accessibility Testing

Nightwatch v3 packages the aXe-core package developed by Deque Systems as a plugin. It enables 90 different types of accessibility tests for WCAG compliance.

DOM history

Relive the test as it happened by enabling DOM history. When this functionaity is enabled, DOM snapshots are captured after every test and displayed in the HTML report for better debugging.