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

1

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

Beaty answered 6/8, 2013 at 17:7 Comment(0)
E
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!)

Existentialism answered 4/9, 2015 at 13:49 Comment(3)
Can you expand on this please, I'm not having much joy generating camelcase step definitions from features in Intellij 14, thanks.Stationmaster
If only Stackoverflow would allow me to post a screenshot. It is pretty straightforward: Just add --snippets camelcase to the Program arguments line.Existentialism
I was unable to get this to work with IntelliJ 14 and Cucumber for Java plugin version 141.178.Propylene

© 2022 - 2024 — McMap. All rights reserved.