Intellij IDEA Run configurations for Cucumber runn

2019-03-03 01:12发布

I am new to Intellij IDEA. I have a POM based cucumber-selenium project, where I've created cucumber runner classes for each feature file. While working with Eclipse I was able to execute these runner classes by Right click. However in Intellij IDEA (licensed version), even when cucumber-for-java and junit plugins are enabled in Settings window, I dont get Run option.

Also in Run/Debug configurations window -> Cucumber java -> what should be the main class? My main class has code to launch firefox browser and is in different subpackage.

If i mention "cucumber.cli.Main" in Main class, it gives me error - Could not find or load main class cucumber.cli.Main

Please help.

Thanks,

1条回答
做个烂人
2楼-- · 2019-03-03 01:47

Provided that cucumber support is enabled you should be able to run the test from .feature file's context menu: enter image description here

Also in Run/Debug configurations window -> Cucumber java -> what should be the main class?

The class is taken from the jar archive attached when enabling Cucumber support in project. By default, the main class name is cucumber.cli.Main:

Run/Debug Configuration: Cucumber Java

Do not forget to specify the package where your step definitions are stored in the Glue filed of the Cucumber Run/Debug Configuration.

查看更多
登录 后发表回答