Cucumber Configuration With Batch

Running cucumber.js in WebStorm

If you are like me, the instructions for running Cucumber.js in WebStorm did not yield good results.  The configuration dialog expects an Executable path, but the instructions on the github page only show the .js file  in the command line execution.  I assumed this meant that I needed to run the command line directly in node, but that didn’t seem to work either.  Ugh.

In a nutshell, you need to specify node as your executable in the configuration dialog and pass your cucumber.js file as an argument.  Like so:

WebStorm Cucumber.js Configuration

Turns out this will occasionally fail when WebStorm inserts an argument between your cucumber.js path and node.  Grrrrrr.

To make it work anyway, create a batch file (cucumber.bat) with the following contents:

CALL “<insert your node path here>\node.exe” <insert your cucumber bin path here>\cucumber.js %

Then change your configuration to look like so:

Cucumber Configuration With Batch

I hope this saves you some pain.