Skip to content

Commit 3ddfe99

Browse files
combine spec files
1 parent 9345bb0 commit 3ddfe99

File tree

5 files changed

+62
-65
lines changed

5 files changed

+62
-65
lines changed

system-tests/__snapshots__/pause_headed_exit_spec.ts.js

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports['cy.pause() works with --headed and --no-exit / pauses with --headed and --no-exit'] = `
1+
exports['cy.pause() in run mode / pauses with --headed and --no-exit'] = `
22
33
====================================================================================================
44
@@ -27,7 +27,7 @@ not exiting due to options.exit being false
2727
2828
`
2929

30-
exports['cy.pause() works with --headed and --no-exit / does not pause if headless'] = `
30+
exports['cy.pause() in run mode / does not pause if headless'] = `
3131
3232
====================================================================================================
3333
@@ -56,7 +56,7 @@ not exiting due to options.exit being false
5656
5757
`
5858

59-
exports['cy.pause() works with --headed and --no-exit / does not pause without --no-exit'] = `
59+
exports['cy.pause() in run mode / does not pause without --no-exit'] = `
6060
6161
====================================================================================================
6262
@@ -65,14 +65,14 @@ exports['cy.pause() works with --headed and --no-exit / does not pause without -
6565
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
6666
│ Cypress: 1.2.3 │
6767
│ Browser: FooBrowser 88 │
68-
│ Specs: 1 found (no_pause_spec.js) │
69-
│ Searched: cypress/integration/no_pause_spec.js │
68+
│ Specs: 1 found (pause_spec.js)
69+
│ Searched: cypress/integration/pause_spec.js
7070
└────────────────────────────────────────────────────────────────────────────────────────────────┘
7171
7272
7373
────────────────────────────────────────────────────────────────────────────────────────────────────
7474
75-
Running: no_pause_spec.js (1 of 1)
75+
Running: pause_spec.js (1 of 1)
7676
7777
7878
cy.pause()
@@ -81,13 +81,6 @@ exports['cy.pause() works with --headed and --no-exit / does not pause without -
8181
8282
1 passing
8383
84-
Warning: We failed processing this video.
85-
86-
This error will not alter the exit code.
87-
88-
TimeoutError: operation timed out
89-
[stack trace lines]
90-
9184
9285
(Results)
9386
@@ -98,27 +91,33 @@ TimeoutError: operation timed out
9891
│ Pending: 0 │
9992
│ Skipped: 0 │
10093
│ Screenshots: 0 │
101-
│ Video: false
94+
│ Video: true
10295
│ Duration: X seconds │
103-
│ Spec Ran: no_pause_spec.js │
96+
│ Spec Ran: pause_spec.js
10497
└────────────────────────────────────────────────────────────────────────────────────────────────┘
10598
10699
100+
(Video)
101+
102+
- Started processing: Compressing to 32 CRF
103+
- Finished processing: /XXX/XXX/XXX/cypress/videos/pause_spec.js.mp4 (X second)
104+
105+
107106
====================================================================================================
108107
109108
(Run Finished)
110109
111110
112111
Spec Tests Passing Failing Pending Skipped
113112
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
114-
│ ✔ no_pause_spec.js XX:XX 1 1 - - - │
113+
│ ✔ pause_spec.js XX:XX 1 1 - - - │
115114
└────────────────────────────────────────────────────────────────────────────────────────────────┘
116115
✔ All specs passed! XX:XX 1 1 - - -
117116
118117
119118
`
120119

121-
exports['cy.pause() works with --headed and --no-exit / does not pause without --headed and --no-exit'] = `
120+
exports['cy.pause() in run mode / does not pause without --headed and --no-exit'] = `
122121
123122
====================================================================================================
124123
@@ -127,14 +126,14 @@ exports['cy.pause() works with --headed and --no-exit / does not pause without -
127126
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
128127
│ Cypress: 1.2.3 │
129128
│ Browser: FooBrowser 88 │
130-
│ Specs: 1 found (no_pause_spec.js) │
131-
│ Searched: cypress/integration/no_pause_spec.js │
129+
│ Specs: 1 found (pause_spec.js)
130+
│ Searched: cypress/integration/pause_spec.js
132131
└────────────────────────────────────────────────────────────────────────────────────────────────┘
133132
134133
135134
────────────────────────────────────────────────────────────────────────────────────────────────────
136135
137-
Running: no_pause_spec.js (1 of 1)
136+
Running: pause_spec.js (1 of 1)
138137
139138
140139
cy.pause()
@@ -143,13 +142,6 @@ exports['cy.pause() works with --headed and --no-exit / does not pause without -
143142
144143
1 passing
145144
146-
Warning: We failed processing this video.
147-
148-
This error will not alter the exit code.
149-
150-
TimeoutError: operation timed out
151-
[stack trace lines]
152-
153145
154146
(Results)
155147
@@ -160,20 +152,26 @@ TimeoutError: operation timed out
160152
│ Pending: 0 │
161153
│ Skipped: 0 │
162154
│ Screenshots: 0 │
163-
│ Video: false
155+
│ Video: true
164156
│ Duration: X seconds │
165-
│ Spec Ran: no_pause_spec.js │
157+
│ Spec Ran: pause_spec.js
166158
└────────────────────────────────────────────────────────────────────────────────────────────────┘
167159
168160
161+
(Video)
162+
163+
- Started processing: Compressing to 32 CRF
164+
- Finished processing: /XXX/XXX/XXX/cypress/videos/pause_spec.js.mp4 (X second)
165+
166+
169167
====================================================================================================
170168
171169
(Run Finished)
172170
173171
174172
Spec Tests Passing Failing Pending Skipped
175173
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
176-
│ ✔ no_pause_spec.js XX:XX 1 1 - - - │
174+
│ ✔ pause_spec.js XX:XX 1 1 - - - │
177175
└────────────────────────────────────────────────────────────────────────────────────────────────┘
178176
✔ All specs passed! XX:XX 1 1 - - -
179177

system-tests/lib/docker.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@ class DockerProcess extends EventEmitter implements SpawnerResult {
105105
)
106106
}
107107

108-
kill () {
109-
log('.kill not implemented for DockerProcess.')
110-
111-
return false
108+
kill (): boolean {
109+
throw new Error('.kill not implemented for DockerProcess.')
112110
}
113111
}
114112

system-tests/projects/e2e/cypress/integration/no_pause_spec.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

system-tests/projects/e2e/cypress/integration/pause_spec.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ describe('cy.pause()', () => {
1717
})
1818

1919
cy.pause().wrap({}).should('deep.eq', {}).then(function () {
20-
expect(didPause).to.be.true
20+
if (Cypress.env('SHOULD_PAUSE')) {
21+
expect(didPause).to.be.true
2122

22-
// should no longer have onPaused
23-
expect(cy.state('onPaused')).to.be.null
23+
// should no longer have onPaused
24+
expect(cy.state('onPaused')).to.be.null
25+
} else {
26+
expect(didPause).to.be.false
27+
}
2428
})
2529
})
2630
})

system-tests/test/pause_headed_exit_spec.ts

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ describe('cy.pause() in run mode', () => {
55

66
systemTests.it('pauses with --headed and --no-exit', {
77
spec: 'pause_spec.js',
8+
config: {
9+
env: {
10+
'SHOULD_PAUSE': true,
11+
},
12+
},
813
snapshot: true,
914
headed: true,
1015
noExit: true,
@@ -19,7 +24,12 @@ describe('cy.pause() in run mode', () => {
1924
})
2025

2126
systemTests.it('does not pause if headless', {
22-
spec: 'no_pause_spec.js',
27+
spec: 'pause_spec.js',
28+
config: {
29+
env: {
30+
'SHOULD_PAUSE': false,
31+
},
32+
},
2333
snapshot: true,
2434
headed: false,
2535
noExit: true,
@@ -34,16 +44,26 @@ describe('cy.pause() in run mode', () => {
3444
})
3545

3646
systemTests.it('does not pause without --no-exit', {
37-
spec: 'no_pause_spec.js',
38-
snapshot: false,
47+
spec: 'pause_spec.js',
48+
config: {
49+
env: {
50+
'SHOULD_PAUSE': false,
51+
},
52+
},
53+
snapshot: true,
3954
headed: true,
4055
noExit: false,
4156
expectedExitCode: 0,
4257
})
4358

4459
systemTests.it('does not pause without --headed and --no-exit', {
45-
spec: 'no_pause_spec.js',
46-
snapshot: false,
60+
spec: 'pause_spec.js',
61+
config: {
62+
env: {
63+
'SHOULD_PAUSE': false,
64+
},
65+
},
66+
snapshot: true,
4767
headed: false,
4868
noExit: false,
4969
expectedExitCode: 0,

0 commit comments

Comments
 (0)