Created
November 14, 2017 09:12
-
-
Save addywaddy/b91e23cafdd18e721403bfb6528af7f0 to your computer and use it in GitHub Desktop.
Defining download directory for chrome system specs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
RSpec.configure do |config| | |
# ... | |
config.before(:each, type: :system, js: true) do | |
desired_capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |
'chromeOptions' => { | |
'prefs' => { | |
'download.default_directory' => Rails.root.join('spec/downloads'), | |
'download.prompt_for_download' => false, | |
'plugins.plugins_disabled' => ["Chrome PDF Viewer"] | |
} | |
} | |
) | |
driven_by :selenium, using: :chrome, options: { desired_capabilities: desired_capabilities } | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment