Re: [Wtr-general] No tests specified

2006-07-31 Thread Max Russell








Hi-



I tried changing the code as suggested:



quote

Test::Unit::TestCase
must have at least one method which name starts with test_.



Change



def centralvision


load 'centralvision.rb'

end



to



def
test_centralvision


load 'centralvision.rb'

end



and you should be fine.



/quote



However, I now get this output-





ruby harness.rb



Loaded suite TestSuite

Started

./test_centralvision.rb:17: warning: parenthesize
argument(s) for future version



EE

Finished in 0.078 seconds.



 1) Error:

test_centralvision(TestSuite):

SyntaxError: ./test_centralvision.rb:17: syntax error

 harness.rb:10:in `load'

 harness.rb:10:in `test_centralvision'



 2) Error:

test_centralvision(TestSuite):

Watir::Exception::NoMatchingWindowFoundException: Unable to
locate a window with

title of Central Vision


c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1208:in `attach_browser_window'


c:/ruby/lib/ruby/site_ruby/1.8/watir.rb::in `attach_init'


c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in `attach'

 harness.rb:14:in `teardown'



1 tests, 0 assertions, 0 failures, 2 errors





I really dont see why it should be getting a Syntax
Error? I still have the same simple test loading up but have changed the def as
suggested.



thanks





Max
Russell

test
Analyst.

InPS



Tel:
01382 223900

Fax:01382
204488



Visit our Web site at www.inps.co.uk



The
information in this internet email is confidential and is intended solely for
the addressee. Access, copying or re-use of information in it by anyone else is
not authorised. Any views or opinions presented are solely those of the author
and do not necessarily represent those of In Practice Systems Limited or any of
its affiliates. If you are not the intended recipient please contact
[EMAIL PROTECTED]








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

[Wtr-general] No tests specified

2006-07-28 Thread Max Russell








Hi-



Ive checked through the Rubyforge mail history but
havent found a solution so far.



Im trying to mimic the scripting101 labs examples,
testing against a web app-



I have 2 files:



harness.rb



# Simple test harness



require 'watir'

require 'test/unit'



$LOAD_PATH  '.'



class TestSuite  Test::Unit::TestCase

 def centralvision

 load 'centralvision.rb'

 end

 def teardown

 ie = Watir::IE.attach(:title, /Central Vision/)

 ie.close

 end

end





and the test Im calling:





# Simple script tests the fields of the Central Vision login
page.





require 'watir'

require 'test/unit/assertions'

include Test::Unit::Assertions



# launch

ie =
Watir::IE.start('http://everestcf/CV_Tay_Test/home/Index.cfm')



# verify the username text entry field

#exists

assert( ie.frame(main).text_field.exists?(:name,
username ))

#is blank

assert( ie.frame(main).text_field. ==
 ))



# verify the password text entry field

#exists

assert( ie.frame(main).text_field.exists?(:name,
password ))

#is blank

assert( ie.frame(main).text_field. ==
 ))



# verify the ldap drop down chooser field

#exists

assert(
ie.frame(main).select_list.exists?(:name, ldapDir))





I modified the $LOAD_PATH variable to say this directory
only (although I dont know if that was necessary.)







Basically every time I run the harness I get the following:



ruby harness.rb



Loaded suite harness

Started

FE

Finished in 0.063 seconds.



 1) Failure:

default_test(TestSuite) [harness.rb:12]:

No tests were specified.



 2) Error:

default_test(TestSuite):

Watir::Exception::NoMatchingWindowFoundException: Unable to
locate a window with

title of (?-mix:Central Vision)

 c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1208:in
`attach_browser_window'

 c:/ruby/lib/ruby/site_ruby/1.8/watir.rb::in
`attach_init'

 c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in `attach'

 harness.rb:13:in `teardown'



1 tests, 1 assertions, 1 failures, 1 errors





Im really getting confused with this now, Ive
tried to keep my code as simple as possible, but cant see where Im
going wrong?



Any help is much appreciated.



thanks





Max
Russell

test
Analyst.

InPS



Tel:
01382 223900

Fax:01382
204488



Visit our Web site at www.inps.co.uk



The
information in this internet email is confidential and is intended solely for
the addressee. Access, copying or re-use of information in it by anyone else is
not authorised. Any views or opinions presented are solely those of the author
and do not necessarily represent those of In Practice Systems Limited or any of
its affiliates. If you are not the intended recipient please contact
[EMAIL PROTECTED]








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

Re: [Wtr-general] No tests specified

2006-07-28 Thread Zeljko Filipin
Test::Unit::TestCase must have at least one method which name starts with test_.Changedef centralvision
 load 'centralvision.rb'endto def test_centralvision load 'centralvision.rb'endand you should be fine.Ċ½eljko
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general