Use this command to execute your test:
calabash-android run <apkfile>.apk --format html --out reports.html
Domanda
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 !!
Soluzione
Use this command to execute your test:
calabash-android run <apkfile>.apk --format html --out reports.html
Altri suggerimenti
<%
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
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,
Read more from here: https://cucumber.io/docs/reference#reports
For HTML report use the following:
calabash-android run ${APKFile} -f html -o test-result.html