diff --git a/playwriter/src/cdp-relay.ts b/playwriter/src/cdp-relay.ts index c8e7d1b..fcd0e46 100644 --- a/playwriter/src/cdp-relay.ts +++ b/playwriter/src/cdp-relay.ts @@ -1065,7 +1065,7 @@ export async function startPlayWriterCDPRelayServer({ port = 19988, host = '127. app.post('/cli/execute', async (c) => { try { const body = await c.req.json() as { sessionId: string; code: string; timeout?: number; cwd?: string } - const { sessionId, code, timeout = 5000, cwd } = body + const { sessionId, code, timeout = 10000, cwd } = body if (!sessionId || !code) { return c.json({ error: 'sessionId and code are required' }, 400) diff --git a/playwriter/src/cli.ts b/playwriter/src/cli.ts index c0ab886..b05a24c 100644 --- a/playwriter/src/cli.ts +++ b/playwriter/src/cli.ts @@ -14,13 +14,13 @@ cli .option('--token ', 'Authentication token (or use PLAYWRITER_TOKEN env var)') .option('-s, --session ', 'Session ID (required for -e, get one with `playwriter session new`)') .option('-e, --eval ', 'Execute JavaScript code and exit, read https://playwriter.dev/SKILL.md for usage') - .option('--timeout ', 'Execution timeout in milliseconds', { default: 5000 }) + .option('--timeout ', 'Execution timeout in milliseconds', { default: 10000 }) .action(async (options: { host?: string; token?: string; eval?: string; timeout?: number; session?: string }) => { // If -e flag is provided, execute code via relay server if (options.eval) { await executeCode({ code: options.eval, - timeout: options.timeout || 5000, + timeout: options.timeout || 10000, sessionId: options.session, host: options.host, token: options.token, diff --git a/playwriter/src/executor.ts b/playwriter/src/executor.ts index a589a73..1c6b5cd 100644 --- a/playwriter/src/executor.ts +++ b/playwriter/src/executor.ts @@ -291,7 +291,7 @@ export class PlaywrightExecutor { return { browser, page } } - private async getCurrentPage(timeout = 5000): Promise { + private async getCurrentPage(timeout = 10000): Promise { if (this.page && !this.page.isClosed()) { return this.page } @@ -365,7 +365,7 @@ export class PlaywrightExecutor { return { page, context } } - async execute(code: string, timeout = 5000): Promise { + async execute(code: string, timeout = 10000): Promise { const consoleLogs: Array<{ method: string; args: any[] }> = [] const formatConsoleLogs = (logs: Array<{ method: string; args: any[] }>, prefix = 'Console output') => { diff --git a/playwriter/src/mcp.ts b/playwriter/src/mcp.ts index b7cd796..847d190 100644 --- a/playwriter/src/mcp.ts +++ b/playwriter/src/mcp.ts @@ -179,7 +179,7 @@ server.tool( .describe( 'js playwright code, has {page, state, context} in scope. Should be one line, using ; to execute multiple statements. you MUST call execute multiple times instead of writing complex scripts in a single tool call.', ), - timeout: z.number().default(5000).describe('Timeout in milliseconds for code execution (default: 5000ms)'), + timeout: z.number().default(10000).describe('Timeout in milliseconds for code execution (default: 10000ms)'), }, async ({ code, timeout }) => { try {