Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - Cucumber step definition case

Ever since I upgraded to latest community edition of IntelliJ 15.0.3, whenever I auto generate a step definition from the feature definition file using alt + enter, it creates the method in camel case rather than usual style with underscores.

For e.g. it used to be generated like this

@When("Cucumber is awesome")
public void cucumber_is_awesome() {}

But now it generates in usual camelCase convention:

@When("Cucumber is awesome")
public void cucumberIsAwesome() {}

Is there any way to change this setting back to the first style?

Thanks

like image 389
RandomQuestion Avatar asked Feb 26 '16 08:02

RandomQuestion


People also ask

How do you define step definitions in cucumbers?

Add a Step Definition file 1) Create a new Class file in the 'stepDefinition' package and name it as 'Test_Steps', by right click on the Package and select New > Class. Do not check the option for 'public static void main' and click on Finish button. Take a look at the message in the console window.

Why step definition is not recognized in Cucumber?

If Cucumber is telling you that your steps are undefined, when you have defined step definitions, this means that Cucumber cannot find your step definitions. You'll need to make sure to specify the path to your step definitions (glue path) correctly.


1 Answers

What you can do is check the

Run -> Edit Configuration

then go to the cucumber config. Within the Program Arguments check if

--snippets camelcase

is present and take it out. that should make it show it in snake casing again. Hope that helps :-)

like image 86
Sammy65 Avatar answered Oct 14 '22 12:10

Sammy65