Skip to content

Commit 77946e4

Browse files
mjhenkesmarktnoonan
authored andcommitted
fix: call screencastOpts as a function for starting a screencast on electron. (cypress-io#23001)
Co-authored-by: Mark Noonan <mark@cypress.io>
1 parent d681fd9 commit 77946e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/server/lib/browsers/electron.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ const _getAutomation = async function (win, options, parent) {
6868
if (message !== 'take:screenshot') {
6969
return fn(message, data)
7070
}
71-
72-
await sendCommand('Page.startScreencast', screencastOpts)
71+
await sendCommand('Page.startScreencast', screencastOpts())
7372

7473
const ret = await fn(message, data)
7574

@@ -103,15 +102,14 @@ const _maybeRecordVideo = function (webContents, options) {
103102
if (!onScreencastFrame) {
104103
return
105104
}
106-
107105
webContents.debugger.on('message', (event, method, params) => {
108106
if (method === 'Page.screencastFrame') {
109107
onScreencastFrame(params)
110108
webContents.debugger.sendCommand('Page.screencastFrameAck', { sessionId: params.sessionId })
111109
}
112110
})
113111

114-
await webContents.debugger.sendCommand('Page.startScreencast', screencastOpts)
112+
await webContents.debugger.sendCommand('Page.startScreencast', screencastOpts())
115113
}
116114
}
117115

packages/server/lib/modes/record.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,8 @@ const createRunAndRecordSpecs = (options = {}) => {
791791
})
792792

793793
if (response === responseDidFail) {
794+
debug('`responseDidFail` equals `response`, allowing browser to hang until it is killed: Response %o', { responseDidFail })
795+
794796
// dont call the cb, let the browser hang until it's killed
795797
return
796798
}

0 commit comments

Comments
 (0)