When it comes to unit testing and TDD, we usually think of so-called "business logic" tests, which are based on requirements, etc.
But we also find examples of user interface testing on the web, especially on the web, but sometimes on the desktop.
Examples:
- On this Google Testing Blog page , tested user actions on Google+:
@Test public void shouldNavigateToPhotosPage() {
String baseUrl = "http://plus.google.com/";
Navigator nav = new Navigator(baseUrl);
nav.goToPhotosPage();
assertEquals(baseUrl + "/u/0/photos", nav.getCurrentUrl());
}
- On the QUnit website pages there are examples of DOM manipulation tests (if an element became visible after a user action, etc.)
It turns out that testing the interface seems to be very labor-intensive, I really do not know if it's worth it.
Is it recommended to create automated tests for the interface, or should we test it on the spot?