Getting exception while executing feature file. I have tried using plugin instead of format, still issue persists

寵の児 提交于 2019-12-24 18:45:00

问题


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)


回答1:


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" }

The json report will be generated in the file and pretty plugin will use the console.



来源:https://stackoverflow.com/questions/57142113/getting-exception-while-executing-feature-file-i-have-tried-using-plugin-instea

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