24th July 2022 - 14 minutes read time
Nightwatch.js is an end to end testing framework, written in JavaScript. It can be used to test websites and applications and uses the W3C WebDriver API to drive modern browsers to perform the tests.
In this article I will look at setting up Nightwatch.js in a project and getting started with writing tests.
Installing Nightwatch.js
To install Nightwatch.js you should have a npm project. This can be an existing project, but Nightwatch.js can be easily installed as a standalone application; which is useful if you just want to get familiar with the system.
Creating a new, empty, npm project can be done with the following command.
npm init -y
You can now include Nightwatch.js as a development dependency into your project.
npm install nightwatch --save-dev