From 922002e435a32d34260c744295d2fa55816af8ea Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 20 Aug 2025 18:44:45 +0200 Subject: [PATCH] make test pass --- src/vscode/main.ts | 7 ++++++- tests/vscode.spec.ts | 11 ++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/vscode/main.ts b/src/vscode/main.ts index f6b439c..4ed6751 100644 --- a/src/vscode/main.ts +++ b/src/vscode/main.ts @@ -57,7 +57,12 @@ async function main(config: FullConfig, connectionString: string, lib: string) { const playwright = await import(lib).then(mod => mod.default ?? mod); const factory = new VSCodeBrowserContextFactory(config, playwright, connectionString); await mcpServer.connect( - () => new BrowserServerBackend(config, factory), + { + name: 'Playwright MCP', + nameInConfig: 'playwright-vscode', + create: () => new BrowserServerBackend(config, factory), + version: 'unused' + }, new StdioServerTransport(), false ); diff --git a/tests/vscode.spec.ts b/tests/vscode.spec.ts index 61e2f05..d3111dc 100644 --- a/tests/vscode.spec.ts +++ b/tests/vscode.spec.ts @@ -18,7 +18,7 @@ import { test, expect } from './fixtures.js'; test('browser_connect(vscode) works', async ({ startClient, playwright, browserName }) => { const { client } = await startClient({ - args: ['--connect-tool'], + args: ['--vscode'], }); const server = await playwright[browserName].launchServer(); @@ -26,14 +26,11 @@ test('browser_connect(vscode) works', async ({ startClient, playwright, browserN expect(await client.callTool({ name: 'browser_connect', arguments: { - name: 'vscode', - options: { - connectionString: server.wsEndpoint(), - lib: new URL('./index.js', import.meta.resolve('playwright')).pathname, - } + connectionString: server.wsEndpoint(), + lib: new URL('./index.js', import.meta.resolve('playwright')).pathname, } })).toHaveResponse({ - result: 'Successfully changed connection method.' + result: 'Successfully connected.' }); expect(await client.callTool({