Re: [Wtr-general] Grouping Test Cases
You're welcome :) Date: Mon, 13 Nov 2006 13:12:23 -0800 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; wtr-general@rubyforge.org Subject: Re: [Wtr-general] Grouping Test Cases I figured this out...after a colleague pointed me at Andy Sipe's blog: http://zbarzone.blogspot.com/2006/04/getting-xml-test-results-from-rails _06.html the relevant code I needed to add: require 'test/unit/collector/objectspace' #replace class def for the suite with one line suite = Test::Unit::Collector::ObjectSpace.new().collect() #generate the output Test::Unit::UI::Reporter.run(suite, 'C:/TestOutput/Sample') Thanks to Andy! -Dara -Original Message- From: Lillis, Dara Sent: Monday, November 13, 2006 2:01 PM To: 'wtr-general@rubyforge.org' Subject: RE: [Wtr-general] Grouping Test Cases . ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Grouping Test Cases
I figured this out...after a colleague pointed me at Andy Sipe's blog: http://zbarzone.blogspot.com/2006/04/getting-xml-test-results-from-rails _06.html the relevant code I needed to add: require 'test/unit/collector/objectspace' #replace class def for the suite with one line suite = Test::Unit::Collector::ObjectSpace.new().collect() #generate the output Test::Unit::UI::Reporter.run(suite, 'C:/TestOutput/Sample') Thanks to Andy! -Dara -Original Message- From: Lillis, Dara Sent: Monday, November 13, 2006 2:01 PM To: 'wtr-general@rubyforge.org' Subject: RE: [Wtr-general] Grouping Test Cases [resurrecting an old thread] the code Chris supplies below is useful in that I can use it to run all tests in a given directory. I've been struggling with how to package these tests into suites so I can produce output with Test::Unit::Reporter That is, I want to replace code like this with something more general: require 'test/unit/ui/console/testrunner' require 'test/unit/ui/reporter' require 'TC_TestCase' class TS_Suite def self.suite suite = Test::Unit::TestSuite.new('A Test Suite') suite TC_TestCase.suite return suite end end Test::Unit::UI::Reporter.run(TS_Suite, 'C:/TestOutput/Sample') Any ideas? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon Sent: Wednesday, May 24, 2006 12:51 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Grouping Test Cases On 5/24/06, Adrian Rutter [EMAIL PROTECTED] wrote: Could anyone tell me how they are grouping test cases and running suites within Watir? #run_suite.rb topdir = File.join(File.dirname(__FILE__)) Dir.chdir topdir do tests = Dir[test*] tests.each{|x| require x} end ___ 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
[Wtr-general] Grouping Test Cases
Could anyone tell me how they are grouping test cases and running suites within Watir? Thanks Aidy --- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --- ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Grouping Test Cases
The way I had been going about it: TestSuite Requires testcase_classes, is the master test script. Testcase_classes are classes containing individual testcases class TestClass Test::Unit::TestCase Test cases are methods with names like: test_xx_description I just run the TestSuite and it runs all the tests in each class. I named the classes based on each module of the app I'm testing, the tests are named by what they are checking for. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon Sent: Wednesday, May 24, 2006 11:51 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Grouping Test Cases On 5/24/06, Adrian Rutter [EMAIL PROTECTED] wrote: Could anyone tell me how they are grouping test cases and running suites within Watir? #run_suite.rb topdir = File.join(File.dirname(__FILE__)) Dir.chdir topdir do tests = Dir[test*] tests.each{|x| require x} end ___ 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