Member-only story

Getting Started With Nightwatch.js — Installation and Configuration

Marika Lam
2 min readAug 30, 2022

--

What is Nightwatch?

Nightwatch.js is an automated testing framework for web applications and websites, written in Node.js and using the W3C WebDriver API (formerly Selenium WebDriver).

It is a complete browser (End-to-End) testing solution which aims to simplify the process of setting up Continuous Integration and writing automated tests. Nightwatch can also be used for writing Node.js unit tests.

Installation

  1. Install Nightwatch
npm install [-g] nightwatch

2. Selenium Server Setup

To run the Selenium Server manually, from the directory with the jar run the following:

java -jar selenium-server-standalone-{VERSION}.jar

Configuration

The test runner expects a configuration file to be passed, using by default a nightwatch.json file from the current directory, if present. A nightwatch.conf.js file will also be loaded by default, if found.

Using both configuration files is also possible, with nightwatch.conf.js always taking precedence if both are found.

--

--

No responses yet