I strongly support software testing. If you don't produce test cases that cover the requirements you implement, then you are not developing anything. It is impossible to reach sustainability, produce new functionality fast and with high quality or even cooperate with other developers, unless you work with automated test cases!
HTMLUnit is a really nice tool. It is a head less web browser. This is perfect for creating test cases that clicks on different elements and does asserts on, for example, different attributes and values.
The problem is, we don't want to write those test cases in Java. Java is a general purpose programming language. The test cases will get messy and hard to read. They don't have to but the chances are they will.
Another problem is documentation of test cases. If we write test cases in Java we need to document them to make sure what flows are covered. This is extra important with front end testing, since these test can be very time consuming when testing a large web site.
I created an open source project to deal with these problems. I have created a domain specific language, DSL. You may say the test cases are automatically generated from the documentation, since the DSL is so easy to read and understand, it could just as well be documentation to a test case written in Java.
Here is a sneak peak, check out GitHub for more examples.
See testcases/BBBSeePaths.flow See testcases/BBBSeeUrls.flow Go to baspaket and wait 2 seconds Find a with attribute href set to /servlet/orderflow/search/search-flow?Id=tcm:142-23371 in campaignmodule Click on campaignModuleChoose and wait 10 seconds Find input with attribute id set to _eventId_search in searchpopup Fill in locationForm with _eventId as search and phoneNumber.fullNumber as 0768966787 Click on _eventId_search and wait 10 seconds Find input with attribute id set to _eventId_search in searchpopup Fill in locationForm with address.floor as 3 Click on _eventId_search and wait 10 seconds Find a with attribute href set to /orderflow/index.html?Id=tcm:142-23381&fromSearch&page=new in searchpopup