Cypress: [Feature Request] Support for Chrome in headless mode

Created on 25 Apr 2017  路  8Comments  路  Source: cypress-io/cypress

Current behavior:

It is not possible to run tests in headless mode with browser extensions installed, because the only supported browser in headless mode is Electron, and Electron doesn't support extensions as stated in the documentation.

Expected behavior:

Either allow choosing another browser for running in headless mode or add support for third-party extensions in Electron browser.

Use case scenario:

My web project has several environments (development, beta, production) that share the same URLs and are distinguished by custom headers (say, X-FooApp-Environment: Beta).

To achieve this currently, we set the headers in an extension using headless Chrome and Selenium WebDriver.

  • Operating System: Linux
  • Cypress Version: 0.19.2
chrome proposal 馃挕 feature

Most helpful comment

@jennifer-shehane If i were to do cypress run --browser chrome in a headless envirornment(maybe a EC2 AWS instance) would it work the way it would in a headed environment? If not, that is the feature I would want to request.

All 8 comments

Adding extensions will be possible once we land https://github.com/cypress-io/cypress/issues/684

Adding headless chrome is a separate feature and should be pretty easy to do.

So is there a way currently to run cypress headless with chrome now?

@nanomosfet You can run cypress using cypress run in Chrome by passing the --browser flag like so. However, this is not running "headless" Chrome, this will run a headed version of Chrome.

The nomenclature has been a bit unclear in the past between running using cypress run and cypress open and the difference between a headless and headed browser. Does what I said make sense?

@jennifer-shehane If i were to do cypress run --browser chrome in a headless envirornment(maybe a EC2 AWS instance) would it work the way it would in a headed environment? If not, that is the feature I would want to request.

Is this possible yet? I've seen people mention headless chrome in other issues (e.g. #2307 #2494). Is there an example of how to do it? My tests don't work in electron.

@jennifer-shehane If i were to do cypress run --browser chrome in a headless envirornment(maybe a EC2 AWS instance) would it work the way it would in a headed environment? If not, that is the feature I would want to request.

@jennifer-shehane Can you please answer the above question? Is that even possible because my tests would run in kubernetes cluster

@jennifer-shehane If i were to do cypress run --browser chrome in a headless envirornment(maybe a EC2 AWS instance) would it work the way it would in a headed environment? If not, that is the feature I would want to request.

I've faced similar issue and found the solution for Docker container here. If you launch cypress run --browser chrome in a container based on some image from the link (for example cypress/browsers:chrome69) it works like a charm, no additional configs are required. Hope it helps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brian-mann picture brian-mann  路  3Comments

zbigniewkalinowski picture zbigniewkalinowski  路  3Comments

brian-mann picture brian-mann  路  3Comments

EirikBirkeland picture EirikBirkeland  路  3Comments

igorpavlov picture igorpavlov  路  3Comments