test: clean up connect options set for debug controller (#18317)
This commit is contained in:
parent
d8ec7cba47
commit
d819f97f40
|
|
@ -137,6 +137,10 @@ export class Backend extends EventEmitter {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async close() {
|
||||||
|
await this._transport.closeAndWait();
|
||||||
|
}
|
||||||
|
|
||||||
async resetForReuse() {
|
async resetForReuse() {
|
||||||
await this._send('resetForReuse');
|
await this._send('resetForReuse');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,16 @@ const test = baseTest.extend<Fixtures>({
|
||||||
const backend = new Backend();
|
const backend = new Backend();
|
||||||
await backend.connect(wsEndpoint);
|
await backend.connect(wsEndpoint);
|
||||||
await use(backend);
|
await use(backend);
|
||||||
|
await backend.close();
|
||||||
},
|
},
|
||||||
connectedBrowser: async ({ playwright, wsEndpoint }, use) => {
|
connectedBrowser: async ({ playwright, wsEndpoint }, use) => {
|
||||||
|
const oldValue = (playwright.chromium as any)._defaultConnectOptions;
|
||||||
(playwright.chromium as any)._defaultConnectOptions = {
|
(playwright.chromium as any)._defaultConnectOptions = {
|
||||||
wsEndpoint,
|
wsEndpoint,
|
||||||
headers: { 'x-playwright-reuse-context': '1', },
|
headers: { 'x-playwright-reuse-context': '1', },
|
||||||
};
|
};
|
||||||
const browser = await playwright.chromium.launch();
|
const browser = await playwright.chromium.launch();
|
||||||
|
(playwright.chromium as any)._defaultConnectOptions = oldValue;
|
||||||
await use(browser as any);
|
await use(browser as any);
|
||||||
await browser.close();
|
await browser.close();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue