Before you start
- Install Node.js and configure it as a local Node.js interpreter.
- Install and enable the NodeJS, Cucumber.js, and Gherkin repository plugins on the Plugins page as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
Open the built-in PyCharm Terminal (Alt+F12) and type one of the following commands at the command prompt:
npm install cucumberfor local installation in your project.
npm install -g cucumberfor global installation.
npm install --save-dev cucumberto install Cucumber.js as a development dependency.
Cucumber.js tests are launched only through a run/debug configuration.
To create a Cucumber.js run configuration
- Select a test file in the Project tool window and choose Create <file name> on the context menu. The corresponding Run/Debug Configuration dialog box opens.
- In the Feature file or directory text box, specify the tests to run. Type the path to a specific
.featurefile or to a folder, if you want to run a bunch of features.
- Specify the Node.js interpreter to use, see Configuring a local Node.js interpreter for details.
- In the Cucumber package field, specify the path to the folder where the
cucumberpackage is stored or the location of the
cucumber-js.bat, or other executable depending on your operating system.
- In the Name Filter text box, type the name of a specific scenario to run instead of all the scenarios from the feature file or directory.
- Specify the command line arguments to be passed to the executable file, such as
--tags TAG_EXPRESSION), or
--coffee. For details, see native built-in help available through the
To run tests via a run configuration:
- Select the Cucumber.js run/debug configuration from the list on the main toolbar and click to the right of the list.
- The test server starts automatically without any steps from your side. View and analyze messages from the test server in the Run tool window.
- Monitor test execution in the Test Runner tab of the Run tool window as described in Monitoring and Managing Tests.
With PyCharm, you can jump between a file and the related test file. Navigation from a test result in the Test Runner Tab to the test is also supported.
To jump between a file and the related test file
Open the file in the editor and choose or on the context menu, or just press Ctrl+Shift+T.
To jump from a test result to the test
Select the test name in the Test Runner tab and choose Jump to Source on the context menu. The test file opens in the editor with the cursor placed at the test definition.