diff --git a/src/driver.ts b/src/driver.ts index cadf180761744..cd8e7b2a228d0 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -63,3 +63,6 @@ export function runServer() { (playwright as any).electron = new Electron(); new PlaywrightDispatcher(dispatcherConnection.rootDispatcher(), playwright); } + +if (process.argv[2] === 'serve') + runServer(); diff --git a/test/fixtures.ts b/test/fixtures.ts index 6cf6b1028fd7e..369cabe070388 100644 --- a/test/fixtures.ts +++ b/test/fixtures.ts @@ -92,7 +92,7 @@ fixtures.overrideWorkerFixture('playwright', async ({ browserName, testWorkerInd if (wire) { require('../lib/utils/utils').setUnderTest(); const connection = new Connection(); - const spawnedProcess = childProcess.fork(path.join(__dirname, '..', 'lib', 'server.js'), [], { + const spawnedProcess = childProcess.fork(path.join(__dirname, '..', 'lib', 'driver.js'), ['serve'], { stdio: 'pipe', detached: true, });