7 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

View File

@@ -49,3 +49,24 @@ test('browser_evaluate (element)', async ({ client, server }) => {
}, },
})).toContainTextContent(`- Result: "red"`); })).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');
});