Skip to content

Instantly share code, notes, and snippets.

@addywaddy
Created November 14, 2017 09:12
Show Gist options
  • Save addywaddy/b91e23cafdd18e721403bfb6528af7f0 to your computer and use it in GitHub Desktop.
Save addywaddy/b91e23cafdd18e721403bfb6528af7f0 to your computer and use it in GitHub Desktop.
Defining download directory for chrome system specs
# ...
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