diff --git a/History.txt b/History.txt index 2b338d4..0e07a0f 100644 --- a/History.txt +++ b/History.txt @@ -8,6 +8,7 @@ * Bug fixes + * rescue from Webrat::TimeoutError in selenium matchers which allows NegativeMatchers to behave correctly (Noah Davis) * Switch to using selenium.click instead of .check when checking a checkbox (Noah Davis) * Create tmp/pids directory if directory does not exist. (Amos King and Mike Gaffney) diff --git a/lib/webrat/selenium/matchers/have_content.rb b/lib/webrat/selenium/matchers/have_content.rb index 5fa84f6..471493d 100644 --- a/lib/webrat/selenium/matchers/have_content.rb +++ b/lib/webrat/selenium/matchers/have_content.rb @@ -16,6 +16,8 @@ module Webrat response.session.wait_for do response.selenium.is_text_present(text_finder) end + rescue Webrat::TimeoutError + false end # ==== Returns diff --git a/lib/webrat/selenium/matchers/have_selector.rb b/lib/webrat/selenium/matchers/have_selector.rb index f7b394c..884dfdf 100644 --- a/lib/webrat/selenium/matchers/have_selector.rb +++ b/lib/webrat/selenium/matchers/have_selector.rb @@ -10,6 +10,8 @@ module Webrat response.session.wait_for do response.selenium.is_element_present("css=#{@expected}") end + rescue Webrat::TimeoutError + false end # ==== Returns diff --git a/lib/webrat/selenium/matchers/have_xpath.rb b/lib/webrat/selenium/matchers/have_xpath.rb index 40cf9b8..3498a9a 100644 --- a/lib/webrat/selenium/matchers/have_xpath.rb +++ b/lib/webrat/selenium/matchers/have_xpath.rb @@ -10,6 +10,8 @@ module Webrat response.session.wait_for do response.selenium.is_element_present("xpath=#{@expected}") end + rescue Webrat::TimeoutError + false end # ==== Returns