🏁
Best Practices
  • Introduction
  • The Big Picture
    • Principles
      • Software engineers solve business problems
      • Programming is a social activity
      • Attention is the most precious resource in a project
      • Simplicity is the best ally in the long run
      • The only problem to solve is the one we have today
    • Architecture
      • Domain
      • Services
      • Persistence
      • HTTP
      • UI
    • Naming
  • Constraints
    • TypeScript
    • Monorepo
    • Monolith
    • Versioning
  • Source code
    • Declarative programming
    • The README
    • Modules
    • Folder structure
    • Code formatting
    • Code comments
  • The Outside World
    • Runtime configuration
    • Logging
  • Testing
    • The purpose of testing
      • End-to-end tests
      • Integration tests
      • Unit tests
  • Tools
    • Git
  • Resources
    • Resources
Powered by GitBook
On this page

Was this helpful?

  1. Testing
  2. The purpose of testing

End-to-end tests

E2E validates the user interface.

Put an automated, end-to-end test in place right at the beginning; make sure it validates PRs. The initial setup is the most difficult; adding or changing things will be more comfortable moving forward.

The e2e test should also be able to validate that a deployed version of the app works as expected: this verifies the environment, configuration and integration. You can use this before promoting code to a new environment.

Most importantly: e2e proves that the app does what it supposed to do - no other form of testing will give you that kind of confidence.

It is OK to run automated tests on production, where confidence is the most important - using dedicated test users is one way.

E2E tests should cover only high-level features derived from business requirements. These are the user journeys that interest the stakeholders and include such things as being able to register, log in, look at things in different ways and buy them.

These tests run in a browser or mobile app, without mocks.

Suggestion: put e2e tests in the UI project, next to the src folder:

ui/
  src/
  e2e/ # <-- here
PreviousThe purpose of testingNextIntegration tests

Last updated 5 years ago

Was this helpful?