-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support chrome --headless
#832
Comments
This is important. Today I found a couple of our tests failing in CI environments but not locally using cypress app. It turns out Chrome and Electron act differently. Is there anyway you can prioritize this feature? 2.x.x seems like too far away. |
Chrome and Electron act the same - the difference is the underlying version of Chromium each is using. Electron uses Chromium 53. Your local version of Chrome likely differs. These different versions will not act exactly the same. I can't say when this will be prioritized because all of our team members are currently working on other features. We are open source now and are accepting PR's of course. It's going to be a lot of work - likely weeks for someone to work on full time. As for the |
What I would suggest is install Alternatively you could also run Electron locally to suss out the differences in failing tests. Plenty of users do either. |
@brian-mann, has there been any consideration to either:
Those might be lower-hanging (?) fruit that might help close the gap. |
@nrutman there is already an API for doing your first bullet item: https://docs.cypress.io/api/plugins/browser-launch-api.html The problem is that running in headless mode disables chrome extensions which prevents Cypress from working. However you can modify other arguments. Yes, per your second bullet item we have been waiting for Electron to drop 1.8 which bumps node to |
Looks like should be able to load extensions for headless chrome with flags
|
I had read somewhere about chrome headless not ever going to support extensions. I don't believe there are any configuration options that will change this. Puppeteer here is irrelevant since this is a restriction from Chrome itself. |
This comment has been minimized.
This comment has been minimized.
Why cypress need chrome extension? Why using headless mode is valuable? |
Should still be able to switch from using xvfb and chrome -> chome --headless |
@kelegorm Headless chrome would be awesome, since it's the option default available at Heroku. To quote from their webpage:
They have depreciated support for Xvfb Chrome buildpack on their new buildpacks, such as heroku-16. So you might say, why care about Heroku? The best argument I can find is that while Cypress makes it easy to do end2end testing, Heroku aims to make hosting simple. A perfect match ❤️ |
Yes, this would be fantastic to have Cypress working with Heroku. This currently stops me from using Cypress |
Is Chrome headless support happening? If so, is there an approx. date of availability? |
Any update on this? We heavily use cypress and heroku but cypress needs cedar-14 which will go away in april 2019. |
Cypress team updateWe have investigated headless Chrome support. To support executing commands and capture the video of the test run, we must go through the Debugger protocol. Thus we will support headless Chrome after landing native events #311 which is in progress. |
Hi, Thank you for your work !! I just started to use Cypress and it's really great ! Unfortunatly I'm using heroku and cedar-14 is no more supported so I'm waiting for headless Chrome support... I saw above that you are working on it, but do you know when it will be available ? Is it in days, weeks, month ? I'm stuck waiting for this feature it's too bad 😢 |
Just a suggestion here... why not split this to separate "Support chrome headless" and "change defaults for cypress run" into separate issues? I'm all for anything that gets headless chrome support delivered quicker, as I'm having a bit of trouble dealing with some electron limitations. |
Relevant link: |
chrome --headless
, remove xvfb, and change defaults for cypress runchrome --headless
and make it the default for cypress run
chrome --headless
and make it the default for cypress runchrome --headless
The code for this is done in cypress-io/cypress#5676, but has yet to be released. |
Released in |
Thank you! |
@Waterstraal I feel you better open a new issue for that. |
New issue for |
#5949 fixed |
Change 1.
With Chrome 63 coming out we can make some big changes at Cypress.
debugger
protocol which will enable native eventschrome --headless
The reason we currently do not support
chrome --headless
is because Chrome does not support extensions in that mode. We use an extension to automate the browser and that's why its a no-go. By switching from the extension to thedebugger
protocol, we'll be able to get around this.Change 2.
Once we support chrome headless I propose the following changes to the CLI:
Currently
cypress run
will launch Electron headlessly. This is confusing for users because they can't see what's going on and because they don't read our docs they don't understand that we're launching Electron instead of Chrome. Due to the browser version differences, they see failures in Electron that aren't happening in Chrome.What I propose is to change this behavior so that
cypress run
by default will search for Chrome and launch it inheaded
mode. When no Chrome is installed, it'll fall back to Electron.Currently we support a
--headed
option that only applies to Electron. This was done to prevent breaking changes.This should now switch to being the default but then enabling the user to explicitly opt into the
--headless
mode for both Electron + Chrome.This will be a breaking change and could come out in Cypress
2.x.x
.The text was updated successfully, but these errors were encountered: