cucumber - 执行功能文件时出现异常。我尝试使用插件而不是格式,但问题仍然存在
问题描述
线程“main” cucumber.runtime.CucumberException 中的异常:只有一个格式化程序可以使用 STDOUT,现在 pretty 和 json 都使用它。如果您使用多个格式化程序,则必须在 cucumber.runtime.formatter.PluginFactory.defaultOutOrFailIfAlreadyUsed(PluginFactory.java:185) 在 cucumber.runtime.formatter.PluginFactory.convertOrNull(PluginFactory.java:144) 处使用 PLUGIN:PATH_OR_URL 指定输出路径在 cucumber.runtime.formatter.PluginFactory.instantiate(PluginFactory.java:99) 在 cucumber.runtime.formatter.PluginFactory.create(PluginFactory.java:87) 在 cucumber.runtime.RuntimeOptions.getPlugins(RuntimeOptions.java:241) 在cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:287) at com.sun.proxy.$Proxy0.uri(Unknown Source) at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:
解决方案
只需在插件值中提及 json 报告的完整路径即可CucumberOptions
。像下面的东西
plugin = { "pretty","json:target/json/report.json" }
json 报告将在文件中生成,漂亮的插件将使用控制台。
推荐阅读
- python - SMTPServer Disconnected: Connection unexpectedly closed
- regex - 正则表达式 - 如何处理单词边界问题?
- javascript - 如何通过 youtube 等排序检索最后一个订阅者?
- javascript - 我正在使用 react-image-crop 和 react 和 Express 来上传带有 Crop 的个人资料图片
- android - 对于有效的文档引用,DocumentSnapshot 始终为 null
- r - 在 R 中的 MonetDBLite 中使用 WHERE 子句的问题
- mysql - MYSQL 嵌套内连接查询
- angular - 更改Angular Material中自定义图标的颜色
- c - 在 scanf(%s) 之后代码不通过 C 中的 if 循环
- vue.js - 使用@vue/cli 3 创建项目后配置 Mocha 单元测试