Skip to content

Commit

Permalink
fix other failing tests [run ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Sep 19, 2024
1 parent 21b06a4 commit 1855d0d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ it('asserts on browser args', () => {
return
}

cy.task('assertPsOutput')
cy.task('assertPsOutput', Cypress.browser.name)
})
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ it('2 - asserts on browser args', () => {
return
}

cy.task('assertPsOutput')
cy.task('assertPsOutput', Cypress.browser.name)
})
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion system-tests/test/firefox_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

1 comment on commit 1855d0d

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 1855d0d Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.14.3/linux-x64/misc/remove_marionette_for_geckodriver-1855d0d1707368c1cf9447941aaee735f2e17c93/cypress.tgz

Please sign in to comment.