Hello,
I apologize for my confusion yet again, but I hope this will be a simple answer
for someone...
I have written a script that asserts whether labels on a page exist or not.
Here is a small snippet of code to serve as an example:
class TC_banking_info_labels < Test::Unit::TestCase
include Watir
def test_bank_name
assert($ie.span(:text, "bank name").exists?)
$logger.log(" FOUND! Banking Information: 'Bank Name' field...")
end
end
I have discovered that the order of operation within the class is alphabetical.
(method test_a* will execute before test_z*). My problem is that I have a
teardown script located in another file. I can access the methods in the files
just fine by accessing them directly. For example by typing in:
$close_logger
$close_browser
The problem with that is that my teardown methods/variables get executed before
my Test::Unit::TestCase classes/methods which causes my browser to close before
my tests are executed, which causes all 66 of my tests to fail.
Here are the contents of my teardown.rb script:
require 'watir'
#includes for using logger
require 'example_logger1'
$close_logger = $logger.log("## Testing Complete ##")
$close_browser = $ie.close
My question is: How can I call this teardown script into my test script and
have it executed LAST. How do I control the order in which methods are executed?
As always, thank you for your help. I have been researching quite a bit about
methods & classes, etc...but there is still a disconnect somewhere...and I am
stuck.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general