DRY downloads directory path

This commit is contained in:
Pau Perez
2021-03-09 16:22:24 +01:00
parent 0e4f9d18d4
commit a5fbd6bb57

View File

@@ -59,11 +59,11 @@ Capybara.register_driver :chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new(
args: %w[headless disable-gpu no-sandbox window-size=1280,768]
)
options.add_preference(:download, default_directory: Rails.root.join("tmp", "downloads").to_s)
options.add_preference(:download, default_directory: DownloadsHelper.path.to_s)
Capybara::Selenium::Driver
.new(app, browser: :chrome, options: options)
.tap { |driver| driver.browser.download_path = Rails.root.join("tmp", "downloads").to_s }
.tap { |driver| driver.browser.download_path = DownloadsHelper.path.to_s }
end
Capybara.default_max_wait_time = 30