Principle:Cypress io Cypress Testing Type Selection
| Knowledge Sources | |
|---|---|
| Domains | UI, Configuration |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
A user-driven selection mechanism that routes the Cypress setup flow based on the chosen testing type (E2E or Component), triggering appropriate downstream configuration.
Description
Cypress supports two distinct testing types: E2E testing (testing full applications in a browser) and Component testing (testing isolated UI components). The selection of testing type is a critical branching point that determines which configuration defaults to apply, which scaffolding to perform, and which dev server setup is needed.
The selection is made via the Launchpad UI and persists via a GraphQL mutation that sets currentTestingType on the project state. This triggers downstream effects: framework detection for component testing, spec pattern resolution, and viewport default selection.
Usage
Use this principle during the initial Cypress setup flow and when switching between testing types in an existing project.
Theoretical Basis
Selection Branching:
User selects E2E:
→ Apply E2E defaults (viewport 1000x660, slowTestThreshold 10000ms)
→ Scaffold cypress/e2e/ and cypress/support/e2e.ts
→ No dev server needed
User selects Component:
→ Apply Component defaults (viewport 500x500, slowTestThreshold 250ms)
→ Detect framework and bundler
→ Configure dev server integration
→ Scaffold cypress/support/component.ts with mount import