When the software being tested exposes REST API endpoints it can be more efficient to test the APIs directly instead of going through the UI.
Nightwatch was published in January 2014, initially created by Andrei Rusu as a tool to enable writing of automated UI tests in a straightforward way, and which will require as little configuration and additional libraries as possible.
Right after it was published, Nightwatch has seen steady growth and has now become one of the most popular Node.js end-to-end testing solutions for web applications and websites.
From the very first Github Issue opened by Evan You (creator of Vue.js) and seamless integration with the Vue.js framework, to being featured on the 2017 ThoughtWorks Technology Radar, Nightwatch has become an established household name in the wider automated testing industry.
Instead of building a highly flexible tool which supports a lot of plugins and customization we aim to deliver a tool that is packed with everything you need out of the box.
We believe that in order to write tests you should only focus on writing tests and not have to add multiple external plugins and dependencies. In our experience, this usually leads to increasingly more time spent on maintaining dependencies and solving configuration issues, instead of writing actual tests.
We do however provide mechanisms to extend the existing API commands and assertions when needed and you can also use Nightwatch programmatically if you wish. We also do our best to ensure that Nightwatch follows an industry agreed upon practice and we try to be compatible with other existing tools.
You can even write Node.js unit tests in Nightwatch to test your backend APIs. These tests are using the same assertion libraries and the same syntax and runner. We can even combine end-to-end tests with unit/integration tests in the same test run.
Current Version – 1.7
This version adds integrated support for the latest Microsoft Edge browser, improved parallelism support, and a few other features and improvements (such as making the API work with both chaining and promises).
We are working towards releasing the next major version which will be built on top of the Selenium Webdriver, which will be making test run significantly more stable and more reliable.
We'll also add a few new capabilities, such as support for Chrome Dev Tools Protocol, file uploads, and a new APIs.
Contributing to Nightwatch
Issues with the documentation, such as inconsistencies, typos or mistakes can be reported on the Docs Github repository.
If you'd like to contribute API command examples, you can do so by adding them in this folder: github.com/nightwatchjs/nightwatch-docs/tree/main/api/method. These are automatically built into the individual API command pages.
For example, the clearValue page is built out of: github.com/nightwatchjs/nightwatch-docs/blob/main/api/method/clearValue.md.
You're encouraged to ask any questions you might have regarding the usage of Nightwatch or its APIs on the Github Discussions page. For reporting bugs, please submit a new Bug report on Github. Feature requests are also welcome.
New contributors: please also have a look at these resources:
On Discord Chat
We have setup a new chat server on Discord where you can chat with Nightwatch team members and other
Please use this link to get in:
We are on Twitter at @nightwatchjs where we post updates about releases and other type of announcements.
In addition, there is a StackOverflow Nightwatch.js tag at your disposal.
Articles & Tutorials
A curated list of articles, guides, and video tutorials from the wider Nightwatch community. Please note that the videos and articles listed here aren't created by the Nightwatch team and we cannot guarantee their full accuracy.
This guide will show you step-by-step how to create a TypeScript-enabled Nightwatch automated test suite.
A step-by-step guide on how to refactor Nightwatch test cases to use the Page Object model API and page commands.
Learn how to write automated accessibility tests using Nightwatch and the Axe accessibility tool. The tutorial will explain how to write assertions for web content accessibility guidelines and detect elements which are failing accessibility rules.
Nightwatch collaborator Domenico explains why end-to-end testing (and also other forms of testing) is an important topic to him. A good explanation of the testing pyramid concept and a good introduction to automated testing.
An extented guide on how to improve the security of Express apps using Nightwatch.
A rundown of the main features, how it works, and capabilities of Nightwatch.
Feel free to tip us off about any articles or open source projects that we should list on this page.