diff options
| -rw-r--r-- | gui/test/e2e/mocked/mocked-utils.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gui/test/e2e/mocked/mocked-utils.ts b/gui/test/e2e/mocked/mocked-utils.ts index 19e7ad00f4..1840ebbbb0 100644 --- a/gui/test/e2e/mocked/mocked-utils.ts +++ b/gui/test/e2e/mocked/mocked-utils.ts @@ -55,13 +55,17 @@ type SendMockIpcResponseProps<T> = { response: T; }; -export type SendMockIpcResponse = ReturnType<typeof generateMockIpcHandle>; +export type SendMockIpcResponse = ReturnType<typeof generateSendMockIpcResponse>; export const generateSendMockIpcResponse = (electronApp: ElectronApplication) => { return async <T>({ channel, response }: SendMockIpcResponseProps<T>) => { await electronApp.evaluate( ({ webContents }, { channel, response }) => { - webContents.getAllWebContents()[0].send(channel, response); + webContents + .getAllWebContents() + // Select window that isn't devtools + .find((webContents) => webContents.getURL().startsWith('file://'))! + .send(channel, response); }, { channel, response }, ); |
