mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: don't show reused browser intro (#16289)
This commit is contained in:
parent
cd1413ecab
commit
5d7e80bed6
@ -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');
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user