5

How do we generate reports in calabash android ? I looked in to "The cucumber recipe" book on how to generate report. But that didn't help me completely. I want to generate report on why login failed : For eg : 1) User enter valid credential and tries to Login 2) But, Login fails due to server_error/user_not_found or some exceptions . I get error xml/ statusCode from server when login fails.

How to generate report using that xml/status code in calabash ? Please help !!

Sabrish
  • 98
  • 1
  • 6

4 Answers4

18

Use this command to execute your test:

calabash-android run <apkfile>.apk --format html --out reports.html
Aravin
  • 6,605
  • 5
  • 42
  • 58
Sanjay Joshi
  • 231
  • 2
  • 3
  • 1
    Thanks for sharing, there's not much documentation around the syntax of these options to be passed. I'd mark this as "Answered" if I could. – lux Jul 17 '14 at 14:11
  • I'm getting an "invalid options" error whenever I run calabash-android with these flags. Anyone know of a fix or work around? – Bryan Baraoidan Jul 12 '16 at 01:08
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

Here is my calabash-android profile config, you can put it in ./.config/cucumber.yml file under your calabash android project. using the following command will export the test result into a rerun.txt file and a ./reports/output_#{date}.html file at the same time:

calabash-android run *.apk -p run
Miles.Yan
  • 11
  • 1
0

For HTML report

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

For JSON report

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

These are the otehr formats in cucumber,

  • Pretty
  • Progress
  • Usage
  • JUnit
  • Rerun

Read more from here: https://cucumber.io/docs/reference#reports

Aravin
  • 6,605
  • 5
  • 42
  • 58
0

For HTML report use the following:

calabash-android run ${APKFile} -f html -o test-result.html

ruchir
  • 175
  • 1
  • 1
  • 9