Skip to content

Commit

Permalink
Use service builder for DriverFinder
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Apr 26, 2024
1 parent bf24f19 commit 9b3fc36
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/ruby/spec/browsers/chrome_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/ruby/spec/browsers/edge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/ruby/spec/browsers/firefox_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/ruby/spec/drivers/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b3fc36

Please sign in to comment.