5

我们如何在 calabash android 中生成报告?我查看了有关如何生成报告的“黄瓜食谱”一书。但这并没有完全帮助我。我想生成有关登录失败原因的报告:例如:1) 用户输入有效凭据并尝试登录 2) 但是,由于 server_error/user_not_found 或某些异常,登录失败。登录失败时,我从服务器收到错误 xml/statusCode。

如何在葫芦中使用该 xml/状态代码生成报告?请帮忙 !!

4

4 回答 4

18

使用此命令执行您的测试:

calabash-android run <apkfile>.apk --format html --out reports.html
于 2013-03-13T12:33:44.077 回答
1
<%
date = Time.now.strftime('%m_%d-%H:%M:%S')
default_report = "./reports/output_#{date}.html"
default_rerun = "./rerun.txt"
%>

common: NO_STOP='1'
rerun_out: -f rerun -o <%= default_rerun %>
html_report:  -f html -o <%= default_report %>

run:  -p common -p rerun_out -p html_report

这是我的calabash-android 配置文件,你可以把它放在你的calabash android 项目下的./.config/cucumber.yml 文件中。使用以下命令会将测试结果同时导出到 rerun.txt 文件和 ./reports/output_#{date}.html 文件中:

calabash-android run *.apk -p run
于 2016-04-23T09:43:03.300 回答
0

对于 HTML 报告

> calabash-android run <apkfile>.apk --format HTML --out

对于 JSON 报告

> calabash-android run <apkfile>.apk --format JSON --out

这些是黄瓜中的其他格式,

  • 漂亮的
  • 进步
  • 用法
  • JUnit
  • 重新运行

从这里阅读更多信息:https ://cucumber.io/docs/reference#reports

于 2015-09-11T13:10:18.943 回答
0

对于HTML报告,请使用以下内容:

葫芦-android 运行 ${APKFile} -f html -o test-result.html

于 2017-03-23T05:53:48.823 回答