黄瓜跑步者类的Intellij IDEA Run配置 [英] Intellij IDEA Run configurations for Cucumber runner class

查看:262
本文介绍了黄瓜跑步者类的Intellij IDEA Run配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Intellij IDEA的新手.我有一个基于POM的黄瓜硒项目,在该项目中,我为每个功能文件创建了黄瓜跑腿类.在使用Eclipse时,我可以通过右键单击来执行这些运行程序类.但是,在Intellij IDEA(许可版本)中,即使在设置"窗口中启用了Java黄瓜插件和junit插件,我也无法获得运行"选项.

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.

也在运行/调试配置"窗口中->黄瓜java->主类应该是什么?我的主类具有启动firefox浏览器的代码,并且位于不同的子包中.

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.

如果我在Main类中提到"cucumber.cli.Main",它给我错误-无法找到或加载主类Cucumber.cli.Main

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

请帮助.

谢谢

推荐答案

提供了启用了黄瓜支持,您应该可以从.feature文件的上下文菜单中运行测试:

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

也在运行/调试配置"窗口中->黄瓜java->主类应该是什么?

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

在项目中启用Cucumber支持时,该类来自附加的jar存档.默认情况下,主类名称为cucumber.cli.Main:

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:

不要忘记在 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆