Compare commits
7 Commits
copilot/fi
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47a73de357 | ||
|
|
d9d5e3f7ed | ||
|
|
0c8a2c9c70 | ||
|
|
ce1652d7af | ||
|
|
269d8d8a4d | ||
|
|
2acdc66c27 | ||
|
|
723ad2a9a6 |
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user