Sunday, June 2, 2013

calabash-android Gestures Steps

Gestures Steps


To swipe left 
Then /^I swipe left$/

To swipe right
Then /^I swipe right$/

To scroll down
Then /^I scroll down$/

To scroll up
Then /^I scroll up$/

To open the menu and press the specified text
Then /^I select "([^\"]*)" from the menu$/

To drag from one point on the screen to another.
Then /^I drag from (\d+):(\d+) to (\d+):(\d+) moving with (\d+) steps$/ 

Note: x:y co-ordinates are expressed as percentages of the screen width:height

 

calabash-android Assertion Steps

Assertion steps

To assert that specified text can be found use any of the following steps.
Then /^I see the text "([^\"]*)"$/
Then /^I see "([^\"]*)"$/
Then /^I should see "([^\"]*)"$/
Then /^I should see text containing "([^\"]*)"$/

To assert that specified text cannot be found use any of the following steps.
Then /^I should not see "([^\"]*)"$/
Then /^I don't see the text "([^\"]*)"$/
Then /^I don't see "([^\"]*)"$/ 
 
Scenario 1:
===========
Given a App
After the App Launch - You need to Verify the text "HelloWorld" Appears
 
Sample Code :
============= 
Feature: Demo feature
Scenario : Verify after App Launch - The text "HelloWorld" appears
And I should see "HelloWorld"

Pros and Cons of using calabash-android

Pros of using calabash-android:

1. It is an Open-Source Tool  - No Licensing Fees.
2. Since - The calabash-android is based on the Cucumber framework. The test cases can be easily created 
    in real simple language.
3. Support for all the basic events and movements on the mobile are present in the libraries.
4. It has a thriving forum and Google Group: “Calabash Android”.

Cons of using calabash-android:

1. It takes time to run on an emulator or device as it always installs the app first before starting the first 
    scenario.
2. If a step fails then the subsequent tests in the scenario are skipped.
3. It is still in its nascent stage. Support for many complex scenarios or events is not supported. For that 
    either you have to code your way in Ruby or wait for these supports to appear on the scene.
4. We must have the code of the app for identifying the ids of various elements.