Tiffany,

If you want to dig a little into the Watir internals, you can do this easily enough. Find the Watir method(s) that produce the output for the tests. Then override those methods (just use copy/paste) in your own custom module of the same name. Then in your copied method, change the "puts" (or whatever it happens to be) to output the resluts any way you want. Put your module somewhere in an accessible directory (/lib is a good place), and 'require' it either in your controller(s), or in application.rb if you want all controllers to see it.

I realize that was a pretty generic explanation, but it is not as difficult as it sounds. But it is best to override the methods in question rather than editing the existing Watir code.

The only problem might be if each test did its own output. That would not be very DRY, and you would have a lot to override. I haven't looked at it, but I doubt that is the case.

Lonny Eachus
============

Subject:
[Wtr-general] Reporting suggestions?
From:
Tiffany Fodor <[EMAIL PROTECTED]>
Date:
Fri, 06 Jul 2007 11:19:47 CDT
To:
wtr-general@rubyforge.org
To:
wtr-general@rubyforge.org

Hi all!

I'm trying to determine the best way to collect the results of my tests.  I'm using Test::Unit methods for my harness and will have about 15-20 data-driven tests that get information from an excel spreadsheet for use in each test.

I have lots of 'verify' statements that check various conditions and post messages for failed conditions as well as progress statements I generate with simple 'puts' commands.  

Ideally, I'd like all of the results ('puts' statements as well as the Test::Unit results) to be echoed to the command prompt and copied to a log file. I can't find a good way to do this other than copy/paste.  I could write any 'puts' statements to a file as well as the command prompt, but I'm not sure how to capture the Test::Unit results.  I did a web search and the only real answer I found on capturing command line output with Ruby was "don't".

Any suggestions would be appreciated!

Thanks!

-Tiffany

  

_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to