Skip to content

Commit 613207c

Browse files
committed
[rb] allow updating service state
1 parent 4a30da6 commit 613207c

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

rb/lib/selenium/webdriver/common/service.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def driver_path=(path)
5656
end
5757
end
5858

59-
attr_accessor :host
60-
attr_reader :executable_path, :port, :extra_args
59+
attr_accessor :host, :executable_path, :port, :args
60+
alias_method :extra_args, :args
6161

6262
#
6363
# End users should use a class method for the desired driver, rather than using this directly.
@@ -74,7 +74,7 @@ def initialize(path: nil, port: nil, args: nil)
7474
@host = Platform.localhost
7575
@port = Integer(port)
7676

77-
@extra_args = args.is_a?(Hash) ? extract_service_args(args) : args
77+
@args = args.is_a?(Hash) ? extract_service_args(args) : args
7878

7979
raise Error::WebDriverError, "invalid port: #{@port}" if @port < 1
8080
end

rb/lib/selenium/webdriver/common/service_manager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def initialize(config)
4040
@executable_path = config.executable_path
4141
@host = Platform.localhost
4242
@port = config.port
43-
@extra_args = config.extra_args
43+
@extra_args = config.args
4444
@shutdown_supported = config.shutdown_supported
4545

4646
raise Error::WebDriverError, "invalid port: #{@port}" if @port < 1

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ def ie_options(**opts)
205205

206206
def chrome_driver(options: nil, **opts)
207207
service_opts = {}
208-
service_opts[:args] = ['--disable-build-check'] if ENV['DISABLE_BUILD_CHECK']
208+
service_opts[:args] = []
209+
service_opts[:args] << '--disable-build-check' if ENV['DISABLE_BUILD_CHECK']
210+
service_opts[:args] << '--verbose' if WebDriver.logger.level == :debug
209211
service = WebDriver::Service.chrome(**service_opts)
210212
WebDriver::Driver.for(:chrome, options: options, service: service, **opts)
211213
end
@@ -218,7 +220,9 @@ def chrome_options(**opts)
218220

219221
def edge_driver(options: nil, **opts)
220222
service_opts = {}
221-
service_opts[:args] = ['--disable-build-check'] if ENV['DISABLE_BUILD_CHECK']
223+
service_opts[:args] = []
224+
service_opts[:args] << '--disable-build-check' if ENV['DISABLE_BUILD_CHECK']
225+
service_opts[:args] << '--verbose' if WebDriver.logger.level == :debug
222226
service = WebDriver::Service.edge(**service_opts)
223227
WebDriver::Driver.for(:edge, options: options, service: service, **opts)
224228
end

0 commit comments

Comments
 (0)