in my team we use E2E tests, and we have the following dilemma about dealing external resources:
- We want our E2E tests to test whole flows - including dealing with the DB, upload images to our S3 servers and etc.
- It occured that one of the external resources had some problems for a while - for example one of the S3 servers had a problem that avoided our tests to upload images to it, so our tests failed but the internal code was just fine. Our tests also run in the CI so when this external resource was down we couldn't do any merges and etc because the tests failed.
We want our tests to block merges in cases that we have an actual bugs that we didn't see in manual tests.
I would like to know what is the best practice to deal with external resources in E2E tests - should we mock them so our tests won't depend on external problems or should we still use the external resources in the tests?
Thanks ahead.