@@ -70,9 +70,6 @@ def update data, *args
70
70
71
71
# ensure app path is resolved correctly from the context of the .txt file
72
72
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?
76
73
end
77
74
78
75
# return list of require files as an array
@@ -300,19 +297,12 @@ def initialize opts={}
300
297
@device = opts . fetch :device , ENV [ 'DEVICE' ]
301
298
raise 'Device must be set' unless @device
302
299
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
-
310
300
@device_type = opts . fetch :device_type , 'tablet'
311
301
@device_orientation = opts . fetch :device_orientation , 'portrait'
312
302
313
303
# load common methods
314
304
extend Appium ::Common
315
- if @device == 'Android '
305
+ if @device . downcase == 'android '
316
306
# load Android specific methods
317
307
extend Appium ::Android
318
308
else
@@ -381,7 +371,6 @@ def android_capabilities
381
371
{
382
372
compressXml : @compress_xml ,
383
373
platform : 'Linux' ,
384
- version : @version ,
385
374
device : @device ,
386
375
:'device-type' => @device_type ,
387
376
:'device-orientation' => @device_orientation ,
@@ -397,7 +386,6 @@ def android_capabilities
397
386
def ios_capabilities
398
387
{
399
388
platform : 'OS X 10.9' ,
400
- version : @version ,
401
389
device : @device ,
402
390
name : @app_name || 'Ruby Console iOS Appium' ,
403
391
:'device-orientation' => @device_orientation
@@ -406,7 +394,7 @@ def ios_capabilities
406
394
407
395
# @private
408
396
def capabilities
409
- caps = [ 'iPhone Simulator' , 'iPad Simulator' ] . include? ( @device ) ? ios_capabilities : android_capabilities
397
+ caps = @device . downcase === 'android' ? android_capabilities : ios_capabilities
410
398
caps [ :app ] = self . class . absolute_app_path ( @app_path ) unless @app_path . nil? || @app_path . empty?
411
399
caps
412
400
end
0 commit comments