Skip to content

Instantly share code, notes, and snippets.

@rilian
Created January 25, 2016 14:15
Show Gist options
  • Save rilian/06d9111365a2f4242f58 to your computer and use it in GitHub Desktop.
Save rilian/06d9111365a2f4242f58 to your computer and use it in GitHub Desktop.
capybara.rb
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(
app,
phantomjs_logger: File.open("#{Rails.root}/log/test_phantomjs.log", 'a'),
timeout: 30,
window_size: [1536, 1024],
phantomjs_options: [
'--load-images=no',
'--ignore-ssl-errors=yes',
'--disk-cache=true'
]
)
end
Capybara.javascript_driver = :poltergeist # :selenium
Capybara.default_max_wait_time = 10
Capybara.save_and_open_page_path = '/tmp'
Capybara::Screenshot.prune_strategy = :keep_last_run
RSpec.configure do |config|
config.include Warden::Test::Helpers
config.before(:suite) { Warden.test_mode! }
config.after(:each) { Warden.test_reset! }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment