Skip to content

cypress

GradedJestRisk edited this page Mar 6, 2024 · 2 revisions

Cypress

CLI

Run a single file on a specific browser, debug mode

DEBUG=cypress:* npx cypress run --browser electron --spec=cypress/e2e/ptm/recherche-de-trace/recherche-simple.cy.ts

Debug

Use these environment variables:

  • DEBUG=cypress:<SOURCE> where SOURCE
  • DEBUG_DEPTH=3 to flatten deeply-nested objects

To run headed (useful when works in Cypress UI, but not in CLI)

--headed 

Alter Firefox profile storage for Cypress (useful when using snapped browser)

XDG_CONFIG_HOME=$HOME/cypress cypress run --browser /snap/bin/firefox

https://github.com/cypress-io/cypress/issues/19793

Performance

Make your test self-supporting to parallelize them

Time your tests https://www.cypress.io/blog/2020/05/22/where-does-the-test-spend-its-time

Debug

DEBUG=cypress:* cypress run

Clone this wiki locally