Also, you'll need to require the test file (with a relative path, if
it's not in the same directory):

require 'test'

In case it helps, I've posted an example of a simple Test::Unit
framework on the examples page.

http://tinyurl.com/yjrrj5a

-Tiffany

On Nov 13, 4:03 pm, Ethan <notet...@gmail.com> wrote:
> The method in the Test::Unit::TestCase subclass needs to start with 'test',
> which 'my_TestCase' does not.
>
> On Fri, Nov 13, 2009 at 16:45, tester86 <sagar.am...@gmail.com> wrote:
>
> > I have one file called test.rb which contains:
>
> > require 'Watir'
>
> > def test_text_verfication
>
> >         ie=Watir::IE.start("go to url")
>
> >         sleep 5
>
> >         if ie.text.include? "User Login"
>
> >                puts " at login page"
>
> >                else
>
> >                puts " not at login page"
>
> >          end
>
> >        end
>
> > The Main file where I want to call that def (test case) and execute it
> > via command line in dos prompt:
>
> > file name: testfile.rb
>
> > require 'test/unit'
> > require 'watir'
> > require 'watir/testcase'
>
> > class MyTest < Test::Unit::TestCase
>
> >        def my_TestCase()
> >                test_text_verfication()
> >        end
>
> > end
>
> > When I run my test case I get the following output:
>
> > default_test(MyTest) [final.rb:18]:
> > No tests were specified.
>
> > 1 tests, 1 assertions, 1 failures, 0 errors
>
> > My question is if I have a sepearte file that contains all the def
> > test cases in class how do I call the def test cases?
>
> > Thanks,
>
> > tester86
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to