From 8d5a7e18ad65d100092d08fbd8bf768b6da256ab Mon Sep 17 00:00:00 2001 From: Jonas Nicklas Date: Wed, 30 Mar 2016 20:27:29 +0200 Subject: [PATCH] Leave it up to the driver to make sure that resetting is synchronous I think that this was a futile attempt to resolve problems with restting sessions which should be much better handled by the addition of `wait_for_pending_requests`. Closes #1670 --- lib/capybara/driver/base.rb | 8 ++------ lib/capybara/rack_test/driver.rb | 10 +++------- lib/capybara/selenium/driver.rb | 4 ---- lib/capybara/session.rb | 1 - 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/lib/capybara/driver/base.rb b/lib/capybara/driver/base.rb index dd2b037b..ad214b1c 100644 --- a/lib/capybara/driver/base.rb +++ b/lib/capybara/driver/base.rb @@ -91,8 +91,8 @@ class Capybara::Driver::Base def no_such_window_error raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#no_such_window_error' end - - + + ## # # Execute the block, and then accept the modal opened. @@ -134,8 +134,4 @@ class Capybara::Driver::Base def needs_server? false end - - def browser_initialized? - true - end end diff --git a/lib/capybara/rack_test/driver.rb b/lib/capybara/rack_test/driver.rb index 18622512..5d655321 100644 --- a/lib/capybara/rack_test/driver.rb +++ b/lib/capybara/rack_test/driver.rb @@ -66,11 +66,11 @@ class Capybara::RackTest::Driver < Capybara::Driver::Base def find_xpath(selector) browser.find(:xpath, selector) end - + def find_css(selector) browser.find(:css,selector) end - + def html browser.html end @@ -78,7 +78,7 @@ class Capybara::RackTest::Driver < Capybara::Driver::Base def dom browser.dom end - + def title browser.title end @@ -87,10 +87,6 @@ class Capybara::RackTest::Driver < Capybara::Driver::Base @browser = nil end - def browser_initialized? - !@browser.nil? - end - def get(*args, &block); browser.get(*args, &block); end def post(*args, &block); browser.post(*args, &block); end def put(*args, &block); browser.put(*args, &block); end diff --git a/lib/capybara/selenium/driver.rb b/lib/capybara/selenium/driver.rb index b8d69387..03f302c0 100644 --- a/lib/capybara/selenium/driver.rb +++ b/lib/capybara/selenium/driver.rb @@ -248,10 +248,6 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base Selenium::WebDriver::Error::NoSuchWindowError end - def browser_initialized? - !@browser.nil? - end - private def within_given_window(handle) diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb index 906dc2e8..91d93198 100644 --- a/lib/capybara/session.rb +++ b/lib/capybara/session.rb @@ -107,7 +107,6 @@ module Capybara def reset! if @touched driver.reset! - assert_no_selector :xpath, "/html/body/*" if driver.browser_initialized? @touched = false end @server.wait_for_pending_requests if @server