OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/support/capybara.rb

36 lines
1023 B

require 'capybara/rspec'
require 'rack_session_access/capybara'
RSpec.configure do
Capybara.default_max_wait_time = 4
Capybara.javascript_driver = :selenium
end
Rails.application.config do
config.middleware.use RackSessionAccess::Middleware
end
Capybara.register_driver :selenium do |app|
require 'selenium/webdriver'
Selenium::WebDriver::Firefox::Binary.path = ENV['FIREFOX_BINARY_PATH'] ||
Selenium::WebDriver::Firefox::Binary.path
capabilities = Selenium::WebDriver::Remote::Capabilities.internet_explorer
capabilities["elementScrollBehavior"] = 1
profile = Selenium::WebDriver::Firefox::Profile.new
profile['intl.accept_languages'] = 'en'
profile['browser.download.dir'] = DownloadedFile::PATH.to_s
profile['browser.download.folderList'] = 2
profile['browser.helperApps.neverAsk.saveToDisk'] = 'text/csv'
Capybara::Selenium::Driver.new(
app,
browser: :firefox,
profile: profile,
desired_capabilities: capabilities
)
end