Test Location: The single most important factor that can make or break your test automation efforts

An e2e or system test can typically fail because of these reasons:

  1. Test code issue: Application code changed but the test was not updated yet, or other test-related reasons.
  2. Real bug in the application code
  3. Environment issue

What we really want to capture are issues of type 2 and type 3 (real bugs in the application code and environment issues). However, when e2e tests live in an external repository, they typically fail due to type 1 reasons.

Let us explore some of the pros and cons of keeping e2e tests in the same repository vs. keeping them in an external repository.

When e2e tests live in the same repository as the application

Pros

  1. Code and test changes go hand in hand.
  2. It is thus possible to make these tests a part of the quality gate.
  3. Results in zero to little test failures due to code changes in higher environments.
  4. Creates low noise and increased trust in tests.
  5. Results in low maintenance efforts, even when code changes are frequent.
  6. Tests are fixed when broken and only fail for the right reasons in higher environments.
  7. Tests are pushed at the same time when they fail in a PR — caught on a developer’s local machine or in a pull request.
  8. Since they are typically created and maintained by developers, they scale really well as the project grows.

Cons

  1. Requires initial investment in workshops and mentoring developers to help them work with test frameworks.
Back to Blogs