-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Run Debug Nightwatch tests in IntelliJ
Shruti Rathee edited this page Aug 24, 2016
·
4 revisions
You can setup Nightwatch to run/debug through IntelliJ IDE. Here's how to do this:
(Skip this step if have Node.js plugin installed in your IntelliJ)
Node.js will be needed to run Nightwatch test cases. Since Node.js plugin doesn't come with IntelliJ IDE by default it will need to be added.
- Open the Settings/Preferences dialog.
- In the left-hand pane, select Plugins.
- On the Plugins page that opens in the right-hand part of the dialog, click the Install JetBrains plugin or the Browse repositories button.
- In the dialog that opens (the Browse JetBrains Plugins Dialog or the Browse Repositories dialog), look for Node.js and select Download and Install.
- Confirm your intention to download and install the selected plugin.
- Click Close.
- Click OK in the Settings dialog and restart IntelliJ IDEA for the changes to take effect.
- 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"
- IntelliJ should detect your node interpreter (probably in /usr/local/bin/node)
- Under "JavaScript file" enter node_modules/nightwatch/bin/runner.js
- Under "Application parameters" enter the config switch with the path to your nightwatch.json and environment you want to use to run test from your nightwatch.json file, e.g. "--config tests/integration/nightwatch.json -e chrome"
- Click Apply.
- Click Run
- Debug "Nightwatch"
Debugging tests is not supported when running in parallel, since a test worker is a separate node process.