Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify the step definition prototype name in Intellij Idea?

I write my cucumber scenario to include the following step:

And the frabjous bandersnatch whiffled "Callooh"

Type alt-enter, choose Create Step Definition, and it produces:

@And("^the frabjous bandersnatch whiffled \"([^\"]*)\"$")
public void the_frabjous_bandersnatch_whiffled(String arg1) throws Throwable {
    // Express the Regexp above with the code you wish you had
    throw new PendingException();
}

but our coding standards require camelCase for methods, so I have to manually change the_frabjous_bandersnatch_whiffled to theFrabjousBandersnatchWhiffled. Is there a setting somewhere that will tell Idea to use camel case instead of underscores in this situation?

Also, when it's offering possible classes into which to place my new stepdef, can I have it filter to only classes with names ending in "Steps"?

like image 620
Carl Manaster Avatar asked Aug 06 '13 17:08

Carl Manaster


People also ask

How do I write step definition in IntelliJ?

Add step definitionsfeature file and press Alt+Enter . The list of suggested intention actions opens. Select Create step definition to create a definition only for one step, or select Create all step definitions to add definitions for all steps in a scenario.

How does feature file identify which step definition to call?

Step definition maps the Test Case Steps in the feature files(introduced by Given/When/Then) to code. It which executes the steps on Application Under Test and checks the outcomes against expected results. For a step definition to be executed, it must match the given component in a feature.

How do I open step definition from feature file in IntelliJ?

Open the desired . feature file in the editor. Click the hyperlink. The step definition file opens in the editor, with the caret resting at the desired step definition.

How does IntelliJ determine Class definition?

In IntelliJ IDEA, you can see where and how symbols, such as tags, classes, fields, methods, or functions are defined in your project. For this purpose, the IDE features the Quick Definition popup. To view definition of a symbol, select it in the editor and press Ctrl+Shift+I (or click View | Quick Definition).


1 Answers

Probably way too late, but maybe still helpful:

You can set the --snippets camelcase option in the Edit Configurations in intelliJ:

Main menu Run -> Edit Configurations

(I have prepared a screenshot to show this, but almighty Stackoverflow deems me unworthy of posting images, well thought out, indeed!)

like image 157
Sascha Avatar answered Sep 18 '22 00:09

Sascha