Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit dff5c46

Browse files
committed
Add connectOverCDP to JestPlaywrightProjectConfig
1 parent 362bede commit dff5c46

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/PlaywrightEnvironment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ const getBrowserPerProcess = async (
6868
}
6969

7070
const options = getBrowserOptions(browserType, connectOptions)
71-
return options?.endpointURL ? playwrightInstance.connectOverCDP(options) : playwrightInstance.connect(options);
71+
return options?.endpointURL
72+
? playwrightInstance.connectOverCDP(options)
73+
: playwrightInstance.connect(options)
7274
}
7375

7476
const getDeviceConfig = (

types/global.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ type LaunchType = typeof LAUNCH | typeof SERVER | typeof PERSISTENT
192192

193193
type Options<T> = T & Partial<Record<BrowserType, T>>
194194

195-
export type ConnectOptions = Parameters<GenericBrowser['connect']>[0]
195+
export type ConnectOptions = Parameters<GenericBrowser['connect']>[0] & {
196+
endpointURL?: string
197+
}
196198

197199
export type ServerOptions = JestProcessManagerOptions & {
198200
teardown?: string

0 commit comments

Comments
 (0)