mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-03 05:20:38 -05:00
a045e4f59a
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>
34 lines
683 B
JavaScript
34 lines
683 B
JavaScript
const systemTests = require('../lib/system-tests').default
|
|
|
|
const onServer = function (app) {
|
|
app.get('/agent', (req, res) => {
|
|
const agent = req.headers['user-agent']
|
|
|
|
return res.send(`<html><span id='agent'>${agent}</span></html>`)
|
|
})
|
|
|
|
return app.put('/agent', (req, res) => {
|
|
return res.json({
|
|
userAgent: req.headers['user-agent'],
|
|
})
|
|
})
|
|
}
|
|
|
|
describe('e2e user agent', () => {
|
|
systemTests.setup({
|
|
servers: {
|
|
port: 4545,
|
|
onServer,
|
|
},
|
|
settings: {
|
|
userAgent: 'foo bar baz agent',
|
|
baseUrl: 'http://localhost:4545',
|
|
},
|
|
})
|
|
|
|
systemTests.it('passes', {
|
|
spec: 'user_agent_spec.js',
|
|
snapshot: true,
|
|
})
|
|
})
|