diff --git a/packages/playwright/src/runner/testServer.ts b/packages/playwright/src/runner/testServer.ts index 50a8de366e928f..7150f5fd81c95f 100644 --- a/packages/playwright/src/runner/testServer.ts +++ b/packages/playwright/src/runner/testServer.ts @@ -305,13 +305,14 @@ export class TestServerDispatcher implements TestServerInterface { ...(this._configCLIOverrides.use || {}), trace: params.trace === 'on' ? { mode: 'on', sources: false, _live: true } : (params.trace === 'off' ? 'off' : undefined), video: params.video === 'on' ? 'on' : (params.video === 'off' ? 'off' : undefined), - headless: params.headed ? false : undefined, _optionContextReuseMode: params.reuseContext ? 'when-possible' : undefined, _optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : undefined, }, ...(params.updateSnapshots ? { updateSnapshots: params.updateSnapshots } : {}), ...(params.workers ? { workers: params.workers } : {}), }; + if (params.headed !== undefined) + overrides.use.headless = !params.headed; if (params.trace === 'on') process.env.PW_LIVE_TRACE_STACKS = '1'; else