2
When it comes to unit tests and TDD, we usually think of so-called "business logic" tests, which are based on requirements, etc.
But we also find on the web examples of tests of the user interface, mainly on the web, but also on the desktop sometimes.
Examples:
- On this page of the Google Testing Blog, user actions are tested 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 page of Qunit’s website there are examples of DOM manipulation tests (if an element has become visible after a user action, etc.)
It turns out that testing the interface seems to be quite laborious, I really don’t know if it’s worth it.
It is recommended to create automated tests for the interface, or this we should test "at hand" even?
I will try to post a better answer, see for example the Zombiejs and the cucumberJs, together allow to create a good coverage of tests using BDD is an idea to have tests with interface and with not so much effort
– Caputo