lib/calabash-cucumber/map.rb in calabash-cucumber-0.19.2 vs lib/calabash-cucumber/map.rb in calabash-cucumber-0.20.0
- old
+ new
@@ -25,11 +25,11 @@
# * :changeDatePickerDate
#
# If `method_name` maps to no LPOperation, then it is treated a selector
# and is performed on any view that matches `query`.
#
- # @examples
+ # @example
#
# # Calls 'text' on any visible UITextField, because :text is not a defined operation.
# > map("textField", :text)
# => [ "old text" ]
#
@@ -53,9 +53,15 @@
#
# Well behaved LPOperations should return the view as JSON objects.
#
# @todo Calabash LPOperations should return 'views touched' in JSON format
def self.map(query, method_name, *method_args)
+ require "calabash-cucumber/launcher"
+ launcher = Calabash::Cucumber::Launcher.launcher_if_used
+ if launcher && launcher.automator && launcher.automator.name == :device_agent
+ launcher.automator.client.send(:_dismiss_springboard_alerts)
+ end
+
self.raw_map(query, method_name, *method_args)['results']
end
# Returns a JSON object the represents the result of performing an http
# query against the calabash server.