Run Nightwatch tests without a visible browser by adding --headless to the Nightwatch command. For a project-local installation, a basic run is npx nightwatch --headless; to run a particular test folder, use npx nightwatch tests --headless. Nightwatch’s command-line documentation lists Chrome, Edge, and Firefox for headless launches.
Run Nightwatch headlessly
From your project directory, use the local Nightwatch runner and pass the headless flag:
npx nightwatch --headless
To target a test folder or file, put its path on the command line:
npx nightwatch tests --headless
npx nightwatch tests/login.js --headless
The CLI accepts a test source path or file. Add the test path and any other options your project needs; the documented headless switch launches Chrome, Edge, or Firefox without displaying a browser window. See the Nightwatch command-line test runner documentation for the current flags and syntax.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Set up a project and browser configuration
Start a new project
For a new project, Nightwatch’s setup flow can initialize the project and generate nightwatch.conf.js:
npm init nightwatch
The setup prompts let you choose browsers, a test source folder, a base URL, and whether tests run locally, remotely, or both. Existing projects can instead configure Nightwatch directly. See Nightwatch Getting Started.
Choose settings for local and CI runs
Use named test environments when browser or infrastructure settings differ between a developer machine and CI. Select an environment with --env, and select an alternate configuration file with --config:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
npx nightwatch tests --headless --env ci
npx nightwatch tests --headless --config nightwatch.ci.conf.js
Use the environment and config names that actually exist in your project; the examples do not create those configurations. Consult Nightwatch Settings for WebDriver and environment configuration.
Free tools Windows power users keep installed
One-click scans. No signup required.
Choose local WebDriver or remote testing
A headless flag controls how a browser launches; it does not by itself configure remote infrastructure or test a broad browser-and-device matrix. For a normal local run, configure WebDriver and use a supported driver process. Nightwatch’s settings guide distinguishes local WebDriver execution from Selenium-based Grid or cloud testing: Selenium is needed for the latter, not inherently for a local headless run.
| Setup | What it is for | What you need to configure |
|---|---|---|
| Local browser | Run a selected browser on the machine or CI worker executing Nightwatch. | Nightwatch, browser, and the applicable WebDriver setup. A Selenium Server is not inherently required. |
| Grid or cloud | Run against remote browser infrastructure, including when you need a separate browser matrix. | Selenium/Grid or provider connection settings and any required credentials. Nightwatch names BrowserStack, Sauce Labs, LambdaTest, and TestingBot in its settings documentation; that establishes technical relevance, not a ranking or pricing comparison. |
See Nightwatch’s settings guide for remote configuration. Headless local execution and remote browser coverage are separate choices: use the former to hide the local browser window, and the latter when your test plan calls for browsers or infrastructure beyond that local setup.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Useful command-line options
--headlesslaunches Chrome, Edge, or Firefox in headless mode.--envselects a named test environment.--configselects a configuration file.--parallelenables parallel workers.--verboseenables extended HTTP command logging for diagnostics.
These are independent options, not prerequisites for every run. For example:
npx nightwatch tests --headless --env ci --parallel
Use parallel workers only when the project and its test environment are configured for them. When investigating a failure, add --verbose to inspect HTTP command traffic. Check the CLI reference for option details and changes across releases.
Chrome in Docker: configure container arguments only when needed
For Nightwatch’s documented ChromeDriver Docker-container scenario, Chrome needs the --no-sandbox argument. Configure it through Chrome options in the Nightwatch configuration, for example:
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
module.exports = {
test_settings: {
default: {
desiredCapabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: ['--no-sandbox']
}
}
}
}
};
Adapt the setting to the structure of your configuration file and existing Chrome arguments. This is a container-specific note from Nightwatch’s Chrome Driver documentation, not a universal requirement for headless Chrome on every machine.
Troubleshoot common headless-run problems
- The browser opens visibly. Confirm
--headlessis on the command actually executed, and that the selected browser and Nightwatch configuration are the ones you intended. - The command cannot find tests. Pass the correct source folder or file, such as
tests, and run the local command from the project directory. Check that the path matches your project layout. - The browser or driver does not start. Check that the browser and compatible driver setup are available to the local run, or verify the remote endpoint and credentials if using Grid/cloud. Consult Nightwatch’s settings and driver documentation for the selected browser.
- Chrome fails inside a Docker container. For the documented ChromeDriver container scenario, configure Chrome’s
--no-sandboxargument as described above; do not add it reflexively to unrelated environments. - You need more detail about a failure. Add
--verboseto show extended HTTP command logging, then use the output to distinguish command, driver, and remote-connection failures. - Local headless tests pass but coverage is insufficient. A hidden local browser does not equal a browser matrix. Configure remote Grid or cloud execution separately if the required coverage calls for it.
Or skip the browser setup
If you need a page capture rather than an end-to-end interaction test, ScreenshotNeo is a website screenshot API: one GET request can return a PNG, JPEG, WebP, or PDF. It is not a replacement for Nightwatch assertions or browser automation.
For example, request a screenshot with cURL (see the ScreenshotNeo API documentation):
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo can accept cookie or consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with response headers identifying the page verdict and billing status. Its MCP server provides screenshot and PDF tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Version and compatibility note
The Nightwatch command-line documentation displayed version 3.16.0 when reviewed for this guide. Nightwatch releases, browser behavior, and driver compatibility can change, so check the current CLI documentation and the relevant browser-driver guide when updating a project.
Frequently Asked Questions
Does headless mode mean Nightwatch needs Selenium Server?
No. Selenium Server is for Grid or cloud testing; Nightwatch documents local WebDriver execution separately.
Which browsers does the documented headless flag support?
The Nightwatch CLI documentation lists Chrome, Edge, and Firefox.
Does headless testing cover multiple browsers automatically?
No. The flag changes browser visibility; selecting remote infrastructure or a browser matrix is a separate configuration decision.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

