Permalink
Browse files

default to focusmanager.testmode=true in Firefox profile

  • Loading branch information...
twalpole committed Feb 4, 2013
1 parent 8368069 commit 39778eddf0428822a3a17f1b5f8a85e862fcac93
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/capybara/selenium/driver.rb
@@ -4,13 +4,19 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
DEFAULT_OPTIONS = {
:browser => :firefox
}
+ DEFAULT_BROWSER_OPTIONS = {
+ :firefox => {
+ :profile=> Selenium::WebDriver::Firefox::Profile.new.tap { |pr| pr["focusmanager.testmode"] = true }
+ }
+ }
SPECIAL_OPTIONS = [:browser]
attr_reader :app, :options
def browser
unless @browser
- @browser = Selenium::WebDriver.for(options[:browser], options.reject { |key,val| SPECIAL_OPTIONS.include?(key) })
+ browser_options=DEFAULT_BROWSER_OPTIONS[options[:browser]].merge(options)
+ @browser = Selenium::WebDriver.for(options[:browser], browser_options.reject { |key,val| SPECIAL_OPTIONS.include?(key) })
main = Process.pid
at_exit do

0 comments on commit 39778ed

Please sign in to comment.