Shabar
Shabar

Reputation: 2821

Cucumber-java test steps execute twice in IntelliJ

Normally I run Cucumber-Jvm tests using Run/Debug configuration. Once I tried to run one tests using Run window by selecting the scenario (right click and run) From that point on wards I see each time when I run test using Edit Configuration I see steps run twice.

I am using IntelliJ Community version

Anyone had this issue before could be any settings change.

Upvotes: 4

Views: 3253

Answers (3)

Oussama Werfelli
Oussama Werfelli

Reputation: 513

You have probably another test with the same name

Upvotes: 0

krishna
krishna

Reputation: 1

Also depends on number of examples you have provided in cucumber

Upvotes: 0

Right click on the Play button on your .feature file and select the last choice 'Create Scenario ...'. On the Program arguments box you should have CucumberJvm5SMFormatter only ONCE. I had:

--plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name "^My Scenario$"

Simply, I deleted the second line:

--plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm5SMFormatter --name "^My Scenario$"

and it ran perfectly!

Upvotes: 3

Related Questions