WatiN best practices/rules of thumb for an ASP.NET MVC app [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
开发者_运维技巧Improve this questionI'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?
Where I work now, we test these 5 things (where applicable) for each page:
- Layout - should have textbox labeled X, should have dropdown labeled X
- Populate - should have dropdown with the following values ... should have textbox with the value
- Validate - when I enter X, then I should see the error message Y
- Navigate - when I click X button, then I should go to Y page
- Save - when I click save button, then I should see the Success message
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
精彩评论