Intellij IDEA Run configurations for Cucumber runner class

人盡茶涼 提交于 2019-12-17 20:56:05

问题


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:


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

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:

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



来源:https://stackoverflow.com/questions/47224162/intellij-idea-run-configurations-for-cucumber-runner-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!