How to set up Calabash for Android App Testing


Calabash is an open source project for testing mobile apps. It's based on cucumber so allows one to author test in business readable domain specific language. Calabash is available on Github.

I have a machine running Mac OSX (version 10.8.2) and I will be detailing steps on how I installed Calabash and got my first test running. Couple of things which you would need before installing Calabash is : Xcode, Ruby and Android SDK. 

I installed Homebrew which actually helped me upgrading the ruby to version 1.9.3 pretty easy.

Once you install Xcode, you would have to install Xcode command line tools. This would be in Xcode Preferences --> Downloads Tab, select the Command Line Tools and click on Install.


Post the Xcode you would want to check the ruby version, you need 1.8.7 or higher. If you have brew installed then running "brew install ruby" would upgrade the ruby else if you have rvm installed then try running "rvm install 1.9.3 --with-gcc=clang" followed by "rvm use 1.9.3 --default".


Once you are good with Xcode and Ruby, you would have to download Android SDK and set the ANDROID_HOME path in bash_profile.

export ANDROID_HOME=$HOME/android-sdks
export PATH=$PATH:$ANDROID_HOME:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/add-ons
Once the above steps are done, you would want to install calabash-android gems, use the following command to do the same "gem install calabash-android(in case this throws any error use sudo).

Download the sample Android App from Github "https://github.com/calabash/calabash-android-demoapp" and build the project in Eclipse. I am assuming here that you have basic Android set up done   with AVD created to run the sample app. Once you find the app running, its time to get started with calabash tests. Open the Terminal and navigate to the project folder, run the following command "calabash-android gen" to generate the "features" folder with some default set of files. The test is written in "my_first.feature" file. 

To run the calabash test, run the command as "calabash-android run path_to_.apk_file".  In case you run it from other folder you would see an error showing "You don't have a 'features' directory.  Please create one to get started."
All the details can be found here on the official page of calabash: 


Comments

Popular posts from this blog

Defect Tracking System – Wastage of Money & Time ???

The 3 qualities that will always help you become better at almost anything…

Test Case Paths : Happy, Sad & Bad