Enable Cucumber support
To be able to use Cucumber in your application, make sure that the necessary plugins are enabled and add the Cucumber library to your project.
Enable plugins
In IntelliJ Ultimate, the required plugins are bundled and enabled by default. However, we recommend you to make sure that they are switched on.
In IntelliJ Community, the necessary plugins are not bundled, that is why you need to install and enable them.
In the Settings/Preferences dialog Ctrl+Alt+S, select Plugins.
Switch to the Installed tab and make sure that the following plugins are enabled (the plugins must be enabled in the specified order):
Gherkin
Cucumber for Java
Cucumber for Groovy (optional: install this plugin if you want to create step definitions in Groovy)
If the plugins are not installed, switch to the Marketplace tab, type their names in the search field in the specified order, and click Install next to each of them.
Apply the changes and close the dialog. Restart the IDE if prompted.

Add the Cucumber library
Follow these steps to add a library if you're building your project with the native IntelliJ IDEA builder:
From the main menu, select File | Project Structure (Ctrl+Alt+Shift+S) or click
on the toolbar.
Under Project Settings, select Libraries and click
| From Maven.
In the dialog that opens, specify the artifact of the library version that you want to use in your project, for example:
io.cucumber:cucumber-java:jar:6.1.1
orio.cucumber:cucumber-java8:jar:6.1.1
(if you want to use lambda expressions in step definitions).Click OK.
Apply the changes and close the Project Structure dialog.
tip
Apart from the Cucumber library, you might need to add a library for JUnit or another testing framework.
Prepare folder structure
Make sure that your project has the following folders:
Test Sources Root: a
folder that stores your test code
Test Resources Root: a
folder that stores files associated with your test sources
