forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcy_origin_retries_spec.ts
50 lines (44 loc) · 1.42 KB
/
cy_origin_retries_spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import path from 'path'
import systemTests, { expect } from '../lib/system-tests'
import Fixtures from '../lib/fixtures'
const e2ePath = Fixtures.projectPath('e2e')
const PORT = 3500
const onServer = function (app) {
app.get('/secondary_origin.html', (_, res) => {
res.sendFile(path.join(e2ePath, `secondary_origin.html`))
})
}
describe('e2e cy.origin retries', () => {
systemTests.setup({
servers: [{
port: 4466,
onServer,
}],
settings: {
hosts: {
'*.foobar.com': '127.0.0.1',
},
e2e: {},
},
})
systemTests.it('Appropriately displays test retry errors without other side effects', {
browser: '!webkit', // TODO(webkit): fix+unskip (needs multidomain support)
// keep the port the same to prevent issues with the snapshot
port: PORT,
spec: 'cy_origin_retries.cy.ts',
snapshot: true,
expectedExitCode: 1,
config: {
retries: 2,
},
async onRun (exec) {
const res = await exec()
// verify that retrying tests with cy.origin doesn't cause serialization problems to spec bridges on test:before:run:async
expect(res.stdout).not.to.contain('TypeError')
expect(res.stdout).not.to.contain('Cannot set property message')
expect(res.stdout).not.to.contain('which has only a getter')
expect(res.stdout).to.contain('AssertionError')
expect(res.stdout).to.contain('expected true to be false')
},
})
})