diff --git a/spec/selenium_spec_chrome.rb b/spec/selenium_spec_chrome.rb index 5a8772c6..efdecba6 100644 --- a/spec/selenium_spec_chrome.rb +++ b/spec/selenium_spec_chrome.rb @@ -13,13 +13,7 @@ CHROME_DRIVER = ENV['HEADLESS'] ? :selenium_chrome_headless : :selenium_chrome Capybara.register_driver :selenium_chrome do |app| driver = Capybara::Selenium::Driver.new(app, browser: :chrome) - # TODO: Fix this when selenium with `download_path =` support is released - bridge = driver.browser.send(:bridge) - params = { cmd: 'Page.setDownloadBehavior', params: { behavior: 'allow', downloadPath: Capybara.save_path } } - command = +'/session/:session_id/chromium/send_command' - command[':session_id'] = bridge.session_id - bridge.http.call(:post, command, params) - + driver.browser.download_path = Capybara.save_path driver end @@ -28,14 +22,7 @@ Capybara.register_driver :selenium_chrome_headless do |app| browser_options.args << '--headless' browser_options.args << '--disable-gpu' if Gem.win_platform? driver = Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options) - - # TODO: Fix this when selenium with `download_path =` support is released - bridge = driver.browser.send(:bridge) - params = { cmd: 'Page.setDownloadBehavior', params: { behavior: 'allow', downloadPath: Capybara.save_path } } - command = +'/session/:session_id/chromium/send_command' - command[':session_id'] = bridge.session_id - bridge.http.call(:post, command, params) - + driver.browser.download_path = Capybara.save_path driver end