Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate report in Calabash-android

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 !!

like image 803
Sabrish Avatar asked Mar 08 '13 06:03

Sabrish


People also ask

What is Calabash Android?

In short, Calabash is a test automation framework that enables mobile developers and pretty much anyone without coding skills to create and execute automated acceptance tests for Android and iOS apps.

What is calabash cucumber?

What is Calabash? Calabash is an open-source Acceptance Testing framework that allows you to write and execute tests for iOS and Android Apps. It's an Automated User Interface Framework that allows tests to be written in Ruby using Cucumber.

How to install Calabash Android?

Calabash-Android Setup for WindowsDownload and install the Android SDK from https://developer.android.com/sdk/installing/index.html. Then add the tools and platform-tools directories from the SDK to your PATH environment variable. Install the Genymotion Android emulator, available from: http://www.genymotion.com.


2 Answers

Use this command to execute your test:

calabash-android run <apkfile>.apk --format html --out reports.html
like image 124
Sanjay Joshi Avatar answered Sep 19 '22 15:09

Sanjay Joshi


<%
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
like image 39
Miles.Yan Avatar answered Sep 20 '22 15:09

Miles.Yan