Skip to content

Instantly share code, notes, and snippets.

@scottwillson
Created May 11, 2020 16:19
Show Gist options
  • Save scottwillson/588a879112449714ba06cf8ddc8b4ccc to your computer and use it in GitHub Desktop.
Save scottwillson/588a879112449714ba06cf8ddc8b4ccc to your computer and use it in GitHub Desktop.
Rails 6 system test download directory
require "test_helper"
# Send downloads to tmp/capybara/downloads so they can be reliably checked and cleaned up
# without polluting ~/Downloads.
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400] do |driver_option|
driver_option.add_preference(
:download,
default_directory: Rails.root.join("tmp/capybara/downloads")
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment