Saturday, May 2, 2015

Calabash an automation test framework for mobile development


Calabash uses to write and execute automated acceptance tests for mobile applications. It helps for both android and IOS applications. Calabash contains set of libraries that enable set of test code to programmatically interact with applications. Each action can be one of the fallows. 
  • Gestures (Touches or gestures. As an example tap, swipe and rotate)
  • Assertions (As an example there should be a "Login" button or the web view should contain an "<h1>" element with the any text)
  • Screenshots (screen dump the current view on the current device model)

Calabash provides set of APIs that support for apps running on touch screen devices. Calabash consists of two libraries called calabash-android and calabash-ios. Calabash-android is the automation and testing library for Android, and similarly calabash-ios is for ios. These two libraries are the low level libraries that allow the Cucumber tool to run automated functional tests on mobile devices as well as simulators. Using these two libraries test can be written in natural language. For an example below showing you a part of tests that written with calabash.
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 “Sandwich & Soup”
    And take picture
    Then I touch the "rating" button
    And I should see “Sandwich & Soup”
    And take picture
    When I touch "Sandwich & Soup"
    Then I should see details for “Sandwich & Soup”
    When I touch the "click" button
    Then I should see the rating panel
    Then I touch "star4
    And I touch "button"
    And take picture


This example is called a feature file in Calabash. It describes the intended behavior of the application. In this example as you can see each line after Scenario corresponds to a step. In calabash a step does one of three things: makes a user action, makes an assertion or takes a screenshot.
 

No comments:

Post a Comment