chore: use persistent profile by default (#41)

Fixes https://github.com/microsoft/playwright-mcp/issues/29
This commit is contained in:
Pavel Feldman
2025-03-26 15:02:45 -07:00
committed by GitHub
parent 5345a7b4df
commit 6ff4500211
11 changed files with 122 additions and 69 deletions

View File

@@ -121,11 +121,12 @@ export const test = baseTest.extend<Fixtures>({
await use(await startServer());
},
startServer: async ({ }, use) => {
startServer: async ({ }, use, testInfo) => {
let server: MCPServer | undefined;
const userDataDir = testInfo.outputPath('user-data-dir');
use(async options => {
server = new MCPServer('node', [path.join(__dirname, '../cli.js'), '--headless'], options);
server = new MCPServer('node', [path.join(__dirname, '../cli.js'), '--headless', '--user-data-dir', userDataDir], options);
const initialize = await server.send({
jsonrpc: '2.0',
id: 0,