cherry-pick(#16898): fix: include headlessness as a launch argument to browser (#16998)

This commit is contained in:
Dmitry Gozman 2022-08-31 13:18:37 -07:00 committed by GitHub
parent 1c54ead163
commit df6fbcb8dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,7 @@ export const test = _baseTest.extend<TestFixtures, WorkerFixtures>({
(browserType as any)._defaultLaunchOptions = undefined;
}, { scope: 'worker', auto: true }],
_connectedBrowser: [async ({ playwright, browserName, channel, headless, connectOptions, launchOptions }, use) => {
_connectedBrowser: [async ({ playwright, browserName, connectOptions, _browserOptions }, use) => {
if (!connectOptions) {
await use(undefined);
return;
@ -116,7 +116,7 @@ export const test = _baseTest.extend<TestFixtures, WorkerFixtures>({
const browser = await playwright[browserName].connect(connectOptions.wsEndpoint, {
headers: {
'x-playwright-browser': browserName,
'x-playwright-launch-options': JSON.stringify(launchOptions),
'x-playwright-launch-options': JSON.stringify(_browserOptions),
...connectOptions.headers,
},
timeout: connectOptions.timeout ?? 3 * 60 * 1000, // 3 minutes