Chapter 1.3: Testing strategies: Automated acceptance testing 🤑🤑
The primary goal of automated acceptance tests is to ensure that the parts of our application that the users directly use function correctly. But why should we prefer them over E2E tests?
As mentioned earlier, the following description of automated acceptance tests is to be understood in the context of this book. In practice, other definitions partly contradict the one I have chosen. But, I am less concerned with naming than distinguishing this type of tests from E2E tests.
While with E2E testing, we test the entire system, including all external dependencies like API-services and databases, our automated acceptance tests' primary goal is to ensure that the parts that the users directly use function correctly. In other words, we test the behavior of our application and not the actual implementation of the system as a whole. For example, whether data is fetched from or sent to a particular API is irrelevant to us in the context of acceptance testing.
I value your advice!
Have you found the right balance between mocking and testing end-to-end?
Let us know in the comments!
However, the type of application we are testing determines which factors we consider relevant for evaluating whether we meet the acceptance criteria. For example, when we test the user interface of a web application, how exactly we persist data is less relevant. When testing an API-service, on the other hand, it is crucial to test whether data is stored correctly.
Keep reading with a 7-day free trial
Subscribe to Good Tests for Vue Applications to keep reading this post and get 7 days of free access to the full post archives.