Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: generate working vscode agents (#37611)

Pavel Feldmane8208f945589
diff --git a/.gitignore b/.gitignore
index 8e41e31810..d695893a27 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,7 @@ node_modules/
.DS_Store
*.swp
*.pyc
-.vscode
+/.vscode
.mono
.idea
yarn.lock
diff --git a/examples/todomvc/.vscode/mcp.json b/examples/todomvc/.vscode/mcp.json
new file mode 100644
index 0000000000..8cb0a2009c
--- /dev/null
+++ b/examples/todomvc/.vscode/mcp.json
@@ -0,0 +1,17 @@
+{
+ "servers": {
+ "playwright-test": {
+ "type": "stdio",
+ "command": "npx",
+ "args": [
+ "playwright",
+ "run-test-mcp-server"
+ ],
+ "cwd": "${workspaceFolder}",
+ "env": {
+ "PLAYWRIGHT_MCP_TOOL_PREFIX": "test_"
+ }
+ }
+ },
+ "inputs": []
+}
\ No newline at end of file
diff --git a/packages/playwright/src/agents/generateAgents.ts b/packages/playwright/src/agents/generateAgents.ts
index 63ab8663f0..e30a366719 100644
--- a/packages/playwright/src/agents/generateAgents.ts
+++ b/packages/playwright/src/agents/generateAgents.ts
@@ -227,7 +227,7 @@ function saveAsVSCodeChatmode(agent: Agent): string {
return vscodeToolMap.get(first) || first;
}
const tools = agent.header.tools.map(asVscodeTool).flat().sort((a, b) => {
- // VSCode insisits on the specific tools order when editing agent config.
+ // VSCode insists on the specific tools order when editing agent config.
const indexA = vscodeToolsOrder.indexOf(a);
const indexB = vscodeToolsOrder.indexOf(b);
if (indexA === -1 && indexB === -1)
@@ -278,6 +278,7 @@ export async function initVSCodeRepo() {
type: 'stdio',
command: commonMcpServers.playwrightTest.command,
args: commonMcpServers.playwrightTest.args,
+ cwd: '${workspaceFolder}',
env: { 'PLAYWRIGHT_MCP_TOOL_PREFIX': vscodeToolPrefix },
};
await writeFile(mcpJsonPath, JSON.stringify(mcpJson, null, 2));