diff --git a/test/api/TestUtils.ts b/test/api/TestUtils.ts index 9ebf67b6..cee59cce 100644 --- a/test/api/TestUtils.ts +++ b/test/api/TestUtils.ts @@ -74,9 +74,10 @@ export function getBrowserType(): playwright.BrowserType { +export function launchBrowser(opts?: playwright.LaunchOptions): Promise { const browserType = getBrowserType(); - const options: Record = { + const options: playwright.LaunchOptions = { + ...opts, headless: process.argv.includes('--headless') }; diff --git a/test/playwright/TestUtils.ts b/test/playwright/TestUtils.ts index 1427578c..79408d41 100644 --- a/test/playwright/TestUtils.ts +++ b/test/playwright/TestUtils.ts @@ -492,9 +492,10 @@ export function getBrowserType(): playwright.BrowserType { +export function launchBrowser(opts?: playwright.LaunchOptions): Promise { const browserType = getBrowserType(); - const options: Record = { + const options: playwright.LaunchOptions = { + ...opts, headless: process.argv.includes('--headless') };