Calabash android predefined steps.

Calabash android has some predefined steps, you don’t need to define these steps in your steps definition ruby file. Just call these functions in your  feature file by passing valid argument.

Assertion steps:
Following are the some steps definition for the assertion

Then /^I see the text "([^\"]*)"$/  

Then /^I see "([^\"]*)"$/

Then /^I should see "([^\"]*)"$/ do

Then /^I should see text containing "([^\"]*)"$/ do

Then /^I should not see "([^\"]*)"$/ do

Then /^I don't see the text "([^\"]*)"$/ do

Then /^the view with id "([^\"]*)" should have property "([^\"]*)" = "([^\"]*)"$/ do

Then /^the "([^\"]*)" activity should be open$/ do


Press button.
Following are the some steps definition for the for press button.


Given /^I press the "([^\"]*)" button$/

Then /^I press button number (\d+)$/ do

Then /^I press image button number (\d+)$/ do

Then /^I press view with id "([^\"]*)"$/ do

Then /^I press "([^\"]*)"$/ do  # identifier

Then /^I click on screen (\d+)% from the left and (\d+)% from the top$/ do

Then /^I touch the "([^\"]*)" text$/ do

Then /^I press list item number (\d+)$/ do #line index number

Then /^I long press list item number (\d+)$/ do

# long press steps

Then /^I long press "([^\"]*)" and select item number "([^\"]*)"$/ do

Then /^I long press "([^\"]*)" and select "([^\"]*)"$/ do

Then /^I long press "([^\"]*)"$/ do


Enter text into field:
Following are the some steps definition to enter text into field.

Then /^I enter "([^\"]*)" as "([^\"]*)"$/ do # first argument test , second target

Then /^I enter "([^\"]*)" into input field number (\d+)$/ do

Then /^I enter "([^\"]*)" into "([^\"]*)"$/ do

Then /^I clear "([^\"]*)"$/ do

Then /^I clear input field number (\d+)$/ do

Then /^I clear input field with id "([^\"]*)"$/ do

Then /^I enter text "([^\"]*)" into field with id "([^\"]*)"$/ do


Rotation steps:

Then /^I rotate the device to landscape$/

Then /^I rotate the device to portrait$/

Wait steps:
Following are the some steps for the wait.

Then /^I wait for progress$/ do

Then /^I wait$/ do       #2 second wait

Then /^I wait for dialog to close$/ do

Then /^I wait for (\d+) seconds$/ # pass argument second to wait

Then /^I wait for 1 second$/ do

Then /^I wait for "([^\"]*)" to appear$/ do

Then /^I wait up to (\d+) seconds for "([^\"]*)" to appear$/ do # pass time and text in argument

Then /^I wait to see "([^\"]*)"$/ do   # pass text argument

hen /^I wait up to (\d+) seconds to see "([^\"]*)"$/ do # pass time and text in argument

Then /^I wait for the "([^\"]*)" button to appear$/ do

Then /^I wait for the view with id "([^\"]*)" to appear$/ do

Then /^I wait for the "([^\"]*)" view to appear$/

Then /^I wait for the "([^\"]*)" screen to appear$/ do

Then /^I wait upto (\d+) seconds for the "([^\"]*)" screen to appear$/ do

Then /^I wait for the "([^\"]*)" tab to appear$/ do


Navigation steps:
Following are the some navigation steps:

Then /^I go back$/

Then /^I press the menu key$/ do

Then /^I press the enter button$/ do

Then /^I swipe left$/ do

Then /^I swipe right$/ do

Then /^I select "([^\"]*)" from the menu$/ do

Then /^I select tab number (\d+)$/ do

Then /^I select the "([^\"]*)" tab$/ do

Then /^I scroll down$/ do

Then /^I scroll up$/ do

Then /^I drag from (\d+):(\d+) to (\d+):(\d+) moving with (\d+) steps$/ do

No comments:

Post a Comment

Leave your comments, queries, suggestion I will try to provide solution