How to Run Cypress with Headless Firefox

How to Run Cypress with Headless Firefox

Ferenc Almasi β€’ 2021 December 07 β€’ Read time 1 min read
  • twitter
  • facebook

To run Cypress in a headless Firefox, you can pass --browser firefox to your cypress run command. Cypress will automatically start browsers headlessly, so there's no need to specify it explicitly.

Copied to clipboard!
cypress run --browser firefox
cypress run --browser chrome
cypress run --browser chrome:canary
cypress run --browser edge

You can also run a number of selected other browsers with Cypress, including Chrome, Canary, Edge, or Electron. If you would like to use a custom browser, Cypress can also be launched with a custom path pointing to the browser:

Copied to clipboard!
cypress run --browser /usr/bin/chromium

If you need to run it using a headed browser, then you can pass the --headed flag to the cypress run command:

Copied to clipboard!
cypress run --browser firefox --headed
cypress run --browser chrome --headed
cypress run --browser edge --headed

Want to learn Cypress from end to end? Check out my Cypress course on Educative where I cover everything:

Learn Cypress with Educative
How to Run Cypress with Headless Firefox
If you would like to see more webtips, follow @flowforfrank

Resources:

  • twitter
  • facebook
Did you find this page helpful?
πŸ“š More Webtips
Frontend Course Dashboard
Master the Art of Frontend
  • check Access 100+ interactive lessons
  • check Unlimited access to hundreds of tutorials
  • check Prepare for technical interviews
Become a Pro

Courses

Recommended

This site uses cookies We use cookies to understand visitors and create a better experience for you. By clicking on "Accept", you accept its use. To find out more, please see our privacy policy.