1. CALABASH –A Functional Testing Tool for Android and iOS
What is Calabash: Calabash is an open source functional testing tool for Android
and iOS mobile apps developed by LessPainful. Its based on Cucumber.
Calabash contains two low level libraries:
1) Calabash iOS
2) Calabash Android
These two libraries enable Cucumber tool to automate the test cases in very easy
understandable language.
One sample test case is written below:
Feature: Rating a stand
Scenario: Find and rate a stand from the list
Given I am on the List
Then I should see a "rating" button
And I should not see "Dixie Burger & Gumbo Soup"
And take picture
Then I touch the "rating" button
And I should see "Dixie Burger & Gumbo Soup"
And take picture
When I touch "Dixie Burger & Gumbo Soup"
Then I should see details for "Dixie Burger & Gumbo Soup"
When I touch the "rate_it" button
Then I should see the rating panel
Then I touch "star5"
And I touch "rate"
And take picture
This test specification file is called feature file in Calabash and Cucumber. This
feature file describes the intended behavior of the app. Each line after Scenario is
called step.
In Calabash a step does one of three actions:
2. 1) Makes a User action( e.g. touch, swipe, scroll etc)
2) Makes an assertion (e.g. I touch the button, I should see details etc)
3) Takes screen shots.
Overview of Calabash:
1) Calabash – iOS: It consists of two parts----
a) Client library written in Ruby
b) Calabash.framework, a server framework written in Objective – C
To use Calabash we make an special test target in XCode that links with
calabash.framework. The server framework starts HTTP server inside the
app that listens to requests from the client library.
The Cucumber tool executes the feature file that represents the intended
behavior of the App under test. The feature file contains steps either in
predefined or custom (user defined) step definitions.
Below is the illustration:
3. 2) Calabash- Android: The set up illustration for Calabash- Android looks like
this:
Features: The feature file is written in Cucumber and it describes the user
stories we want to test. In other words it contains the steps for intended
behavior of the app.
Step Definitions: Calabash Android comes with a set of predefined steps
that allows us to run the test faster and it also has the facility of providing
the custom (user defined) steps.
We don’t need to make any modifications to our app before we test it.
Intrumentation Test Server: This is another app that will be installed and
executed into the device. This app is based on
ActivityInstrumentationTestCase2 from the Android SDK. It is generated by
the Android Calabash framework.
4. In features file we can add either predefined steps given by LessPainful if those
satisfy our app intended behavior or can go after customized steps.
Predefined steps are separately available for Calabash iOS and Calabash Android
based on Cucumber.
Calabash has got advantage over other existing performance testing tools for it
being easy to be implemented with its Cucumber behavioral steps in features file.
Prepared by : Farhan Sumbul, CoConnect.