From 9b3fc3606afb0d379b5d4d8cbc405d8fa9ddc60c Mon Sep 17 00:00:00 2001 From: Alex Rodionov Date: Fri, 26 Apr 2024 07:04:03 -0700 Subject: [PATCH] Use service builder for DriverFinder --- examples/ruby/spec/browsers/chrome_spec.rb | 3 ++- examples/ruby/spec/browsers/edge_spec.rb | 3 ++- examples/ruby/spec/browsers/firefox_spec.rb | 3 ++- examples/ruby/spec/drivers/service_spec.rb | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/ruby/spec/browsers/chrome_spec.rb b/examples/ruby/spec/browsers/chrome_spec.rb index 69f054fdcc3e..fca80b5f85bc 100644 --- a/examples/ruby/spec/browsers/chrome_spec.rb +++ b/examples/ruby/spec/browsers/chrome_spec.rb @@ -115,7 +115,8 @@ def driver_finder options = Selenium::WebDriver::Options.chrome(browser_version: 'stable') - finder = Selenium::WebDriver::DriverFinder.new(options, Selenium::WebDriver::Chrome::Service.new) + service = Selenium::WebDriver::Service.chrome + finder = Selenium::WebDriver::DriverFinder.new(options, service) ENV['CHROMEDRIVER_BIN'] = finder.driver_path ENV['CHROME_BIN'] = finder.browser_path end diff --git a/examples/ruby/spec/browsers/edge_spec.rb b/examples/ruby/spec/browsers/edge_spec.rb index f89f0f99b615..67ca03624906 100644 --- a/examples/ruby/spec/browsers/edge_spec.rb +++ b/examples/ruby/spec/browsers/edge_spec.rb @@ -115,7 +115,8 @@ def driver_finder options = Selenium::WebDriver::Options.edge(browser_version: 'stable') - finder = Selenium::WebDriver::DriverFinder.new(options, Selenium::WebDriver::Edge::Service.new) + service = Selenium::WebDriver::Service.edge + finder = Selenium::WebDriver::DriverFinder.new(options, service) ENV['EDGEDRIVER_BIN'] = finder.driver_path ENV['EDGE_BIN'] = finder.browser_path end diff --git a/examples/ruby/spec/browsers/firefox_spec.rb b/examples/ruby/spec/browsers/firefox_spec.rb index 0e5b0e6094c8..ed4ef3df483e 100644 --- a/examples/ruby/spec/browsers/firefox_spec.rb +++ b/examples/ruby/spec/browsers/firefox_spec.rb @@ -122,7 +122,8 @@ def driver_finder options = Selenium::WebDriver::Options.firefox(browser_version: 'stable') - finder = Selenium::WebDriver::DriverFinder.new(options, Selenium::WebDriver::Firefox::Service.new) + service = Selenium::WebDriver::Service.firefox + finder = Selenium::WebDriver::DriverFinder.new(options, service) ENV['GECKODRIVER_BIN'] = finder.driver_path ENV['FIREFOX_BIN'] = finder.browser_path end diff --git a/examples/ruby/spec/drivers/service_spec.rb b/examples/ruby/spec/drivers/service_spec.rb index 05c97904cf30..c9d45a05a83f 100644 --- a/examples/ruby/spec/drivers/service_spec.rb +++ b/examples/ruby/spec/drivers/service_spec.rb @@ -33,7 +33,8 @@ def driver_finder options = Selenium::WebDriver::Options.chrome(browser_version: 'stable') - finder = Selenium::WebDriver::DriverFinder.new(options, Selenium::WebDriver::Chrome::Service.new) + service = Selenium::WebDriver::Service.chrome + finder = Selenium::WebDriver::DriverFinder.new(options, service) ENV['CHROMEDRIVER_BIN'] = finder.driver_path ENV['CHROME_BIN'] = finder.browser_path end