+1
I, too, am scared when I hear the 'A' word applied to something as
simple as an automated test suite :)
Having said that, there is certain amount of design that can go into a
test suite before you start writing it.
So, how about turning the conversation in a direction like this:
GENERAL GUIDELINES FOR ORGANISING A SUITE OF WATIR TESTS
-------------------------------
Organize the tests as a Test::Unit suite. Start with a single
Test::Unit:TestCase class in a single file, split it into smaller
logical pieces when it becomes too big (around 1000 lines).
As soon as you have to repeat the same code twice, think about
extracting a method. Certainly extract a method from anything that is
repeated three times.
Expect at least the following helper classes (or modules) to evolve:
* URL generator, to extract things like ie.goto url_for('AccountView',
:account_id => 1, :billing_month => '2005-11')
* GUI navigator, to extract things like logon(:user => 'tester',
:password => '12345') )
* custom assertions, for methods like assert_current_account_is_active
Your real tests will probably have to talk to the database, to test
assertions about things that are hard or impossible to access through
the GUI, to generate expected results, to manage initial state of the
database before the test, etc. This often means that you need something
quite similar to domain and data access layers. It will probably be much
simpler than the production domain, but the same design principles
generally apply. Resist the temptation to reuse the production domain
layer (you don't want your test oracles to share implementation with the
system under test). Production data access layer, on the other hand, is OK.
Test results may need to be published and/or reported. Roll your own, or
use http://rubyforge.org/projects/test-report/ It is not currently
supported by anybody, but I've heard some people were still using it.
After all, it's merely a few hundred lines of Ruby :)
Other than reporting along the lines of "TestAccountView => PASS/FAIL",
don't try to make contents of Watir tests accessible to non-programmers.
It proves counter-productive. If you need automated tests that business
can understand, use FIT and test the domain logic with it.
...
Beg pardon if I'm answering a wrong question here :) But I'd like to
hear what other people do.
Alexey Verkhovsky
Jonathan Kohl wrote:
>+1
>
>
>>-----Original Message-----
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
>>
>>
>>start solving problems; refactor; repeat; don't worry
>>about architecture so much as you worry about solving the immediate
>>problem-- your architecture will grow as your ability to
>>solve problems does.
>>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general