问题
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