Q12 of 48 · Cypress

What is the Test Runner UI and how is it different from cypress run?

CypressJuniorcypresstest-runnercifundamentals

Short answer

Short answer: `cypress open` launches the interactive Test Runner — a desktop app where you pick specs, watch them run in a real browser, and time-travel through every command. `cypress run` runs headlessly in CI, recording video and producing JSON/JUnit results, but no interactive UI.

Detail

These are two execution modes for the same specs.

cypress open is for local development. The Test Runner shows your specs, lets you click one to run, and opens a browser window where the test executes alongside a command log. You can hover over any past command to see a snapshot of the DOM at that point ("time-travel"), inspect network calls, and re-run on save. testIsolation and other config can be overridden per-mode (openMode retries default to 0).

cypress run is for CI. It runs all specs (or those matched by --spec) headlessly, captures video, takes a screenshot on failure, and outputs results to stdout, JUnit XML, or Cypress Cloud. No interactive UI; no DOM snapshotting beyond what's automatic. Faster than open mode because there's no UI overhead.

Practical implication: a test passing in open but failing in run usually involves something interactive (focus, hover, viewport, animations) that behaves differently headlessly. The fix is usually --browser chrome --headed locally to reproduce, or to look at the recorded video from CI.

Some flags differ between the two: open ignores most CLI flags and reads them from the runner's UI; run honours all CLI flags. open requires a display; run doesn't (works in Docker/headless CI).

// EXAMPLE

# Local interactive — pick a spec and watch it run
npx cypress open

# CI headless — runs all specs, exits 0/1
npx cypress run

# CI with reporter and screenshots
npx cypress run --reporter junit --reporter-options 'mochaFile=results.xml'

# Reproduce a CI failure locally
npx cypress run --browser chrome --spec "cypress/e2e/checkout.cy.ts"

// WHAT INTERVIEWERS LOOK FOR

Distinguishing the developer mode from CI mode and naming the headless/headed difference. Bonus for time-travel debugging as a key feature of `open`.

// COMMON PITFALL

Treating them as equivalent — `open` runs differently from `run` (browser, viewport, retries), so a spec passing in one isn't a guarantee for the other.