Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(firefox): do not create first window on start (#1727)

Yury Semikhatskya1ffed605212
diff --git a/src/server/firefox.ts b/src/server/firefox.ts
index f5ff763bf6..4ca982def1 100644
--- a/src/server/firefox.ts
+++ b/src/server/firefox.ts
@@ -185,8 +185,13 @@ export class Firefox implements BrowserType<FFBrowser> {
firefoxArguments.push('-juggler', String(port));
firefoxArguments.push(...args);
- if (args.every(arg => arg.startsWith('-')))
- firefoxArguments.push('about:blank');
+ if (launchType === 'persistent') {
+ if (args.every(arg => arg.startsWith('-')))
+ firefoxArguments.push('about:blank');
+ } else {
+ firefoxArguments.push('-silent');
+ }
+
return firefoxArguments;
}
}
diff --git a/test/fixtures.spec.js b/test/fixtures.spec.js
index 9eaed2af28..89e3ad3d24 100644
--- a/test/fixtures.spec.js
+++ b/test/fixtures.spec.js
@@ -26,6 +26,7 @@ async function testSignal(browserType, action, exitOnClose) {
handleSIGINT: true,
handleSIGTERM: true,
handleSIGHUP: true,
+ executablePath: browserType.executablePath(),
});
const res = spawn('node', [path.join(__dirname, 'fixtures', 'closeme.js'), playwrightPath, browserType.name(), JSON.stringify(options), exitOnClose ? 'true' : '']);
let wsEndPointCallback;