Question

I'm an avid TDD and BDD fan but haven't done much in the ways of UI testing. I have an ASP.NET MVC 3 application with many MSpec tests and I'd like to add presentation tests using WatiN.

What sort of stuff do you test? Do I have to write tests for the initial load of the UI or only for things that changed due to user interaction?

What are, in short, good rules of thumb and best practices when writing WatiN (and UI tests in general) tests?

Was it helpful?

Solution

Where I work now, we test these 5 things (where applicable) for each page:

  1. Layout - should have textbox labeled X, should have dropdown labeled X
  2. Populate - should have dropdown with the following values ... should have textbox with the value
  3. Validate - when I enter X, then I should see the error message Y
  4. Navigate - when I click X button, then I should go to Y page
  5. Save - when I click save button, then I should see the Success message

OTHER TIPS

Ideally, UI Testing (Automation) involves automating everything that you can :)

I am sure you have Functional Test Cases. Each of those test cases can be automated. If you take the example of this site itself, I can think of the following scenarios: 1. Registration - Verify you have all the fields listed (are mandatory, validated) - Duplicate accounts cannot be created 2. Confirm Registration

Basically, everything that you can do manually is a target candidate for Automation. We have about 1500 Test Cases for our app and 90% is automated. Manual Testing is used to visually verify the screens. The cosmetic checks can be ignored in Automation.

Hope this helps. Thanks, K

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top