Skip to content

Commit

Permalink
Move persistent client require to where it's used
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Mar 30, 2019
1 parent 027789e commit 16da214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/selenium/driver.rb
Expand Up @@ -16,7 +16,6 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base

def self.load_selenium
require 'selenium-webdriver'
require 'capybara/selenium/patches/persistent_client'
warn "Warning: You're using an unsupported version of selenium-webdriver, please upgrade." if Gem.loaded_specs['selenium-webdriver'].version < Gem::Version.new('3.5.0')
rescue LoadError => err
raise err if err.message !~ /selenium-webdriver/
Expand All @@ -27,6 +26,7 @@ def self.load_selenium
def browser
@browser ||= begin
options[:http_client] ||= begin
require 'capybara/selenium/patches/persistent_client'
if options[:timeout]
::Capybara::Selenium::PersistentClient.new(read_timeout: options[:timeout])
else
Expand Down

0 comments on commit 16da214

Please sign in to comment.