Created
December 1, 2013 07:46
-
-
Save mashhoodr/7729627 to your computer and use it in GitHub Desktop.
Using DatePicker view in Calabash iOS [http://imars.info/using-datepicker-view-in-calabash-ios-ios6/]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def select_date(date_string) | |
date = Date.parse(date_string) | |
query("view:'_UIDatePickerView'", [{:selectRow => date.month - 1}, {:inComponent => 0}, {:animated => 1}]) | |
query("view:'_UIDatePickerView'", [{:selectRow => date.day - 1}, {:inComponent => 1}, {:animated => 1}]) | |
query("view:'_UIDatePickerView'", [{:selectRow => date.year - 1}, {:inComponent => 2}, {:animated => 1}]) | |
sleep(0.4) | |
# the query does not create a UIControlEventValueChanged event, so we have to do a touch event | |
picker_scroll_up_on_column 0 | |
sleep(0.4) | |
picker_scroll_down_on_column 0 | |
sleep(0.4) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment