I have an angular application that relies on a dotnet core web api, and I'd like to write e2e tests that exercise CRUD actions on various resources and verify that the angular app responds appropriately responses/events implemented in the API. I recognize that in a lot of cases, one would want to mock the back-end because the e2e tests in angular are normally supposed to limit their concern with making sure the front-end behaves accordingly, not that the separate front-end and back-end applications behave appropriately together. But that's exactly what I want to do.
Question
Is there a common way to get front-end e2e test runs to rely on local instantiations of the back-end application that can also restore database snapshots? Further, when considering continuous integration, would you still rely on "local" instantiations of the back-end application on the CI machine, or would you point it to an already running testing server? Also, an alternative I started considering was to introduce an endpoint in the API itself that could restore database snapshots that my angular e2e tests invoke at the end of each test, in like a afterEach(...)
, for example.
I've also considered using an in-memory db or just mocking the backend, but that backend inherently lacks the specific behavior implemented in the web api, and it seems like mocking that behavior is just implementing that behavior twice.
What have you or others done to solve this?