Setting up a simple mock backend server
It isn't hard to realize why having end-to-end tests that communicate with a real server that returns mock responses can be useful. Outside of the testing complexity that involves the business logic your application uses to handle the data returned from the server, the spectrum of possible outcomes when relying upon HTTP communication (timeouts, server errors, and more) should be included in a robust end-to-end test suite. It's no stretch of the imagination then that a superb way of testing these corner cases is to actually create a mock server that your application can hit. You can then configure the mock server to support different endpoints that will have predetermined behavior, such as failing, slow response times, and different response data payloads to name a few.
You are fully able to have your end-to-end tests communicate with the API as they normally would, as the end-to-end test runner does not mock the backend server by default. If this is...