-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathbrowser_crash_handling_spec.js
82 lines (75 loc) · 2.39 KB
/
browser_crash_handling_spec.js
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const systemTests = require('../lib/system-tests').default
describe('Browser Crash Handling', () => {
systemTests.setup({
settings: {
e2e: {},
},
})
// It should fail the chrome_tab_crash spec, but the simple spec should run and succeed
context('when the tab crashes in chrome', () => {
systemTests.it('fails', {
browser: 'chrome',
spec: 'chrome_tab_crash.cy.js,simple.cy.js',
snapshot: true,
expectedExitCode: 1,
})
})
// It should fail the chrome_tab_crash spec, but the simple spec should run and succeed
context('when the tab crashes in electron', () => {
systemTests.it('fails', {
browser: 'electron',
spec: 'chrome_tab_crash.cy.js,simple.cy.js',
snapshot: true,
expectedExitCode: 1,
})
})
// It should fail the chrome_tab_crash spec, but the simple spec should run and succeed
context('when the browser process crashes in chrome', () => {
systemTests.it('fails w/ video off', {
browser: 'chrome',
spec: 'chrome_process_crash.cy.js,simple.cy.js',
snapshot: true,
expectedExitCode: 1,
config: {
video: false,
},
onStdout: (stdout) => {
// the location of this warning is non-deterministic
return stdout.replace('The automation client disconnected. Cannot continue running tests.\n', '')
},
})
systemTests.it('fails w/ video on', {
browser: 'chrome',
spec: 'chrome_process_crash.cy.js,simple.cy.js',
snapshot: true,
expectedExitCode: 1,
config: {
video: true,
},
onStdout: (stdout) => {
// the location of this warning is non-deterministic
return stdout.replace('The automation client disconnected. Cannot continue running tests.\n', '')
},
})
})
// If chrome crashes, all of cypress crashes when in electron
context('when the browser process crashes in electron', () => {
systemTests.it('fails', {
browser: 'electron',
spec: 'chrome_process_crash.cy.js,simple.cy.js',
snapshot: true,
expectedExitCode: 1,
})
})
context('when the window closes mid launch of the browser process', () => {
systemTests.it('passes', {
browser: 'electron',
spec: 'abort_beforeunload_event_child.cy.ts,abort_beforeunload_event.cy.ts',
snapshot: true,
expectedExitCode: 0,
config: {
video: false,
},
})
})
})