When a timeout occurs in wait_for, include the HTML from Selenium in the exception

This commit is contained in:
Bryan Helmkamp 2009-09-22 15:23:49 -04:00
parent 8dacd973aa
commit f51b745e89
2 changed files with 14 additions and 1 deletions

View File

@ -12,6 +12,7 @@ CHANGED: Due to a reorganization, if you're currently requiring "webrat/rspec-ra
* Minor enhancements * Minor enhancements
* When a timeout occurs in wait_for, include the HTML from Selenium in the exception
* Update the Merb support to be based directly on Rack (Simon Rozet) * Update the Merb support to be based directly on Rack (Simon Rozet)
* Support multiple select fields (Kieran P) * Support multiple select fields (Kieran P)
* When locating select options, always match against text, not HTML * When locating select options, always match against text, not HTML

View File

@ -169,7 +169,19 @@ module Webrat
sleep 0.25 sleep 0.25
end end
raise Webrat::TimeoutError.new(message + " (after #{timeout} sec)") error_message = "#{message} (after #{timeout} sec)"
if $browser
error_message += <<-EOS
HTML of the page was:
#{selenium.get_html_source}"
EOS
end
raise Webrat::TimeoutError.new(error_message)
true true
end end