Create a gist now

Instantly share code, notes, and snippets.

Capybara::Driver::Selenium.class_eval do
class << self
alias old_driver driver
if false
# override firefox driver in favor of selenium
def driver
@driver ||= begin
driver = Selenium::WebDriver.for :chrome
at_exit { driver.quit }
driver
end
end
else
# fix running Firefox while offline
# http://groups.google.com/group/ruby-capybara/browse_thread/thread/c012c73aa3ee86
def driver
@driver ||= begin
profile = Selenium::WebDriver::Firefox::Profile.new
profile['network.manage-offline-status'] = false
driver = Selenium::WebDriver.for :firefox, :profile => profile
at_exit { driver.quit }
driver
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment