Files
cypress/system-tests/test/pause_headed_exit_spec.ts
T
Cacie Prins ed796256e2 chore: do not run pause() system test in webkit (#31497)
* chore: do not run pause() system test in webkit

* link to webkit cy.pause flake issue
2025-04-14 13:41:56 -04:00

87 lines
2.3 KiB
TypeScript

import systemTests from '../lib/system-tests'
import childProcess from 'child_process'
// these system tests are skipped in webkit due to flake.
// TODO: https://github.com/cypress-io/cypress/issues/31503
describe('cy.pause() in run mode', () => {
systemTests.setup()
systemTests.it('pauses with --headed and --no-exit', {
spec: 'pause.cy.js',
config: {
env: {
'SHOULD_PAUSE': true,
},
},
snapshot: true,
headed: true,
noExit: true,
expectedExitCode: null,
browser: '!webkit',
onSpawn: (cp) => {
cp.stdout.on('data', (buf) => {
if (buf.toString().includes('not exiting due to options.exit being false')) {
// systemTests.it spawns a new node process which then spawns the actual cypress process
// Killing just the new node process doesn't kill the cypress process so we find it and kill it manually
childProcess.execSync(`kill $(pgrep -P ${cp.pid} | awk '{print $1}')`)
cp.kill()
}
})
},
})
systemTests.it('does not pause if headless', {
spec: 'pause.cy.js',
config: {
env: {
'SHOULD_PAUSE': false,
},
},
snapshot: true,
headed: false,
noExit: true,
expectedExitCode: null,
browser: '!webkit',
onSpawn: (cp) => {
cp.stdout.on('data', (buf) => {
if (buf.toString().includes('not exiting due to options.exit being false')) {
// systemTests.it spawns a new node process which then spawns the actual cypress process
// Killing just the new node process doesn't kill the cypress process so we find it and kill it manually
childProcess.execSync(`kill $(pgrep -P ${cp.pid} | awk '{print $1}')`)
cp.kill()
}
})
},
})
// TODO: fix this failing test in 10.0
systemTests.it.skip('does not pause without --no-exit', {
spec: 'pause.cy.js',
config: {
env: {
'SHOULD_PAUSE': false,
},
},
snapshot: true,
headed: true,
noExit: false,
expectedExitCode: 0,
browser: '!webkit',
})
systemTests.it('does not pause without --headed and --no-exit', {
spec: 'pause.cy.js',
config: {
env: {
'SHOULD_PAUSE': false,
},
},
snapshot: true,
headed: false,
noExit: false,
expectedExitCode: 0,
browser: '!webkit',
})
})