Support Center

How to start using Calabash on Testdroid?

Last Updated: Apr 24, 2015 10:42AM CEST

If you are interested to start testing your apps with Calabash, please contact us at sales@bitbar.com and we’ll be happy to enable it for you. Here are some basic details of Calabash and how to use it in Testdroid.

Have fun!

 

Calabash


How to access Calabash for Android?

https://github.com/calabash/calabash-android


Installation

https://github.com/calabash/calabash-android/blob/master/documentation/installation.md

$ sudo gem install calabash-android

Now you should have command calabash-android in your path.


New test

$ mkdir new-calabash-test

$ cd new-calabash-test

$ calabash-android gen

Now you should have features-directory inside new-calabash-test directory.

Features directory contains my_first.feature-file, step_definitions-directory and support-directory. For simple test you only need to edit my_first.feature-file.

Here is the list of predefined steps required: https://github.com/calabash/calabash-android/blob/master/ruby-gem/lib/calabash-android/canned_steps.md


Run your first test

Here is an example of the first test for Calabash: 

 Feature: Click items

  Scenario: Run whole app

   When I press view with id "radio0"

   Then I wait

   Then I press view with id "radio1"

   Then I wait

   Then I press view with id "radio2"

   Then I take a screenshot

   Then I wait

   Then I enter text "Hello Calabash" into field with id "editText1"

   Then I take a screenshot

   Then I wait

   Then I press view with id "button1"

   Then I wait

   Then I take a screenshot

   Then I go back

   Then I wait

   Then I press view with id "radio1"

   Then I wait

   Then I press view with id "button1"

   Then I wait

   Then I take a screenshot


NOTE: Calabash requires that the application has INTERNET permission in the AndroidManifest.xml
 

If the application is not yet signed you can do it with Calabash:

$ calabash-android resign {path-to-apk}

Now you should be ready to run Calabash test locally

Go to new-calabash-test-directory and run:

$ calabash-android run {path-to-apk}
 

Output should look something like this:

 Feature: Click items

  Scenario: Run whole app # features/my_first.feature:3

   2485 KB/s (554161 bytes in 0.217s)

   2282 KB/s (100963 bytes in 0.043s)

   When I press view with id "radio0" # calabash-android-0.4.14/lib/calabash-android/steps/press_button_steps.rb:13

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I press view with id "radio1" # calabash-android-0.4.14/lib/calabash-android/steps/press_button_steps.rb:13

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I press view with id "radio2" # calabash-android-0.4.14/lib/calabash-android/steps/press_button_steps.rb:13

   Then I take a screenshot # calabash-android-0.4.14/lib/calabash-android/steps/screenshot_steps.rb:9

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I enter text "Hello Calabash" into field with id "editText1" # calabash-android-0.4.14/lib/calabash-android/steps/enter_text_steps.rb:25

   Then I take a screenshot # calabash-android-0.4.14/lib/calabash-android/steps/screenshot_steps.rb:9

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I press view with id "button1" # calabash-android-0.4.14/lib/calabash-android/steps/press_button_steps.rb:13

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I take a screenshot # calabash-android-0.4.14/lib/calabash-android/steps/screenshot_steps.rb:9

   Then I go back # calabash-android-0.4.14/lib/calabash-android/steps/navigation_steps.rb:1

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I press view with id "radio1" # calabash-android-0.4.14/lib/calabash-android/steps/press_button_steps.rb:13

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I press view with id "button1" # calabash-android-0.4.14/lib/calabash-android/steps/press_button_steps.rb:13

   Then I wait # calabash-android-0.4.14/lib/calabash-android/steps/progress_steps.rb:5

   Then I take a screenshot # calabash-android-0.4.14/lib/calabash-android/steps/screenshot_steps.rb:9

   1 scenario (1 passed)

   20 steps (20 passed)

   0m47.002s
 

If you have taken screenshots in your test there should be png-files in new-calabash-test-directory.


Run Calabash Android test in Testdroid Cloud

Access to Testdroid Cloud at https://cloud.testdroid.com/

After login, please follow the next steps to get your Calabash tests up and running on over 250 Android devices:
 

  1. Login to Testdroid Cloud
  2. Create a new project


 

  1. Upload your application (.APK)


 

  1. Create zip-package from your features-directory
  2. Upload test zip-package


 

  1. Select devices

 
  1. Check advanced configurations
  2. Run the project
  3. Check out results
 

Notes

If you need some particular Ruby gem for your tests please contact support@bitbar.com

Contact Us

support@bitbar.com
http://assets2.desk.com/
false
bitbar
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete