- While editing the .feature file, type a reference to a step definition.
RubyMine highlights step as undefined, and gives detailed information at the tooltip:
While typing, use code completion Ctrl+SpaceCtrl+Space after keywords. Note that you can narrow down the suggestion list by typing characters contained anywhere within a description. So doing, on top of the suggestion list there will be the variants that contain specified characters as prefixes, followed by the variants with the arbitrary occurrences of characters:
- Press Alt+EnterAlt+Enter to show the Create Step Definition
- Select the target step definition file from the pop-up list:
You can either select one of the existing step definition files from the suggestion list, or create a new one.
RubyMine creates a step definition stub in the specified location.
- In the selected step definition file that opens in the editor, enter the desired code. Note that
the editor turns into the template editing mode and displays the first input field highlighted with
the red frame.
Type step definition in this frame and press EnterEnter or TabTab to complete input and pass to the next input field, where you have to enter your source code. After completing input, the caret moves to the end of the suggested step definition, and the editor returns to the regular mode of operation.
- You can find usages of a step definition. To do that, place the caret at the desired definition, and press Alt+F7Alt+F7. Refer to the section Finding Usages in Project for details.
RubyMine keeps an eye on the uniqueness of the step definitions. Step definitions with the same names are highlighted.