8 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
47a73de357 Fix redundant conditional logic in browser_evaluate error test
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
2025-07-18 22:16:55 +00:00
copilot-swe-agent[bot]
d9d5e3f7ed Restore webkit-specific expectations for browser_evaluate error test
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
2025-07-18 21:01:38 +00:00
copilot-swe-agent[bot]
0c8a2c9c70 Remove all implementation detail checks from browser_evaluate error test
Co-authored-by: yury-s <9798949+yury-s@users.noreply.github.com>
2025-07-18 20:21:49 +00:00
copilot-swe-agent[bot]
ce1652d7af Remove implementation detail check for page._evaluateFunction
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
2025-07-18 20:14:39 +00:00
copilot-swe-agent[bot]
269d8d8a4d Add conditional webkit expectations for browser_evaluate error test
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
2025-07-18 19:52:18 +00:00
copilot-swe-agent[bot]
2acdc66c27 Add browser_evaluate (error) test for JavaScript error handling
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
2025-07-18 18:49:06 +00:00
copilot-swe-agent[bot]
723ad2a9a6 Initial plan 2025-07-18 18:37:16 +00:00
Adam Gastineau
9f8441daa5 chore(docs): make VSCode match other README sections (#706) 2025-07-18 11:21:29 -07:00
2 changed files with 28 additions and 1 deletions

View File

@@ -99,7 +99,13 @@ Click <code>Save</code>.
<details>
<summary>VS Code</summary>
You can also install the Playwright MCP server using the VS Code CLI:
#### Click the button to install:
[<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)
#### Or install manually:
Follow the MCP install [guide](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server), use the standard config above. You can also install the Playwright MCP server using the VS Code CLI:
```bash
# For VS Code

View File

@@ -49,3 +49,24 @@ test('browser_evaluate (element)', async ({ client, server }) => {
},
})).toContainTextContent(`- Result: "red"`);
});
test('browser_evaluate (error)', async ({ client, server }) => {
expect(await client.callTool({
name: 'browser_navigate',
arguments: { url: server.HELLO_WORLD },
})).toContainTextContent(`- Page Title: Title`);
// Test with a bogus expression that will cause a JavaScript error
const result = await client.callTool({
name: 'browser_evaluate',
arguments: {
function: '() => { undefinedVariable.nonExistentMethod(); }',
},
});
// Check that error MCP response is returned
expect(result.isError).toBe(true);
// Check that JavaScript error details are contained in the response
expect(result.content?.[0].text).toContain('undefinedVariable is not defined');
});