Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Debugging Nightwatch tests in WebStorm
Clone this wiki locally
You can setup Nightwatch to debug through WebStorm IDE. Here's how to do this:
Create New Configuration
- Click Run in the main toolbar
- Edit Configurations
- On the top left of the Run/Debug Configurations dialog, click the + sign.
- Choose Node.js
- Name the new configuration "Nightwatch"
- WebStorm should detect your node interpreter (probably in /usr/local/bin/node)
- Under "Application parameters" enter the config switch with the path to your nightwatch.json, e.g. "--config tests/integration/nightwatch.json"
- Click Apply.
- Click Run
- Debug "Nightwatch"
-- Debugging tests is not supported when running in parallel, since a test worker is a separate node process.
-- You can run or debug a single file through WebStorm using the context menu. For this to work with Nightwatch you need to change the config setup you have for the default Node.js (and can get rid of the Nightwatch config if you want too).
Debug/Run a single nightwatch test
- Edit the default Node.js config
- Put all values in the "Node parameters" field instead, for example
C:\Users\tester\AppData\Roaming\npm\node_modules\nightwatch\bin\runner.js --config "D:\git\mytests\nightwatch.json" --env chrome
- Set the working directory to the location of your nightwatch/tests folder
From now on you can right click on a file in WebStorm to bring up the context menu and run/debug the individual file.