My "due diligence" has been rather sketchy -- just trying a couple of
listserv queries and skimming the User Guide for the first time in a
while -- so if this is answered elsewhere feel free to gently rebuke
me and point me in that direction. :)

I'll seize on a simple example of something I'm working on to
illustrate a bigger best practices question.   I'm writing some tests
for a client's installation of Sendcard <http://sendcard.org>.
Obviously it would be desirable to keep knowledge of the "guts" of the
GUI separate from my high-level tests.   In other words, details like
the form to send a card having the following inputs:

- Text field with name "to[0]"
- Text field with name "to_email[0]"
- Text field with name "from"
- Text field with name "from_email"
...
- Submit button with name "preview"

don't belong in high-level test code.

But where do they belong?   I would imagine that somewhere some class
should have a method send_card that takes a card object, and that card
object should contain all this constituent data.

When I sit down to implement this my perfectionism gets all caught up
in questions like, "Do I need a separate class for my client's
specific site and another for the Sendcard
UI in general?" (so that other sendcard sites can easily reuse the
same code) or stuff like that.

Anyway, I guess I just need some examples of best practices for
setting up Watir tests to on an object level of abstraction.    The
unit tests appear to have all the input names embedded in the test
code which is certainly simpler and probably OK for a test, but it
strikes me as unneccessarily coupling the UI and the tests.

This internal argument with myself over how best to implement Watir
has caused me to use Watir less than I intend to.  :)

-- 
Philip Reed, Web developer

http://philipreedtech.com

Web.  Made simple.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to