Wednesday, July 10, 2013

calabash-android Input Steps

INPUT STEPS

Then /^I toggle checkbox number (\d+)$/ do |checkboxNumber|
Toggles checkout with the specified index.

Then /^I long press "([^\"]*)"$/ do |text_to_press|
Long presses the text if found.

Then /^I long press "([^\"]*)" and select item number "([^\"]*)"$/ do |text_to_press, index|
Long presses the text (if found) and select the specified number in the context menu that appear.

Then /^I long press "([^\"]*)" and select "([^\"]*)"$/ do |text_to_press, context_text|
Long presses the text (if found) and select the specified number in the context menu that appear.

Given /^I set the date to "(\d\d-\d\d-\d\d\d\d)" on DatePicker with index "([^\"]*)"$/ do |date, index|
Finds the datepicker with the specified index and changes the date.

Given /^I set the time to "(\d\d:\d\d)" on TimePicker with index "([^\"]*)"$/
Given /^I set the "([^\"]*)" time to "(\d\d:\d\d)"$/
Finds the timepicker with the specified index and changes the time.

Given /^I set the "([^\"]*)" date to "(\d\d-\d\d-\d\d\d\d)"$/ do |content_description, date|
Find the datepicker by content description and changes the date.

Then /^I enter "([^\"]*)" into input field number (\d+)$/ do |text, number|
Enters the specified text into the input field with index number.

Then /^I enter text "([^\"]*)" into field with id "([^\"]*)"$/ do |text, view_id|
Enters Text into the input field with id view_id.

Then /^I enter "([^\"]*)" as "([^\"]*)"$/ do |text, target|
Then /^I enter "([^\"]*)" into "([^\"]*)"$/ do |text, target|
Enters the specified text into the input field that has a content desciption that matches the provided target.

Then /^I clear input field number (\d+)$/ do |number|
Finds a input field by index and blanks its value.

Then /^I clear "([^\"]*)"$/ do |name|
Finds a input field with matching content description and blanks its value.

Then /^I clear input field with id "([^\"]*)"$/ do |view_id|
Finds the input field with id view_id and clears the text from it.

Then /^I select "([^\"]*)" from "([^\"]*)"$/ do |item_text, spinner_content_description|
Finds the Spinner by 'spinner_content_description' and selects the item with the matching 'item_text'

6 comments:

  1. Hi Amit,

    I have a question on usage of SPINNER
    Have a Label: Category and lists the different categories - need to choose 1 from the list.
    Do you know - How to select the item from the list.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. Then I select "text on the item" from "id of the spinner"

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Unable to select date from the Calendar date picker

    ReplyDelete