Skip to content

Commit 347e81e

Browse files
Support all appium caps
1 parent 833209e commit 347e81e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lib/appium_lib/driver.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ def initialize opts={}
254254
opts.each_pair { |k,v| tmp_opts[k.to_s.downcase.strip.intern] = v }
255255
opts = tmp_opts
256256

257+
@raw_capabilities = opts.fetch(:raw, {})
258+
257259
@custom_url = opts.fetch :server_url, false
258260

259261
@compress_xml = opts[:compress_xml] ? true : false
@@ -398,8 +400,7 @@ def android_capabilities
398400
:'app-package' => @app_package,
399401
:'app-activity' => @app_activity,
400402
:'app-wait-activity' => @app_wait_activity || @app_activity,
401-
fastClear: @fast_clear
402-
}.merge(@android_coverage)
403+
}.merge(@android_coverage).merge(@raw_capabilities)
403404
end
404405

405406
# @private
@@ -411,7 +412,7 @@ def ios_capabilities
411412
device: @device,
412413
name: @app_name || 'Ruby Console iOS Appium',
413414
:'device-orientation' => @device_orientation
414-
}
415+
}.merge(@raw_capabilities)
415416
end
416417

417418
# @private

readme.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ require 'rubygems'
3535
require 'appium_lib'
3636

3737
# Start iOS driver
38-
app = { device: :ios, app_path: '/path/to/MyiOS.app'}
39-
Appium::Driver.new(app).start_driver
38+
39+
# use appium's specific capability names
40+
appium_capabilities = { launchTimeout: 123 }
41+
# there are also built in capabilities such as device that don't require 'raw'
42+
caps = { device: :ios, app_path: '/Users/user/woven/ruby_lib_ios/UICatalog.app', raw: appium_capabilities }
43+
Appium::Driver.new(caps).start_driver
4044

4145
# Start Android driver
4246
apk = {

0 commit comments

Comments
 (0)