lib/appium_lib/driver.rb in appium_lib-0.23.0 vs lib/appium_lib/driver.rb in appium_lib-0.24.0

- old
+ new

@@ -250,11 +250,10 @@ @raw_capabilities = opts.fetch(:raw, {}) @custom_url = opts.fetch :server_url, false @compress_xml = opts[:compress_xml] ? true : false - @fast_clear = opts[:fast_clear] ? true : false @export_session = opts.fetch :export_session, false @default_wait = opts.fetch :wait, 30 @last_waits = [@default_wait] @@ -298,10 +297,20 @@ raise 'Device must be set' unless @device @device_type = opts.fetch :device_type, 'tablet' @device_orientation = opts.fetch :device_orientation, 'portrait' + @full_reset = opts.fetch :full_reset, true + @no_reset = opts.fetch :no_reset, false + + # handle reset dependencies + # when full reset is requested, then "no reset" should not be true + @no_reset = false if @full_reset + @full_reset = false if @no_reset + @fastReset = ! @full_reset && ! @no_reset + @skipUninstall = @fastReset || @no_reset + # load common methods extend Appium::Common if @device.downcase == 'android' # load Android specific methods extend Appium::Android @@ -369,11 +378,15 @@ # https://github.com/jlipps/appium/blob/master/app/android.js def android_capabilities { compressXml: @compress_xml, platform: 'Linux', - device: @device, + platformName: @device, + fullReset: @full_reset, + fastReset: @fast_reset, + noReset: @no_reset, + skipUninstall: @skip_uninstall, :'device-type' => @device_type, :'device-orientation' => @device_orientation, name: @app_name || 'Ruby Console Android Appium', :'app-package' => @app_package, :'app-activity' => @app_activity, @@ -384,10 +397,10 @@ # @private # WebDriver capabilities. Must be valid for Sauce to work. def ios_capabilities { platform: 'OS X 10.9', - device: @device, + platformName: @device, name: @app_name || 'Ruby Console iOS Appium', :'device-orientation' => @device_orientation }.merge(@raw_capabilities) end \ No newline at end of file