Keep end-to-end (E2E) tests for critical user journeys and system behavior that smaller tests cannot establish reliably. Move routine logic to unit, component, API, or integration tests; measure where E2E time goes; then improve isolation, setup, and CI execution. Adding workers or retries before diagnosing the bottleneck can make runs less reliable without making feedback meaningfully faster.
Choose what deserves an end-to-end test
An E2E test exercises an application through a user-facing flow and its connected systems. That makes it valuable for finding integration failures, but slower and more vulnerable to environmental problems than a test at a smaller level. Use it when confidence depends on the whole path working—not simply because a feature has a screen.
- Keep a small number of tests for important journeys, such as signing in or completing a key transaction.
- Add coverage for important classes of failure where the behavior matters to users or the system.
- Test routine calculations, branching logic, and component behavior at faster levels when those tests can prove the behavior adequately.
- Use E2E coverage for system-level concerns that smaller tests cannot reliably establish, such as interactions across services, concurrency, resource allocation, or API compatibility.
Adam Bender’s 2016 Google Testing on the Toilet article recommends one E2E test for each important use case and important class of error, while keeping the total low. It also advises verifying overall behavior rather than details such as exact messages or layouts that change frequently: Google: “What Makes a Good End-to-End Test?”
Google’s earlier testing strategy describes a pyramid: many unit tests, fewer integration tests, and a small number of E2E tests. Its 70/20/10 mix is presented as a first guess, not a quota; the right balance varies by team. The enduring principle is to get routine feedback from smaller tests and reserve slower checks for system behavior: Google: “Just Say No to More End-to-End Tests.”
Recommended Free Tools
Measure the bottleneck before changing the suite
Collect representative timings from both local runs and CI. Look at the slowest individual tests and spec files, repeated setup, browser startup, authentication, real network calls, application waits, and whether CI machines are resource-constrained. Optimize the largest verified contributors first rather than spending time shaving fractions off already-fast tests.
Cypress’s current performance guide provides these vendor reference ranges, not guarantees or results from an independent benchmark. The page accessed October 3, 2026, does not identify a dated publication or independent study behind the thresholds; actual times vary by app, browser, machine, and CI provider. See Cypress: Optimizing test performance.
| Measure | Cypress reference guidance | How to use it |
|---|---|---|
| Individual test using stubs and programmatic setup | Under 3 seconds: “Excellent” | Use as a diagnostic reference, not a requirement for every test. |
| E2E test against a real server | 3–10 seconds: “Acceptable” | Investigate a test that takes longer, especially if it has unnecessary waits or UI-driven setup. |
| Individual test duration | 10–30 seconds: “Investigate”; over 30 seconds: “Poor” | Find the specific wait, setup, dependency, or resource constraint responsible. |
| Spec-file duration | Under 1 minute: “Excellent” for memory and parallelization; over 5 minutes: “Poor” | Consider splitting very long files or reducing shared setup, then compare actual runs. |
| Suite of 50–200 tests | Under 10 minutes serial; under 3 minutes in parallel | Treat as Cypress targets, not a promise for a different application or environment. |
Interpret the timing in context. A slow test may be spending its time on an external service, repeated sign-in, a fixed delay, a busy worker, or the application itself. Cypress notes that splitting specs under 10 seconds may not help: browser launch and video overhead can outweigh the gain.
Make each test independent and repeatable
A test should set up the state it needs, run without relying on another test’s side effects, and remain safe if execution order changes. Give tests their own data and isolate cookies, storage, and other mutable state where appropriate. This makes a failure easier to reproduce and is a prerequisite for safe parallel execution.
- Create the required user, records, or other data as part of the test or its fixture.
- Avoid using one test to prepare state that a later test silently depends on.
- Use programmatic setup when it is faster and still verifies the intended behavior; keep the user-facing journey itself in E2E coverage when that journey is the behavior under test.
- Check that tests can pass alone as well as in the full suite.
Playwright says isolation improves reproducibility and debugging and prevents cascading failures. Its parallelism guidance requires tests not to depend on other tests’ side effects. Cypress likewise advises that tests pass independently: Playwright: Best Practices, Playwright: Parallelism, and Cypress: Best Practices.
Wait for conditions, not guessed delays
Prefer assertions and waits tied to observable application conditions over fixed sleeps. A hard-coded delay can waste time when the app is ready sooner and still fail when it is slower than expected. Assert user-visible outcomes and semantics—such as a confirmation appearing or a control becoming available—rather than fragile implementation details like CSS class names or function names.
Keep failure evidence useful and proportionate. Logs, screenshots, traces, or relevant state can make a problem diagnosable, but capturing expensive diagnostics on every passing test can increase runtime. Playwright warns that tracing every test is performance-heavy and documents configuring traces for the first retry in CI: Playwright: Best Practices.
Use parallelism and test selection deliberately
Once tests are independent, parallel workers or CI sharding can reduce wall-clock time. Playwright runs tests in OS worker processes, supports worker limits, and documents sharding across CI jobs. Increase concurrency incrementally while watching total runtime, machine saturation, and contention; more workers can compete for the same CPU, memory, database, or external service.
- Verify tests own their setup and data and pass independently.
- Record a baseline duration and note machine or service constraints.
- Set a worker limit or shard files across CI jobs; compare the new total wall time and failure pattern with the baseline.
- Adjust file boundaries when long specs leave workers idle, but avoid splitting tiny specs if fixed startup overhead erases the benefit.
For a faster preliminary pull-request signal, Playwright’s --only-changed option can run likely affected tests. Treat it as prioritization, not a substitute for broader CI coverage when that coverage is required. See Playwright: Continuous Integration and Playwright: Parallelism.
Rank #4
Use retries to diagnose flakes, not hide them
A retry may keep an intermittent failure from blocking a run, but a passing retry does not show that the test is healthy. Keep retry counts low, record which tests fail and then pass, and investigate timing, shared state, unstable dependencies, or constrained environments. Cypress explicitly recommends addressing the root cause rather than treating retries as the fix: Cypress: Optimizing test performance.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.A practical workflow for faster, trustworthy feedback
- Sort by confidence needed. Move behavior to a smaller test level when that level can prove it; retain E2E coverage for critical journeys and system properties.
- Establish a baseline. Compare representative local and CI runs and identify the slowest tests and files.
- Trace the time. Separate setup, browser launch, authentication, network, application waiting, and machine contention.
- Remove repeat work. Reuse or programmatically establish suitable session state and avoid UI setup that does not need to be part of the journey under test.
- Enforce independence. Give tests their own state and data before raising worker counts or sharding.
- Scale and remeasure. Add workers or split long specs only when measured wall time improves without creating resource contention or unstable failures.
- Keep diagnostics actionable. Preserve evidence for failures and flaky outcomes without imposing heavyweight tracing on every successful test.
Fast feedback is not just a shorter green run. It also means a failure is trustworthy, reproducible, and specific enough to fix.
Or skip the browser setup
If you need website screenshots as part of test fixtures, visual checks, or an agent workflow, ScreenshotNeo is a website screenshot API and MCP server. A single GET request returns a PNG, JPEG, WebP, or PDF. Example using cURL (replace the target URL as needed):
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners are accepted like a visitor and removed along with 60+ known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up free for 1,000 screenshots a month, with no card.
Frequently Asked Questions
Should every important feature have an end-to-end test?
No. Use an E2E test when confidence depends on the complete journey or system behavior; use a smaller test when it can prove the behavior adequately.
Does increasing parallel workers always make a suite faster?
No. Workers can contend for limited CI resources or shared services. Establish test independence and measure wall time as concurrency changes.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




