You have a bunch of Watir tests, right? With every build of your application under test, you run them all. If a test fails, application should be fixed, or you test should be fixed. Wouldn't it be nice to make how-to documents from that tests?

Time for an example.

def login_as(username, password)
  ie.should_contain("please login")
  ie.text_field(:id, "username").set(username)
  ie.text_field(:id, "password").set(password)
  ie.button(:value, "login").click
  ie.should_contain("logged in as #{username}")

You run that test, and you get output like this:

How to login?
- go to page
- there should be text "please login"

- enter username at username text field
- enter password at password text field
- click button login

- there should be text "logged in as username"

Has anybody done something like this? I am thinking of doing it, but If somebody has done it already, I would like to take a look.

Wtr-general mailing list

Reply via email to