Course contentsShow
← Software Engineering
Lesson 561 of 1,93317. End-to-End and UI TestingFree lesson

E2E Test Execution Strategy

When to run E2E tests in the pipeline, parallelization approaches, and balancing speed with comprehensive coverage.

E2E Test Execution Strategy

You'll learn when and how to run end-to-end tests to maximize coverage while keeping your pipeline efficient.

The Challenge of Running E2E Tests

End-to-end tests are slow and resource-intensive. Unlike unit tests that run in milliseconds, E2E tests spin up entire systems, interact through real UIs or APIs, and verify complete workflows. Running hundreds of E2E tests sequentially after every commit would grind your development process to a halt.

When to Run E2E Tests

You don't need to run all E2E tests on every commit. Instead, adopt a tiered strategy:

  • On every commit: Run your critical path tests only (the handful of tests covering your most important user journeys)
  • Nightly builds: Run the full E2E suite when time constraints are relaxed
  • Pre-release: Execute comprehensive E2E validation before deploying to production
  • After deployment: Run smoke tests to verify the deployment succeeded

Parallelization Approaches

Speed up E2E test execution by running tests in parallel across multiple machines or containers. Each test should be independent—sharing no state, database records, or user accounts. Some teams shard tests by feature area, others distribute randomly. The goal is to reduce a 2-hour test suite to 15-20 minutes.

Balancing Speed and Coverage

Think of E2E tests like insurance: you need enough coverage to catch critical issues, but not so much that the cost outweighs the benefit. Focus your frequent runs on critical paths, relegating exhaustive edge-case testing to scheduled runs. Monitor which tests catch real bugs and retire flaky or low-value tests.

Key Takeaway: Run critical path E2E tests on every commit, parallelize execution to reduce feedback time, and schedule comprehensive suites for nightly or pre-release validation to balance speed with thorough coverage.