Jeff,
Watir::TestCase executes all def test_ methods sequentially by default now.
Bret has fixed it (thanks)
Just subst Watir::TestCase (which subtypes Test::Unit::TestCase)
like so...

class TC_blaghamuga < Watir::TestCase
def test_zigbat end
def test_junitox end
end

and all def test_ fixtures will run sequentially. (take a look at Watir Rdoc
for Watir::TestCase for more info)

To run TestCases sequentially I just call them individually pulling each out
of the Array hat
testscenario.each {|testcase| TestRunner.run(testcase)}

(which requires some infrastructrue:
require 'test/unit/ui/console/testrunner'
include Test::Unit::UI::Console
)

marekj

On 6/27/07, Jeff Fry <[EMAIL PROTECTED]> wrote:

One option is to have a setup test that you guarantee executes first.
Something like

def test_aaa_setup_environment
  # do initial setup for the upcoming tests
end

You could of course do something similar for teardown like

def test_zzz_teardown_environment
  # do teardown stuff
end

This works because Test::Unit executes tests in alphabetical order...but
there may be more elegant solutions as well. If folks know of them, please
speak up.

One thing I wouldn't recommend in general is to just put the initial steps
in the current first test in your suite. This might be fine but seems
fragile. If something else becomes the new first test, you'll need to copy
code to the new test.

Jeff

On 6/26/07, Manish Sapariya <[EMAIL PROTECTED] > wrote:
>
> Jeff Fry wrote:
> > Happily, setup and teardown are also optional methods for those of us
> > using Watir. If you don't want something to happen automatically at
> > the beginning of every run, don't put it in setup. Likewise with
> > teardown. For functional automation I often don't include these
> > methods at all.
> Thanks Jeff.
> How about the case when I want to setup some environment, but that needs
> to be done only once for a set of test cases.
>
> Regards,
> Manish
> _______________________________________________
> Wtr-general mailing list
> Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>



--
http://testingjeff.wordpress.com
_______________________________________________
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