Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Cypress io Cypress Test Runner Launch

From Leeroopedia
Knowledge Sources
Domains CLI, Process_Management
Last Updated 2026-02-12 00:00 GMT

Overview

A process spawning mechanism that launches the Cypress test runner as a child process with appropriate arguments for either interactive or headless execution modes.

Description

Launching a test runner requires bridging the gap between the lightweight npm-installed CLI and the full Electron-based test runner binary. Cypress uses a two-process architecture: the CLI process (cypress open or cypress run) validates arguments and spawns a child process that executes the actual Cypress server within the installed binary.

The open mode launches an interactive Electron window (the Launchpad), while run mode executes tests headlessly and exits with a status code. Both modes share the same spawning infrastructure but differ in their argument processing and lifecycle management.

Usage

Use this principle when understanding how Cypress transitions from CLI invocation to test execution. It applies every time a user runs cypress open (interactive) or cypress run (headless).

Theoretical Basis

CLI Invocation Flow:
  cypress open/run
    → Parse CLI arguments
    → Verify binary installation
    → Map options to server arguments (processOpenOptions / processRunOptions)
    → spawn.start(args) → child_process.spawn(binaryPath, args)
    → Child process: Electron app starts Cypress server
    → Open mode: Interactive Launchpad UI
    → Run mode: Headless execution → exit code

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment