Sunday, 9 February 2014

calabash cross platform extended: calabash ios & Android

I have extended my test suite to follow page / screen object model.

have a look at visual representation of the page object pattern and how does it map on to different files in the test suite.


1) Ibase (ios) and Abase( Android) are base classes for IOS / Android
2) Base page extends base classes further  and implements some functionality that can be used by all classes extending it.
3) Welcome page extends base class and implements methods which are specific to welcome page

(in a typical scenario)
  1. Each step in a feature file will have implementation in step definitions folder
  2. Each step definitions will create a corresponding object of a page (ex:
  3. Each page object will call some calabash method to verify elements (ex: query ) or do actions on app (ex: touch)  which is implement  with in page.

Sample Source code:

1) Feature file -
Scenario: Navigate to login page
    Given I am on login page
    Then I verify login page

2)  Step definition-
Given(/^I am on login page$/) do

3) method implementation.
def wait_for_welcome_screen

4)Sample class

class WelcomePage < BasePage

  def trait
    "* marked:'Start blogging in seconds.'"

  def wait_for_welcome_screen


5) Base page
class BasePage < Calabash::ABase
 # Template for adding commond android methods

1 comment:

  1. Hi

    This is really good. can you please comment on the .await
    I am not aware of what it does and why and when would one use .await.