Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…the exception
  • Loading branch information...
commit f51b745e89b316f06cecf19afeccc5475419b92e 1 parent 8dacd97
@brynary brynary authored
Showing with 14 additions and 1 deletion.
  1. +1 −0  History.txt
  2. +13 −1 lib/webrat/selenium/selenium_session.rb
View
1  History.txt
@@ -12,6 +12,7 @@ CHANGED: Due to a reorganization, if you're currently requiring "webrat/rspec-ra
* 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)
* Support multiple select fields (Kieran P)
* When locating select options, always match against text, not HTML
View
14 lib/webrat/selenium/selenium_session.rb
@@ -169,7 +169,19 @@ def wait_for(params={})
sleep 0.25
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
end
Please sign in to comment.
Something went wrong with that request. Please try again.