Files
cypress/system-tests/test/stdout_spec.js
Jessica Sachs a045e4f59a chore: move server e2e tests to system-tests (#16354)
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Zach Bloomquist <git@chary.us>
Co-authored-by: Zach Bloomquist <github@chary.us>
2021-10-18 19:53:14 +00:00

72 lines
1.7 KiB
JavaScript

const systemTests = require('../lib/system-tests').default
describe('e2e stdout', () => {
systemTests.setup({
servers: [{
port: 1777,
https: true,
onServer: (app) => {
app.get('/', (req, res) => {
res.set('content-type', 'text/html').end('it worked')
})
},
}],
settings: {
hosts: {
'www.google.com': '127.0.0.1',
'www.apple.com': '127.0.0.1',
'*.cypress.io': '127.0.0.1',
},
},
})
it('displays errors from failures', function () {
return systemTests.exec(this, {
port: 2020,
snapshot: true,
spec: 'stdout_failing_spec.js',
expectedExitCode: 3,
})
})
it('displays errors from exiting early due to bundle errors', function () {
return systemTests.exec(this, {
spec: 'stdout_exit_early_failing_spec.js',
snapshot: true,
expectedExitCode: 1,
onStdout: systemTests.normalizeWebpackErrors,
})
})
it('does not duplicate suites or tests between visits', function () {
return systemTests.exec(this, {
spec: 'stdout_passing_spec.js',
timeout: 120000,
snapshot: true,
})
})
it('respects quiet mode', function () {
return systemTests.exec(this, {
spec: 'stdout_passing_spec.js',
timeout: 120000,
snapshot: true,
quiet: true,
})
})
it('displays fullname of nested specfile', function () {
return systemTests.exec(this, {
port: 2020,
snapshot: true,
spec: 'nested-1/nested-2/nested-3/*',
})
})
systemTests.it('displays assertion errors', {
spec: 'stdout_assertion_errors_spec.js',
snapshot: true,
expectedExitCode: 4,
})
})