How would you add E2E tests to CI and what challenges arise?

This tests CI/CD pipeline design. Cover Dockerized environments, parallel runs, flaky-test retries, and selective execution such as critical tests per commit and full suites nightly. Red flag: running all tests on every commit without isolation or retries.
WHAT THIS TESTS: The interviewer wants to see if you understand that E2E tests in CI are fundamentally different from unit tests because they are slow, brittle, and resource-intensive. They are checking whether you can balance thoroughness with pipeline speed, manage infrastructure for reproducibility, and design failure handling that does not block teams on transient issues.
A GOOD ANSWER COVERS: First, environment isolation via Docker Compose to spin up the app, database, and dependencies with clean seeded data for every run. Second, parallelization strategy such as sharding tests across runners or using a framework like Playwright which benchmarks at roughly 4.5 seconds per test versus Cypress at about 9.4 seconds, since serial E2E suites can take tens of minutes. Third, flakiness mitigation through explicit waits instead of hard sleeps, automatic retry logic for failed tests, and network isolation to prevent cross-test contamination. Fourth, selective execution where critical smoke tests run on every commit while the full regression suite runs nightly or on release branches, preventing pull request feedback loops from ballooning. Fifth, artifact management including screenshots, videos, and logs on failure so developers can debug without rerunning locally.
COMMON WRONG ANSWERS: A major red flag is suggesting the full E2E suite runs on every single commit with no retry or isolation strategy. Another is ignoring test data management, which leads to cascading failures when tests mutate shared state. Candidates who pick tools based only on popularity without mentioning tradeoffs, such as Cypress being limited to Chromium browsers or Selenium being slower than Playwright, also signal shallow experience. Finally, failing to discuss how to handle failures, whether by quarantining flaky tests or gating deployments, suggests a lack of operational thinking.
LIKELY FOLLOW-UPS: The interviewer might ask how you would handle a test that fails one in ten runs, how to speed up a thirty-minute E2E stage, or how you would test features that rely on third-party services you cannot control. They may also probe your experience with specific tools like Playwright, Cypress, or Selenium, or ask how you would integrate test results back into pull request checks without making them required if flakiness persists.
ONE CONCRETE EXAMPLE: In a previous project, we containerized the frontend, backend, and Postgres database using Docker Compose in GitHub Actions. We seeded the database before each run and used Playwright to execute tests across four parallel shards, cutting total runtime from roughly twenty-five minutes to under seven minutes. We configured two retries per failed test and uploaded trace files and screenshots as artifacts only on failure. Critical smoke tests ran on every pull request, while the full suite ran nightly against staging, which kept merge times fast without sacrificing release confidence.
Source: ranger.net
Read the original → ranger.net
- #ci/cd
- #e2e testing
- #pipeline design
- #test automation
- #flakiness
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.