==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 14.5.4 │ │ Browser: Electron 118 (headless) │ │ Node Version: v18.17.0 (/usr/local/bin/node) │ │ Specs: 3 found (LoginPageSpec.cy.ts, HomePageSpec.cy.ts, CheckoutPageSpec.cy.ts) │ │ Searched: cypress/e2e/ui/**/*.cy.ts │ └────────────────────────────────────────────────────────────────────────────────┘──────────────────────────────────────────────────────────────────────────────────────────────────── Running: LoginPageSpec.cy.ts (1 of 3) User Authentication ✓ Should log in successfully with valid credentials (2456ms) ✓ Should not log in with a locked user credentials (876ms) ✓ Should log in successfully with a problem user credentials (1234ms) ✓ Should log in successfully with a glitched performance user credentials (2100ms) ✓ Should log in successfully with a visual issues user credentials (1150ms) 5 passing (8s) (Results) ┌────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 5 │ │ Passing: 5 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 8 seconds │ │ Spec Ran: LoginPageSpec.cy.ts │ └────────────────────────────────────────────────────────────────────────────────┘
Headless mode is perfect for CI/CD pipelines where you need fast, automated test execution without a UI.
# Run all login-related testsnpx cypress run --config-file cypress.config.ui.ts --spec "cypress/e2e/ui/*Login*.cy.ts"# Run all tests in a directorynpx cypress run --config-file cypress.config.ui.ts --spec "cypress/e2e/ui/**/*.cy.ts"
it.only('Should log in successfully', () => { // Only this test will run})it('Should log out', () => { // This test will be skipped})
Or an entire describe block:
describe.only('User Authentication', () => { // Only tests in this block will run})describe('Product Management', () => { // All tests in this block will be skipped})
# Set base URL via environment variableCYPRESS_BASE_URL=https://staging.example.com npm run cy:run:ui# Set custom environment variableCYPRESS_API_KEY=test123 npm run cy:run:api
# Use JUnit reporter for CInpx cypress run --config-file cypress.config.ui.ts --reporter junit --reporter-options "mochaFile=results/test-results-[hash].xml"# Use multiple reportersnpx cypress run --config-file cypress.config.ui.ts --reporter cypress-multi-reporters
# Disable video recordingnpx cypress run --config-file cypress.config.ui.ts --config video=false# Record videos only on failurenpx cypress run --config-file cypress.config.ui.ts --config video=true,videoUploadOnPasses=false