-
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
Running with headless chrome settings opens a visible maximized chrome instance #5949
Running with headless chrome settings opens a visible maximized chrome instance #5949
Comments
Same on OSX |
it seems to work if you use in on('before:browser:launch', (browser = {}, args) => {
args.push('--headless')
} But then I am loading an extension for args.push('--load-extension=' + extention_path); |
@knagarajan1984 Chrome headless mode does not support extensions, so you will have to use one or the other, not both. |
I have a fix for this in #5953. For a temporary workaround, you can use the pluginsfile as @knagarajan1984 mentioned above: on('before:browser:launch', (browser = {}, args) => {
if (browser.family === 'chrome') {
args.push('--headless')
}
} |
For me, on mac os, the work around does not work. The chrome browser window still opens Below I have console logged the plugin browser object
and the arguments after the plugin code
however, as mentioned, the chrome browser window still shows up. When I close the chrome window, the test seems to stop running |
@WinstonN interesting, what version of Chrome are you using? If you run |
The code for this is done in cypress-io/cypress#5953, but has yet to be released. |
@flotwig I appear to be having the same issue as @WinstonN . My // index.js
module.exports = (on, config) => {
on('before:browser:launch', (browser = {}, args) => {
args.push('--headless')
})
} Args after push: [
'--test-type',
'--ignore-certificate-errors',
'--start-maximized',
'--silent-debugger-extension-api',
'--no-default-browser-check',
'--no-first-run',
'--noerrdialogs',
'--enable-fixed-layout',
'--disable-popup-blocking',
'--disable-password-generation',
'--disable-save-password-bubble',
'--disable-single-click-autofill',
'--disable-prompt-on-repos',
'--disable-background-timer-throttling',
'--disable-renderer-backgrounding',
'--disable-renderer-throttling',
'--disable-restore-session-state',
'--disable-translate',
'--disable-new-profile-management',
'--disable-new-avatar-menu',
'--allow-insecure-localhost',
'--reduce-security-for-testing',
'--enable-automation',
'--disable-device-discovery-notifications',
'--disable-infobars',
'--autoplay-policy=no-user-gesture-required',
'--disable-site-isolation-trials',
'--metrics-recording-only',
'--disable-prompt-on-repost',
'--disable-hang-monitor',
'--disable-sync',
'--disable-web-resources',
'--safebrowsing-disable-auto-update',
'--safebrowsing-disable-download-protection',
'--disable-client-side-phishing-detection',
'--disable-component-update',
'--disable-default-apps',
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream',
'--disable-ipc-flooding-protection',
'--disable-backgrounding-occluded-window',
'--disable-breakpad',
'--password-store=basic',
'--use-mock-keychain',
'--disable-gpu',
'--no-sandbox',
'--proxy-server=http://localhost:42825',
'--proxy-bypass-list=<-loopback>',
'--remote-debugging-port=42993',
'--headless'
] My chrome version is |
@flotwig I also have the same problem as @rpocase @WinstonN .
@flotwig If i call |
@flotwig apologies for the late reply |
Hey @WinstonN @gabbersepp @rpocase, this was a bug in Cypress and will be fixed in the next release. |
@flotwig is there a workaround that works on os x until the fix is released? I just ran into this this morning |
Yeah, no luck with that unfortunately, it still runs headed. Even if I always push
If it's helpful, we're using |
I'm seeing the same behavior as @xdumaine. We are also using cypress.run() from a script, not launching cypress from cli |
Pending ReleaseThe code for this is done in cypress-io/cypress#5953, but has yet to be released. |
Released in |
running
cypress run --headless --browser chrome
opens a visible maximized (it does not adhere viewportWidth and viewportHeight settings) Chrome instance. I would expect it to run headless with the correct dimensions.Interestingly, it does report to be running chrome 78 headless:
Originally posted by @Waterstraal in #832 (comment)
The text was updated successfully, but these errors were encountered: