lib/calabash/device.rb in calabash-2.0.0.pre11 vs lib/calabash/device.rb in calabash-2.0.0.prelegacy

- old
+ new

@@ -3,11 +3,11 @@ # an Android emulator, or an iOS simulator. class Device include Utility # @!visibility private - @@default ||= nil + @@default = nil # @!visibility private def self.default @@default end @@ -178,18 +178,33 @@ # Performs a `pan` on the (first) view that matches `query`. # @see Calabash::Gestures#pan # @!visibility private def pan(query, from, to, options={}) - _pan(query, from, to, options) + Query.ensure_valid_query(query) + + ensure_valid_swipe_params(from, to) + + gesture_options = options.dup + gesture_options[:duration] ||= 0.5 + gesture_options[:timeout] ||= Calabash::Gestures::DEFAULT_GESTURE_WAIT_TIMEOUT + + _pan(query, from, to, gesture_options) end # Performs a `pan` between two elements. # @see Calabash::Gestures#pan_between # @!visibility private def pan_between(query_from, query_to, options={}) - _pan_between(query_from, query_to, options) + Query.ensure_valid_query(query_from) + Query.ensure_valid_query(query_to) + + gesture_options = options.dup + gesture_options[:duration] ||= 1 + gesture_options[:timeout] ||= Calabash::Gestures::DEFAULT_GESTURE_WAIT_TIMEOUT + + _pan_between(query_from, query_to, gesture_options) end # Performs a `flick` on the (first) view that matches `query`. # @see Calabash::Gestures#flick # @!visibility private @@ -222,10 +237,10 @@ end # Enter `text` into the currently focused view. # @see Calabash::Text#enter_text # @!visibility private - def enter_text(text, options={}) + def enter_text(text) abstract_method! end # @!visibility private def map_route(query, method_name, *method_args)