Add: Multi touch generic gestures. Using the Gestures module you can perform any multi touch gesture you want. For the most common scenarios, using the already defined methods will be sufficient. Examples:
touch("something", offset: {x: 10, y: -5})
touch("something", x: 0, y: 0) # Touch upper left
pan_left
pan("something", :up, time: 0.1) # This is a fast pan!
flick_up
pinch("WebView", :out)
touch("button", timeout: 30) # Wait up to 30 seconds for the button to appear
Change: All gestures now have a default timeout of 5 seconds to find the view before failing.
Change: Gestures will now query server-side. You should generally never save query results.
#bad
result = query("button")
touch(result)
#good
touch("button")
Deprecate tap
is not deprecated. Use tap_mark
instead.
Add: method to press the user action button press_user_action_button
. The user action button replaces the enter key and performs an appropriate action like going to the next field. If an argument is given, Calabash will perform the IME action specified. If not argument is given (recommended usage), Calabash will automatically extract what IME action to perform.
Note that Calabash due to security features in Android is unable to actually press the key on the IME. Instead Calabash will perform the same action that the IME was told by the application to show.
Usage:
keyboard_enter_text("Username")
press_user_action_button
keyboard_enter_text("Password")
press_user_action_button
Add support for boxed parameters when invoking methods on a view. This enables the use of query("* id:'ratingBar'", setRating: x)
on a rating bar and various other methods.
Add setdate and settime ruby methods. To remain backwards compatible, the methods can take a date- or timestring as their second parameter.
Usage:
set_date("DatePicker", 2014, 7, 1) # Set date to the 1st of July 2014 set_time("TimePicker", 16, 23) # Set the time to 16:23 (4:23 PM)
Add: generic press_key
method to simulate keypresses on physical buttons. The following ruby wrappers have been added:
press_button(key)
press_down_button
press_up_button
press_left_button
press_right_button
press_enter_button
Change: Backdoor is now a route taking any amount of parameters of any type. It will try to apply the method on the application. If it is not defined in the application, it will try to apply the method on the current activity. The new usage is backwards compatible.
Fix: Scrolling now works properly for List Views as well as Scroll Views and Web Views.
Fix: scrolldown and scrollup not looking for List Views or Web Views to scroll. Previously the methods only looked for Scroll Views.
Fix: Look for zipalign in build-tools in not found in tools (changed by Android dev tools).
Fix: Weird console behaviour. Calabash-android console now behaves as its iOS counterpart and should work correctly for rvm users.
Fix: Save calabash settings to .calabash_settings not calabash_settings