diff --git a/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app.cy.js b/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app.cy.js index 7696b3805a64..6655ffce2865 100644 --- a/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app.cy.js +++ b/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app.cy.js @@ -8,5 +8,5 @@ it('asserts on browser args', () => { return } - cy.task('assertPsOutput') + cy.task('assertPsOutput', Cypress.browser.name) }) diff --git a/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app_spec2.js b/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app_spec2.js index ddfbfb4f0f25..8556e56cb660 100644 --- a/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app_spec2.js +++ b/system-tests/projects/plugin-before-browser-launch-deprecation/cypress/e2e/app_spec2.js @@ -8,5 +8,5 @@ it('2 - asserts on browser args', () => { return } - cy.task('assertPsOutput') + cy.task('assertPsOutput', Cypress.browser.name) }) diff --git a/system-tests/projects/plugin-before-browser-launch-deprecation/plugins/index.js b/system-tests/projects/plugin-before-browser-launch-deprecation/plugins/index.js index 8ced89f538ca..ca5138f50890 100644 --- a/system-tests/projects/plugin-before-browser-launch-deprecation/plugins/index.js +++ b/system-tests/projects/plugin-before-browser-launch-deprecation/plugins/index.js @@ -26,13 +26,22 @@ const getHandlersByType = (type) => { return { onBeforeBrowserLaunch (browser, launchOptions) { // this will emit a warning but only once - launchOptions = launchOptions.concat(['--foo']) - launchOptions.push('--foo=bar') - launchOptions.unshift('--load-extension=/foo/bar/baz.js') + // with firefox & geckodriver, you cannot pipe extraneous arguments to the browser or else the browser will fail to launch + if (browser.name === 'firefox') { + launchOptions = launchOptions.concat(['-height', `768`, '-width', '1366']) + } else { + launchOptions = launchOptions.concat(['--foo']) + launchOptions.push('--foo=bar') + launchOptions.unshift('--load-extension=/foo/bar/baz.js') + } return launchOptions }, - onTask: { assertPsOutput: assertPsOutput(['--foo', '--foo=bar']) }, + onTask: { + assertPsOutput (args) { + return args === 'firefox' ? assertPsOutput(['-height', '-width']) : assertPsOutput(['--foo', '--foo=bar']) + }, + }, } case 'return-new-array-without-mutation': @@ -50,12 +59,22 @@ const getHandlersByType = (type) => { return { onBeforeBrowserLaunch (browser, launchOptions) { // this will NOT emit a warning - launchOptions.args.push('--foo') - launchOptions.args.unshift('--bar') + // with firefox & geckodriver, you cannot pipe extraneous arguments to the browser or else the browser will fail to launch + if (browser.name === 'firefox') { + launchOptions.args.push('-height', '768') + launchOptions.args.push('-width', '1366') + } else { + launchOptions.args.push('--foo') + launchOptions.args.unshift('--bar') + } return launchOptions }, - onTask: { assertPsOutput: assertPsOutput(['--foo', '--bar']) }, + onTask: { + assertPsOutput (args) { + return args === 'firefox' ? assertPsOutput(['-height', '-width']) : assertPsOutput(['--foo', '--bar']) + }, + }, } case 'return-undefined-mutate-array': diff --git a/system-tests/projects/screen-size/cypress/e2e/default_size.cy.js b/system-tests/projects/screen-size/cypress/e2e/default_size.cy.js index d9c447ad2f81..0c60218985d1 100644 --- a/system-tests/projects/screen-size/cypress/e2e/default_size.cy.js +++ b/system-tests/projects/screen-size/cypress/e2e/default_size.cy.js @@ -32,8 +32,7 @@ describe('windowSize', () => { // availHeight: top.screen.availHeight, }).deep.eq({ innerWidth: 1280, - // NOTE: Firefox 130.0 with the default sizing is a pixel short, which we are accounting for here - innerHeight: Cypress.browser.name === 'firefox' ? 719 : 720, + innerHeight: 720, // screenWidth: 1280, // screenHeight: 720, // availWidth: 1280, diff --git a/system-tests/test/firefox_spec.ts b/system-tests/test/firefox_spec.ts index 04f8ca92f205..20595e38c197 100644 --- a/system-tests/test/firefox_spec.ts +++ b/system-tests/test/firefox_spec.ts @@ -48,10 +48,14 @@ describe('e2e firefox', function () { // snapshot: true, }) - systemTests.it('launches maximized by default', { + // we only launch maximized by default headfully. Otherwise, we launch 1280x720 by default in headless. + // the default size of firefox headless is 1366x768 so this test will never pass headlessly + // @see https://github.com/mozilla/geckodriver/issues/1354#issuecomment-479456411 + systemTests.it('launches maximized by default (headful)', { browser: 'firefox', project: 'screen-size', spec: 'maximized.cy.js', + headed: true, onRun: async (exec) => { const { stderr } = await exec({ processEnv: {