json - 如何修复黄瓜 4.1.0 gem 中的警告格式 JSON 弃用?
问题描述
我最近更新到最新的 Ruby cucumber gem,现在收到以下警告:
WARNING: --format=json is deprecated and will be removed after version 5.0.0.
Please use --format=message and stand-alone json-formatter.
json-formatter homepage: https://github.com/cucumber/cucumber/tree/master/json-formatter#cucumber-json-formatter.
稍后我将使用 json 输出进行报告。在我的cucumber.yml
我有以下默认配置文件:
default:
-r features
--expand -f pretty --color
-f json -o reports/cucumber.json
根据参考https://github.com/cucumber/cucumber/tree/master/json-formatter#cucumber-json-formatter他们说要使用类似的东西
cucumber --format protobuf:cucumber-messages.bin
cat cucumber-messages.bin | cucumber-json-formatter > cucumber-results.json
和
Trying it out
../fake-cucumber/javascript/bin/fake-cucumber \
--results=random \
../gherkin/testdata/good/*.feature \ |
go/dist/json-formatter-darwin-amd64
但目前还不清楚如何做到这一点。
解决方案
我猜您需要更改您的黄瓜配置文件以生成 protobuf 输出而不是 json,然后添加一个步骤将文件后处理为您想要的 json?
我假设上面的“试用”是您实际试用的输出,而不仅仅是从格式化程序的 Github 页面直接剪切和粘贴......
推荐阅读
- azure-devops - Azure Devops - 限制特定 WIT 类型的写入权限
- drupal-7 - 如何在视图中显示段落字段中的所有数据(Drupal 7)
- javascript - 在 Laravel 表单中自动进行计算
- mongodb - 我应该怎么做才能对nestjs mongoose进行下一次测试?
- javascript - React 父组件道具无法在子组件中使用 forwardRef 道具访问
- asp.net-core - 在 Visual Studio(ASP.NET CORE 的本地调试会话)中查询 Application Insights 时,如何确保没有丢失遥测数据?
- macos - MacOS Monteray-Update 之后:未找到 DBT 分布
- java - MAC doFinal 为相同的数据给出不同的值
- robotframework - 如何加载包含小黄瓜变量的文件,而不是在机器人框架测试中写入变量
- scope - 将 android 系统从 10 更新到 11 时 isExternalStorageLegacy 为 false