Cypress CLI
$ cypress Official Med RiskCypress CLI (cypress) executes JavaScript/TypeScript browser E2E and component tests headlessly via cypress run. Agents must avoid cypress open (which launches a blocking GUI) and pass --reporter json or --spec to scope runs.
npm install -D cypress Run existing Cypress test suites deterministically with npx cypress run; prefer playwright or agent-browser for lightweight ad-hoc checks.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
cypress run --headless --reporter json works non-interactively, but default spec runs print heavy Mocha ASCII banners, record videos, and cypress open blocks.
cypress runsupports--headlessand--reporter json;cypress openlaunches GUI
Runs local Electron/Chromium against configured app URLs; writes screenshots/videos into cypress/ on failures.
- Generates local screenshot/video artifacts on test runs
Heavy binary download (~500+ MB Electron/Cypress app cache) with Linux shared-library requirements.
- Large Electron binary cache downloaded on
npm install
Essential for repos already invested in Cypress E2E tests, though slower and heavier than Playwright or Hurl.
- Standard runner for
.cy.js/.cy.tstest suites
Official Cypress.io project (cypress-io/cypress) under MIT license.
- Official
cypress-io/cypressrepository
Comprehensive CLI documentation at docs.cypress.io.
- Official docs at docs.cypress.io/guides/guides/command-line
Security, Auth & Guardrails
Optional Cypress Cloud --key / CYPRESS_RECORD_KEY env var for dashboard recording; local test runs need no credentials.
MIT open-source CLI; optional Cypress Cloud dashboard has free + paid tiers.
# Cypress CLI Agent Rules - Never run `cypress open` inside agent shells—it launches a blocking Electron GUI. - Always scope runs with `--spec <glob>` and `--headless` to avoid multi-minute full-suite timeouts and video bloat.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx cypress run --headless --spec cypress/e2e/smoke.cy.js --reporter json
Executes one spec headlessly without launching the Cypress GUI and emits JSON results.
Controlled Writes & Previews
npx cypress run --headless --browser chrome --reporter junit --reporter-options mochaFile=results/cypress.xml
Runs the suite against headless Chrome and writes structured JUnit XML artifacts.
Strengths for Agents
- + Runs existing
.cy.ts/.cy.jsE2E suites headlessly in CI and coding-agent verification loops. - + Supports
--specscoping and Mocha--reporter jsonoutput.
Caveats & Pitfalls
- ! Heavy Electron binary download and slow cold-start (~5–10s before tests run).
- !
cypress openspawns a blocking desktop GUI; stdout logs are noisy unless piped or filtered.