Skip to content
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

Content size in page is not equal browser size in headed and no-runner-ui mode #30804

Open
Oleksii-QA opened this issue Dec 26, 2024 · 0 comments

Comments

@Oleksii-QA
Copy link

Oleksii-QA commented Dec 26, 2024

Current behavior

Content size in page is not equal browser size in headed and no-runner-ui mode

Actual result:

size1

Desired behavior

Content size in page is equal browser size in headed and no-runner-ui mode
I use start-maximized option.

Expected result:

size2

Test code to reproduce

run command:
cypress run --no-runner-ui --headed --browser chrome

my settings in cypress.config.js:

export default defineConfig({
  viewportWidth: 1920,
  viewportHeight: 1080,

  e2e: {
    setupNodeEvents(on, config) {
      on('task', {
        log(message) {
          console.log(message)

          return null
        },
      }),
      on('before:browser:launch', (browser = {}, launchOptions) => {
        if (browser.family === 'chromium' && browser.name !== 'electron') {
          launchOptions.args.push('--start-maximized');
          launchOptions.args.push('--lang=en');

          return launchOptions
        }

        if (browser.name === 'electron') {
          launchOptions.preferences.fullscreen = true

          return launchOptions
        }
      });
    },
  },
})

Cypress Version

13.17.0

Node version

18.17.1

Operating System

Windows 10

Debug Logs

Some part of debug logs:

cypress:server:browsers getBrowserLauncher { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '131.0.6778.205', path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', minSupportedVersion: 64, majorVersion: '131', isHeadless: false, isHeaded: true } } +0ms
  cypress:server:browsers opening browser { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '131.0.6778.205', path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', minSupportedVersion: 64, majorVersion: '131', isHeadless: false, isHeaded: true } +1ms
  cypress:server:browsers:chrome reading chrome preferences... { userDir: 'C:\\Users\\Alex\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\chrome-stable\\run-13572', CHROME_PREFERENCE_PATHS: { default: 'Default\\Preferences', defaultSecure: 'Default\\Secure Preferences', localState: 'Local State' } } +0ms
  cypress:lifecycle:EventRegistrar plugin event registered? { eventName: 'before:browser:launch', isRegistered: true } +7ms
  cypress:lifecycle:EventRegistrar execute plugin event 'before:browser:launch' Node 'v18.17.1' with args: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '131.0.6778.205', path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', minSupportedVersion: 64, majorVersion: '131', isHeadless: false, isHeaded: true } { preferences: { default: {}, defaultSecure: {}, localState: {} }, args: [ '--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-single-click-autofill', '--disable-prompt-on-repos', '--disable-background-timer-throttling', '--disable-renderer-backgrounding', '--disable-renderer-throttling', '--disable-backgrounding-occluded-windows', '--disable-restore-session-state', '--disable-new-profile-management', '--disable-new-avatar-menu', '--allow-insecure-localhost', '--reduce-security-for-testing', '--enable-automation', '--disable-print-preview', '--disable-component-extensions-with-background-pages', '--disable-infobars', '--disable-device-discovery-notifications', '--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-download-protection', '--disable-client-side-phishing-detection', '--disable-component-update', "--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'", '--disable-default-apps', '--disable-features=Translate,PrivacySandboxSettings4', '--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-dev-shm-usage', '--enable-precise-memory-info', '--proxy-server=http://localhost:49158', '--proxy-bypass-list=<-loopback>', '--remote-debugging-port=49161', '--remote-debugging-address=127.0.0.1' ], extensions: [], env: {} } undefined +0ms
  cypress:lifecycle:ProjectConfigManager call event before:browser:launch for invocation id inv1 +727ms
  cypress:lifecycle:child:RunPlugins:11616 execute plugin event: before:browser:launch ({ invocationId: 'inv1', eventId: 4 }) +729ms
  cypress:lifecycle:ProjectConfigManager promise resolved for id 'inv1' with value {
  preferences: { default: {}, defaultSecure: {}, localState: {} },
  args: [
    '--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-single-click-autofill',
    '--disable-prompt-on-repos',
    '--disable-background-timer-throttling',
    '--disable-renderer-backgrounding',
    '--disable-renderer-throttling',
    '--disable-backgrounding-occluded-windows',
    '--disable-restore-session-state',
    '--disable-new-profile-management',
    '--disable-new-avatar-menu',
    '--allow-insecure-localhost',
    '--reduce-security-for-testing',
    '--enable-automation',
    '--disable-print-preview',
    '--disable-component-extensions-with-background-pages',
    '--disable-infobars',
    '--disable-device-discovery-notifications',
    '--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-download-protection',
    '--disable-client-side-phishing-detection',
    '--disable-component-update',
    "--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'",
    '--disable-default-apps',
    '--disable-features=Translate,PrivacySandboxSettings4',
    '--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-dev-shm-usage',
    '--enable-precise-memory-info',
    '--proxy-server=http://localhost:49158',
    '--proxy-bypass-list=<-loopback>',
    '--remote-debugging-port=49161',
    '--remote-debugging-address=127.0.0.1',
    '--start-maximized',
    '--lang=en'
  ],
  extensions: [],
  env: {}
} +1ms
  cypress:server:appdata path: C:\Users\Alex\AppData\Roaming\Cypress\cy\production\extensions +655ms
  cypress:server:browsers:chrome launching in chrome with debugging port { url: 'http://localhost:49158/__/#/specs/runner?file=cypress\\e2e\\test.cy.js', args: [ '--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-single-click-autofill', '--disable-prompt-on-repos', '--disable-background-timer-throttling', '--disable-renderer-backgrounding', '--disable-renderer-throttling', '--disable-backgrounding-occluded-windows', '--disable-restore-session-state', '--disable-new-profile-management', '--disable-new-avatar-menu', '--allow-insecure-localhost', '--reduce-security-for-testing', '--enable-automation', '--disable-print-preview', '--disable-component-extensions-with-background-pages', '--disable-infobars', '--disable-device-discovery-notifications', '--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-download-protection', '--disable-client-side-phishing-detection', '--disable-component-update', "--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'", '--disable-default-apps', '--disable-features=Translate,PrivacySandboxSettings4', '--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-dev-shm-usage', '--enable-precise-memory-info', '--proxy-server=http://localhost:49158', '--proxy-bypass-list=<-loopback>', '--remote-debugging-port=49161', '--remote-debugging-address=127.0.0.1', '--start-maximized', '--lang=en', '--load-extension=C:\\Users\\Alex\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\chrome-stable\\run-13572\\CypressExtension,C:\\Users\\Alex\\AppData\\Local\\Cypress\\Cache\\13.17.0\\Cypress\\resources\\app\\packages\\extension\\theme', '--user-data-dir=C:\\Users\\Alex\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\chrome-stable\\run-13572', '--disk-cache-dir=C:\\Users\\Alex\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\chrome-stable\\run-13572\\CypressCache' ], port: 49161 } +22ms
  cypress:launcher:browsers launching browser { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '131.0.6778.205', path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', minSupportedVersion: 64, majorVersion: '131', isHeadless: false, isHeaded: true }, url: 'about:blank' } +0ms

Other

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant