简体   繁体   English

Cucumber JSON Formatter for Ruby 2.6 - 如何从消息转换为 json

[英]Cucumber JSON Formatter for Ruby 2.6 - how to convert from message to json

Trying to follow the directions from github:https://github.com/cucumber/cucumber/tree/master/json-formatter to create a json formatted result when running cucumber test.尝试按照 github 中的说明:https://github.com/cucumber/cucumber/tree/master/json-formatter在运行 cucumber 测试时创建 json 格式的结果。

  1. first I run cucumber --format message./features/1_VL-2.feature >./cucumber-report/cucumber-message.bin首先我运行 cucumber --format message./features/1_VL-2.feature >./cucumber-report/cucumber-message.bin

(my feature test file called "1_VL-2.feature" on my folder called "feature". I put the output in my folder "cucumber-report" in the file "cucumber-message.bin") (我的名为“feature”的文件夹中名为“1_VL-2.feature”的功能测试文件。我将 output 放在文件“cucumber-message.bin”中的文件夹“cucumber-report”中)

the file cucumber-message.bin then contains the output file of my run.文件 cucumber-message.bin 然后包含我运行的 output 文件。

  1. Then trying to convert to json using the description from Github: cucumber --format protobuf:cucumber-messages.bin cat cucumber-messages.bin |然后尝试使用 Github 中的描述转换为 json:cucumber --format protobuf:cucumber-messages.bin cat cucumber-messages.bin | cucumber-json-formatter > cucumber-results.json黄瓜-json-格式化程序 > 黄瓜-results.json

get the error that zsh: exec format error: cucumber-json-formatter cannot load such file -- protobuf:cucumber_messages.bin Error creating formatter: protobuf:cucumber-messages.bin (LoadError)得到错误 zsh: exec format error: cucumber-json-formatter cannot load such file -- protobuf:cucumber_messages.bin Error creating formatter: protobuf:cucumber-messages.bin (LoadError)

Used this command to the the formatter.curl -Lkfo /usr/local/bin/cucumber-json-formatter将此命令用于格式化程序。curl -Lkfo /usr/local/bin/cucumber-json-formatter
https://github.com/cucumber/cucumber/releases/download/cucumber-json-formatter%2Fv5.1.0/cucumber-json-formatter-linux-amd64 https://github.com/cucumber/cucumber/releases/download/cucumber-json-formatter%2Fv5.1.0/cucumber-json-formatter-linux-amd64
&& chmod a+x /usr/local/bin/cucumber-json-formatter && chmod a+x /usr/local/bin/cucumber-json-formatter

What am I doing wrong/missing?我做错了什么/错过了什么?

I've just updated theStandalone JSON Formatter documentation .我刚刚更新了Standalone JSON Formatter 文档 If anything is unclear, please raise an issue in that GitHub repo.如果有任何不清楚的地方,请在 GitHub 回购中提出问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM