问题描述
线程"main" cucumber.runtime.CucumberException中的异常:只有一个格式化程序可以使用STDOUT,现在pretty和json都使用它.如果使用多个格式化程序,则必须使用PLUGIN:PATH_OR_URL指定输出路径在Cucumber.runtime.formatter.PluginFactory.defaultOutOrFailIfAlreadyUsed(PluginFactory.java:185)在Cucumber.runtime.formatter.PluginFactory.convertOrNull(PluginFactory.java:144)在cumul.runtime.formatter.PluginFactory.instantiate(PluginFactory.java:99)在cumul.runtime.formatter.PluginFactory.create(PluginFactory.java:87)在Cucumber.runtime.RuntimeOptions.getPlugins(RuntimeOptions.java:241)在Cucumber.runtime.RuntimeOptions $ 1.invoke(RuntimeOptions.java:287)com.sun.proxy.$ Proxy0.uri(未知来源)在Cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:160)在Cucumber.runtime.Runtime.run(Runtime.java:121)在cumul.api.cli.Main.run(Main.java:36)在Cucumber.api.cli.Main.main(Main.java:18)
Exception in thread "main" cucumber.runtime.CucumberException: Only one formatter can use STDOUT, now both pretty and json use it. If you use more than one formatter you must specify output path with PLUGIN:PATH_OR_URL at cucumber.runtime.formatter.PluginFactory.defaultOutOrFailIfAlreadyUsed(PluginFactory.java:185) at cucumber.runtime.formatter.PluginFactory.convertOrNull(PluginFactory.java:144) at cucumber.runtime.formatter.PluginFactory.instantiate(PluginFactory.java:99) at cucumber.runtime.formatter.PluginFactory.create(PluginFactory.java:87) at cucumber.runtime.RuntimeOptions.getPlugins(RuntimeOptions.java:241) at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:287) at com.sun.proxy.$Proxy0.uri(Unknown Source) at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:160) at cucumber.runtime.Runtime.run(Runtime.java:121) at cucumber.api.cli.Main.run(Main.java:36) at cucumber.api.cli.Main.main(Main.java:18)
推荐答案
仅在 CucumberOptions
的插件值中提及json报告的完整路径.像下面这样
Just mention a complete path for the json report in the plugin value of CucumberOptions
. Something like below
plugin = { "pretty","json:target/json/report.json" }
json报告将在文件中生成,漂亮的插件将使用控制台.
The json report will be generated in the file and pretty plugin will use the console.
这篇关于执行功能文件时获取异常.我尝试使用插件而不是格式,但问题仍然存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!