My understanding of E2E tests is that we should be carrying out tests that run through the whole system to check if everything works together via Selenium (for a web application). However, I've seen places where they would consider the following test as part of E2E:
- Navigate to a certain page (which would take 1/2 minutes to execute) then check to see if the page has the correct title, paragraph, form titles etc.
- Navigate to a certain page (which would take 1/2 minutes to execute) then check to see if a certain form shows/hides correct validation messages e.g. entering a character in the DOB field.
My understanding is that, as the application grows this will become very expensive to maintain and execute. It almost seems like we are shifting right, and pushing all our tests to the GUI level when they can be executed lower down the stack.
My questions:
- Is my understanding correct in that these tests should not be part of E2E?
- Can these tests be executed lower down the stack, is so at what level? For example, surely the developers can mock the data needed to load a specific page, and even then they could use selenium if they really wanted to check if the form was working, or if the page was displaying the correct data. Otherwise can such tests listed in my example be tested at unit level?
The perfect answer will help clear my understanding on where these tests should be executed and how. Any examples related to web applications written in Angular with a choice of potential tools will be perfect. Thank you. :)