Skip to content

Commit

Permalink
fix headless e2e spec for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
kuceb committed Dec 19, 2019
1 parent 71ec063 commit 8c1fefe
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
6 changes: 3 additions & 3 deletions packages/server/__snapshots__/2_headless_spec.ts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports['e2e headless / tests in headless mode pass'] = `
exports['e2e headless / tests in headed mode pass in !electron'] = `
====================================================================================================
Expand Down Expand Up @@ -61,7 +61,7 @@ exports['e2e headless / tests in headless mode pass'] = `
`

exports['e2e headless / tests in headed mode pass [chrome]'] = `
exports['e2e headless / tests in headless mode pass'] = `
====================================================================================================
Expand Down Expand Up @@ -124,7 +124,7 @@ exports['e2e headless / tests in headed mode pass [chrome]'] = `
`

exports['e2e headless / tests in headed mode pass [electron]'] = `
exports['e2e headless / tests in headed mode pass in electron'] = `
====================================================================================================
Expand Down
29 changes: 16 additions & 13 deletions packages/server/test/e2e/2_headless_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ const e2e = require('../support/helpers/e2e')
describe('e2e headless', function () {
e2e.setup()

// cypress run
// cypress run --headless
e2e.it('tests in headless mode pass', {
spec: 'headless_spec.js',
browser: ['chrome', 'electron'],
config: {
env: {
'CI': process.env.CI,
Expand All @@ -18,18 +19,20 @@ describe('e2e headless', function () {
})

// cypress run --headed
e2e.it('tests in headed mode pass', {
spec: 'headless_spec.js',
config: {
env: {
'CI': process.env.CI,
// currently, Electron differs because it displays a
// "can not record video in headed mode" error
;['electron', '!electron'].map((b) => {
e2e.it(`tests in headed mode pass in ${b}`, {
spec: 'headless_spec.js',
config: {
env: {
'CI': process.env.CI,
},
},
},
expectedExitCode: 0,
headed: true,
snapshot: true,
// currently, Electron differs because it displays a
// "can not record video in headed mode" error
useSeparateBrowserSnapshots: true,
expectedExitCode: 0,
headed: true,
snapshot: true,
browser: b,
})
})
})
4 changes: 2 additions & 2 deletions packages/server/test/support/helpers/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ function getBrowsers (browserPattern) {
let selected = []

const addBrowsers = _.clone(browserPattern)
const removeBrowsers = _.remove(addBrowsers, (b) => b.startsWith('!'))
const removeBrowsers = _.remove(addBrowsers, (b) => b.startsWith('!')).map((b) => b.slice(1))

if (removeBrowsers.length) {
selected = _.without(AVAILABLE_BROWSERS, removeBrowsers.map((b) => b.slice(1)))
selected = _.without(AVAILABLE_BROWSERS, ...removeBrowsers)
} else {
selected = _.intersection(AVAILABLE_BROWSERS, addBrowsers)
}
Expand Down

1 comment on commit 8c1fefe

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 8c1fefe Dec 19, 2019

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.1/linux-x64/circle-issue-1096-firefox-support-8c1fefebe96126f04b58cbef5f608182fbe972bc-220412/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.1/circle-issue-1096-firefox-support-8c1fefebe96126f04b58cbef5f608182fbe972bc-220403/cypress.tgz

Please sign in to comment.