nightwatch
Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
Nightwatch is a JavaScript testing framework that runs end-to-end browser tests, component tests, API tests, visual regression checks, and mobile app tests all from one tool using Node.js and WebDriver.
Nightwatch is a testing framework for JavaScript applications, built around the idea that you should be able to run all the different kinds of automated tests your project needs from a single tool. It runs on Node.js and communicates with real browsers using an established web standard called WebDriver, meaning your tests interact with Chrome, Firefox, Safari, and others the same way a real user would.
The main category of tests it handles is end-to-end testing: scripted sequences that open a browser, navigate to a page, click things, fill in forms, and check that the right content appears. Beyond that, version 3 added support for testing individual UI components in isolation for React, Vue, Angular, and Storybook projects. It also covers API testing (sending HTTP requests and checking responses), visual regression testing (comparing screenshots to catch unintended layout changes), and accessibility testing using a plugin that checks for compliance with web accessibility guidelines.
Mobile is also covered. Nightwatch connects to Appium, a separate tool, to run tests against native iOS and Android apps on simulators or real devices. The same framework handles both desktop browser tests and mobile app tests, so you do not need to maintain two separate testing setups.
Getting started involves running one npm command from your project directory. It launches a setup wizard that asks which browsers you are targeting, where your tests will live, and what the base URL of your application is, then generates the configuration automatically. Example tests are copied into the project so you have something to run right away.
Nightwatch was originally created by an independent consultancy in Oslo and later became part of BrowserStack, a company that provides cloud-based browser and device testing infrastructure. The project is open source under the MIT license.
Where it fits
- Write automated browser tests that navigate your web app, click buttons, fill forms, and verify the right content appears.
- Test React, Vue, Angular, or Storybook components in isolation without running the full application.
- Run visual regression tests to catch unintended layout changes between releases by comparing screenshots.
- Test native iOS or Android apps using the same framework as your browser tests, connected via Appium.