chore: don't show reused browser intro (#16289)

This commit is contained in:
Pavel Feldman 2022-08-04 22:09:27 -07:00 committed by GitHub
parent cd1413ecab
commit 5d7e80bed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,6 @@ import type { Playwright } from '../server/playwright';
import { createPlaywright } from '../server/playwright';
import { PlaywrightConnection } from './playwrightConnection';
import { assert } from '../utils';
import { serverSideCallMetadata } from '../server/instrumentation';
import type { LaunchOptions } from '../server/types';
import { ManualPromise } from '../utils/manualPromise';
@ -64,34 +63,6 @@ export class PlaywrightServer {
}
async listen(port: number = 0): Promise<string> {
if (this._mode === 'reuse-browser') {
const callMetadata = serverSideCallMetadata();
const browser = await this._preLaunchedPlaywright!.chromium.launch(callMetadata, { headless: false });
const { context } = await browser.newContextForReuse({
viewport: {
width: 800,
height: 600
},
locale: 'en-US',
deviceScaleFactor: process.platform === 'darwin' ? 2 : 1
}, callMetadata);
const page = await context.newPage(callMetadata);
await page.mainFrame().setContent(callMetadata, `
<style>
html, body {
width: 100%;
height: 100%;
}
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
<div>Playwright will use this page to run tests</div>`);
}
const server = http.createServer((request, response) => {
response.end('Running');
});