From 68d5fde17a09da3916c67a7b787290c4280b8f15 Mon Sep 17 00:00:00 2001 From: Noah Davis Date: Tue, 20 Apr 2010 11:42:42 -0400 Subject: [PATCH] Move verbose selenium output that can clutter build output behind setting --- History.txt | 1 + lib/webrat/core/configuration.rb | 5 +++++ lib/webrat/selenium/selenium_session.rb | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/History.txt b/History.txt index 3dc5930..7cec49d 100644 --- a/History.txt +++ b/History.txt @@ -2,6 +2,7 @@ * Minor enhancements + * Move verbose selenium output that can clutter build output behind setting * Added application_port_for_selenium to webrat configuration. The use case is when you want to test through a web server sitting in front of your application server. (Luke Melia) * New webrat configuration option selenium_firefox_profile which is passed to selenium server diff --git a/lib/webrat/core/configuration.rb b/lib/webrat/core/configuration.rb index 4e5bd9e..4e46a67 100755 --- a/lib/webrat/core/configuration.rb +++ b/lib/webrat/core/configuration.rb @@ -72,6 +72,10 @@ module Webrat # loop? Defaults to 10 attr_accessor :infinite_redirect_limit + # Print out the full HTML on wait failure + # Defaults to false + attr_accessor :selenium_verbose_output + def initialize # :nodoc: self.open_error_files = true self.application_environment = :test @@ -82,6 +86,7 @@ module Webrat self.infinite_redirect_limit = 10 self.selenium_browser_key = '*firefox' self.selenium_browser_startup_timeout = 5 + self.selenium_verbose_output = false tmp_dir = Pathname.new(Dir.pwd).join("tmp") self.saved_pages_dir = tmp_dir.exist? ? tmp_dir : Dir.pwd diff --git a/lib/webrat/selenium/selenium_session.rb b/lib/webrat/selenium/selenium_session.rb index e696b3a..e04eb6c 100644 --- a/lib/webrat/selenium/selenium_session.rb +++ b/lib/webrat/selenium/selenium_session.rb @@ -175,8 +175,8 @@ module Webrat end error_message = "#{message} (after #{timeout} sec)" - - if $browser + + if $browser && Webrat.configuration.selenium_verbose_output error_message += <<-EOS