java IntelliJ 缩短 Cucumber 测试的命令行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48099958/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IntelliJ Shorten Command Line for Cucumber Tests
提问by DFW
I've encountered an issue running Cucumber tests in IntelliJ. When I try to run a feature or scenario, I get the following error:
我在 IntelliJ 中运行 Cucumber 测试时遇到问题。当我尝试运行功能或场景时,出现以下错误:
"Error running 'Feature <feature>': Command line is too long. Shorten command line for Feature: <feature> or also for Cucumber java default configuration"
I know as part of IntelliJ's 2017.3 release, they added support for a "Shorten Command Line" option in the Run/Debug Configurations. However, if I compare the default configs, I don't see it as part of the Cucumber Java configuration, but I do see it in the JUnit configuration for example.
我知道作为 IntelliJ 2017.3 版本的一部分,他们在运行/调试配置中添加了对“缩短命令行”选项的支持。但是,如果我比较默认配置,我不会将其视为 Cucumber Java 配置的一部分,但我确实在 JUnit 配置中看到了它,例如。
I don't get the popup tip that others have mentioned about the dynamic .classpath, I'm assuming because of this new release. Any ideas?
我没有得到其他人提到的关于动态 .classpath 的弹出提示,我假设是因为这个新版本。有任何想法吗?
回答by DFW
If you edit IntelliJ's workspace.xml file to set the dynamic.classpath
property to true, it will work.
如果您编辑 IntelliJ 的 workspace.xml 文件将该dynamic.classpath
属性设置为 true,它将起作用。
<component name="PropertiesComponent">
...
<property name="dynamic.classpath" value="true" />
</component>
I believe IntelliJ used to do this via a popup for you, but since the "Shorten Command Line" feature in 2017.3 has been added to the normal default Run/Debug configurations, it no longer does it this way. And since Cucumber for Java is a plugin, it must not know what to do in that scenario.
我相信 IntelliJ 曾经通过弹出窗口为您执行此操作,但是由于 2017.3 中的“缩短命令行”功能已添加到正常的默认运行/调试配置中,因此它不再以这种方式执行此操作。并且由于 Cucumber for Java 是一个插件,它一定不知道在这种情况下要做什么。
Hopefully the issue is fixed to add the dropdown:
希望问题得到解决以添加下拉列表:
Found some of the answer here: IDEA 10.5 Command line is too long
在这里找到了一些答案:IDEA 10.5 Command line is too long
回答by Nirbhay Rana
Edit run configuration
编辑运行配置
Select JAR manifest in shorten command line
在缩短命令行中选择 JAR 清单
Select installed JRE not intelij SDK
选择安装的 JRE 而不是 intelij SDK
Run now and it will work.
现在运行,它将起作用。
回答by Andrey
There is no such option for Cucumber tests, here the issue to vote and follow: IDEA-184133.
Cucumber 测试没有这样的选项,这里是投票和关注的问题:IDEA-184133。
Edit:issue was fixed in 2018.2 IDE version.
编辑:问题已在 2018.2 IDE 版本中修复。