Skip to content

Commit 2c06050

Browse files
authored
Using passed wsEndpoint (#367)
1 parent a87a9a5 commit 2c06050

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/PlaywrightRunner.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ class PlaywrightRunner extends JestRunner {
8282
}
8383

8484
async getTests(tests: Test[], config: JestPlaywrightConfig): Promise<Test[]> {
85-
const { browsers, devices, launchType, launchOptions } = config
85+
const {
86+
browsers,
87+
devices,
88+
launchType,
89+
launchOptions,
90+
connectOptions,
91+
} = config
8692
let resultDevices: (string | CustomDeviceType)[] = []
8793
const pwTests: Test[] = []
8894
for (const test of tests) {
@@ -91,8 +97,8 @@ class PlaywrightRunner extends JestRunner {
9197
const { devices: availableDevices, instance } = getPlaywrightInstance(
9298
browser,
9399
)
94-
let wsEndpoint: WsEndpointType = null
95-
if (launchType === SERVER) {
100+
let wsEndpoint: WsEndpointType = connectOptions?.wsEndpoint || null
101+
if (launchType === SERVER && wsEndpoint === null) {
96102
if (!this.browser2Server[browser]) {
97103
const options = getBrowserOptions(browser, launchOptions)
98104
this.browser2Server[browser] = await instance.launchServer(options)

0 commit comments

Comments
 (0)