Skip to content

Commit 8ce3009

Browse files
Fix caps for new appium
1 parent a6e7df2 commit 8ce3009

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

lib/appium_lib/driver.rb

+2-14
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ def update data, *args
7070

7171
# ensure app path is resolved correctly from the context of the .txt file
7272
ENV['APP_PATH'] = Appium::Driver.absolute_app_path ENV['APP_PATH']
73-
74-
# device is not case sensitive
75-
ENV['DEVICE'] = ENV['DEVICE'].strip.downcase if !ENV['DEVICE'].nil?
7673
end
7774

7875
# return list of require files as an array
@@ -300,19 +297,12 @@ def initialize opts={}
300297
@device = opts.fetch :device, ENV['DEVICE']
301298
raise 'Device must be set' unless @device
302299

303-
@version = opts[:version]
304-
if @device == 'Android' || @device == 'Selendroid'
305-
@version = '4.3' unless @version # default android to 4.3
306-
else
307-
@version = '7' unless @version # default ios to 7
308-
end
309-
310300
@device_type = opts.fetch :device_type, 'tablet'
311301
@device_orientation = opts.fetch :device_orientation, 'portrait'
312302

313303
# load common methods
314304
extend Appium::Common
315-
if @device == 'Android'
305+
if @device.downcase == 'android'
316306
# load Android specific methods
317307
extend Appium::Android
318308
else
@@ -381,7 +371,6 @@ def android_capabilities
381371
{
382372
compressXml: @compress_xml,
383373
platform: 'Linux',
384-
version: @version,
385374
device: @device,
386375
:'device-type' => @device_type,
387376
:'device-orientation' => @device_orientation,
@@ -397,7 +386,6 @@ def android_capabilities
397386
def ios_capabilities
398387
{
399388
platform: 'OS X 10.9',
400-
version: @version,
401389
device: @device,
402390
name: @app_name || 'Ruby Console iOS Appium',
403391
:'device-orientation' => @device_orientation
@@ -406,7 +394,7 @@ def ios_capabilities
406394

407395
# @private
408396
def capabilities
409-
caps = ['iPhone Simulator', 'iPad Simulator'].include?(@device) ? ios_capabilities : android_capabilities
397+
caps = @device.downcase === 'android' ? android_capabilities : ios_capabilities
410398
caps[:app] = self.class.absolute_app_path(@app_path) unless @app_path.nil? || @app_path.empty?
411399
caps
412400
end

0 commit comments

Comments
 (0)