Skip to content

Commit e148f2a

Browse files
Allow custom URL. Fix #84
1 parent 8d6ae78 commit e148f2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/appium_lib/driver.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class Driver
194194
attr_reader :default_wait, :app_path, :app_name, :device,
195195
:app_package, :app_activity, :app_wait_activity,
196196
:sauce_username, :sauce_access_key, :port, :debug,
197-
:export_session, :device_cap, :compress_xml
197+
:export_session, :device_cap, :compress_xml, :custom_url
198198

199199
# The amount to sleep in seconds before every webdriver http call.
200200
attr_accessor :global_webdriver_http_sleep
@@ -234,6 +234,8 @@ def initialize opts={}
234234
# convert to downcased symbols
235235
opts.each_pair { |k,v| opts[k.to_s.downcase.strip.intern] = v }
236236

237+
@custom_url = opts.fetch :server_url, false
238+
237239
@compress_xml = opts[:compress_xml] ? true : false
238240

239241
@export_session = opts.fetch :export_session, false
@@ -399,6 +401,7 @@ def absolute_app_path
399401
# Get the server url for sauce or local based on env vars.
400402
# @return [String] the server url
401403
def server_url
404+
return @custom_url if @custom_url
402405
if !@sauce_username.nil? && !@sauce_access_key.nil?
403406
"http://#{@sauce_username}:#{@sauce_access_key}@ondemand.saucelabs.com:80/wd/hub"
404407
else

0 commit comments

Comments
 (0)