Skip to content

Nightwatch.js

Node.js framework for automated end-to-end testing of web and mobile apps via W3C WebDriver.nightwatchjs/nightwatch

Stars
12k
Forks
1.4k
Licence
MIT
Language
JavaScript
Last update
6 months ago
Type
Library

What it is

Nightwatch is a testing framework built on Node.js that runs automated checks against web applications and websites in real browsers. It uses the W3C WebDriver standard to control browsers, so tests simulate what a user does, such as clicking and typing. According to the README, it is developed at BrowserStack and also covers component, API, visual regression, and accessibility testing, plus native mobile apps via Appium.

  • Write end-to-end tests that check a web app's login or checkout flow in a browser
  • Run component tests by mounting React, Vue, or Angular components in isolation
  • Capture screenshots and compare them to baselines for visual regression testing
  • Run accessibility checks for WCAG compliance using the bundled aXe-core plugin
  • Automate native mobile app tests on Android and iOS through Appium

Great for

  • JavaScript or Node.js teams who want end-to-end browser tests
  • Projects that need component testing for React, Vue, Angular, or Storybook
  • Teams wanting one framework for unit, E2E, API, visual, and accessibility tests
  • Developers testing native Android or iOS apps through Appium

Not ideal for

  • People who only need unit tests in a non-JavaScript language, since the README centers on Node.js
  • Teams wanting a no-code testing tool, because tests are written in code
  • Projects that need a minimal setup with no browser or driver configuration, since WebDriver-based tooling requires it
Step-by-step guide: how to use Nightwatch.jsInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js

    Create or initialize a Nightwatch project (run from your project root, or give a path for a new one)

    npm init nightwatch@latest
  2. 2

    Run it

    • Run the setup command and answer the questions about language, test runner, browsers, test location, and base URL.
    • Review the example tests copied into your project during setup.
    • Follow the instructions printed at the end of setup to run your first test.
  3. 3

    Get the most out of it

    • Use the component testing support for React, Vue, Angular, or Storybook to test UI parts in isolation.
    • Enable visual regression testing to capture screenshots and review differences against a baseline.
    • Use the API testing features, including request and response assertions and the HTML report.
    • Add the accessibility plugin, which uses aXe-core, to check WCAG compliance.
    • Consult the developer guide at nightwatchjs.org/guide for configuration details the README does not cover.

Downloads

Strengths

  • Built on the W3C WebDriver standard, which the README presents as its foundation
  • Covers several test types in one framework, as described in the README
  • MIT licensed and actively maintained, with a recent push date and over 11,000 stars

Trade-offs

  • The README is truncated and gives few details on configuration, so you will need the official guide for depth
  • Mobile and some plugin features depend on external tools such as Appium and browser drivers, which add setup work
  • Version 3 is the current generation; users upgrading from older versions may need to review changes

How it compares

ProjectStarsTypeLevelUpdatedBest for
nightwatch (this)12kLibraryintermediate6 months agoJavaScript or Node.js teams who want end-to-end browser tests
cypress51kDev toolbeginner4 days agoDevelopers who want automated browser tests for a web application
SeleniumBase13.2kLibraryintermediate8 days agoPython developers writing automated browser tests for websites
jest45.5kLibrarybeginner4 days agoJavaScript or TypeScript developers who want a testing setup that works with little configuration
mocha22.9kLibraryintermediate5 days agoJavaScript and Node.js developers who want automated tests for their code
enzyme19.8kLibraryintermediate1.0 years agoDevelopers maintaining React codebases that already have component tests

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.