lib/appium_lib/driver.rb in appium_lib-0.3.1 vs lib/appium_lib/driver.rb in appium_lib-0.3.2
- old
+ new
@@ -106,11 +106,11 @@
device: 'Android',
name: @app_name || 'Ruby Console Android Appium',
app: absolute_app_path,
:'app-package' => @app_package,
:'app-activity' => @app_activity,
- :'app-wait-activity' => @app_wait_activity
+ :'app-wait-activity' => @app_wait_activity || @app_activity
}
end
# WebDriver capabilities. Must be valid for Sauce to work.
def ios_capabilities
@@ -252,9 +252,16 @@
#
# mobile :swipe, endX: 100, endY: 100, duration: 0.01
def mobile method, *args
raise 'Method must not be nil' if method.nil?
raise 'Method must have .to_s' unless method.respond_to? :to_s
+
+ if method.to_s.strip.downcase == 'reset'
+ # reset will undefine custom iOS JavaScript
+ # mark js as unloaded so it'll reload next use.
+ @ios_js = [] if @ios_js
+ end
+
@driver.execute_script "mobile: #{method.to_s}", *args
end
# Calls @driver.find_elements
def find_elements *args
\ No newline at end of file