IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Create feature files

Last modified: 10 August 2022

In Cucumber, feature files store high-level description of scenarios and steps in the Gherkin language. Gherkin uses plain English by default and promotes behavior-driven development.

Feature files are usually located in the features folder under Test Resources Root Test Resources Root icon. If you don't have a folder for test resources, you need to create one.

As you type, the IDE offers code completion and instant inspections with quick-fixes that help you define the scenario correctly. For example, creating a scenario goes before before adding step definitions, that is why at this stage the steps are highlighted as unresolved. When the feature file is finished, you can create step definitions with one shortcut.

Defining a scenario

In steps, you can use text notes enclosed in triple quotes. In this case, IntelliJ IDEA treats the text inside as a string and displays it when running the step.

Using text notes within a scenario