Skip to content

Commit

Permalink
When a timeout occurs in wait_for, include the HTML from Selenium in …
Browse files Browse the repository at this point in the history
…the exception
  • Loading branch information
brynary committed Sep 22, 2009
1 parent 8dacd97 commit f51b745
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions History.txt
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion lib/webrat/selenium/selenium_session.rb
Expand Up @@ -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

Expand Down

0 comments on commit f51b745

Please sign in to comment.