7

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"?

Carl Manaster
  • 39,912
  • 17
  • 102
  • 155

1 Answers1

2

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!)

Carl Manaster
  • 39,912
  • 17
  • 102
  • 155
Sascha
  • 91
  • 7
  • Can you expand on this please, I'm not having much joy generating camelcase step definitions from features in Intellij 14, thanks. – Jeremy Oct 21 '15 at 15:56
  • If only Stackoverflow would allow me to post a screenshot. It is pretty straightforward: Just add --snippets camelcase to the Program arguments line. – Sascha Oct 23 '15 at 06:08
  • I was unable to get this to work with IntelliJ 14 and `Cucumber for Java` plugin version 141.178. – markdsievers Feb 21 '17 at 20:58