Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore(mcp): change browser_run_code argument to a function (#38517)
Yury Semikhatskyc9bfd527ad32
diff --git a/examples/todomvc/.claude/agents/playwright-test-planner.md b/examples/todomvc/.claude/agents/playwright-test-planner.mdindex 78af43b534..b33d6ba96e 100644--- a/examples/todomvc/.claude/agents/playwright-test-planner.md+++ b/examples/todomvc/.claude/agents/playwright-test-planner.md@@ -1,7 +1,7 @@---name: playwright-test-plannerdescription: Use this agent when you need to create comprehensive test plan for a web application or website-tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page, mcp__playwright-test__planner_save_plan+tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_run_code, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page, mcp__playwright-test__planner_save_planmodel: sonnetcolor: green---diff --git a/examples/todomvc/.github/agents/playwright-test-planner.agent.md b/examples/todomvc/.github/agents/playwright-test-planner.agent.mdindex 6ac9a5f1f3..c10240e2be 100644--- a/examples/todomvc/.github/agents/playwright-test-planner.agent.md+++ b/examples/todomvc/.github/agents/playwright-test-planner.agent.md@@ -16,6 +16,7 @@ tools:- playwright-test/browser_navigate_back- playwright-test/browser_network_requests- playwright-test/browser_press_key+ - playwright-test/browser_run_code- playwright-test/browser_select_option- playwright-test/browser_snapshot- playwright-test/browser_take_screenshotdiff --git a/packages/playwright/src/agents/playwright-test-planner.agent.md b/packages/playwright/src/agents/playwright-test-planner.agent.mdindex ce0780ba56..4ff02c115a 100644--- a/packages/playwright/src/agents/playwright-test-planner.agent.md+++ b/packages/playwright/src/agents/playwright-test-planner.agent.md@@ -17,6 +17,7 @@ tools:- playwright-test/browser_navigate_back- playwright-test/browser_network_requests- playwright-test/browser_press_key+ - playwright-test/browser_run_code- playwright-test/browser_select_option- playwright-test/browser_snapshot- playwright-test/browser_take_screenshotdiff --git a/packages/playwright/src/mcp/browser/tools/runCode.ts b/packages/playwright/src/mcp/browser/tools/runCode.tsindex eafe672c30..537ffdb064 100644--- a/packages/playwright/src/mcp/browser/tools/runCode.ts+++ b/packages/playwright/src/mcp/browser/tools/runCode.ts@@ -22,7 +22,7 @@ import { z } from 'playwright-core/lib/mcpBundle';import { defineTabTool } from './tool';const codeSchema = z.object({- code: z.string().describe(`Playwright code snippet to run. The snippet should access the \`page\` object to interact with the page. Can make multiple statements. \`return\` is allowed. For example: \`await page.getByRole('button', { name: 'Submit' }).click(); return await page.title();\``),+ code: z.string().describe(`A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: \`async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }\``),});const runCode = defineTabTool({@@ -37,7 +37,7 @@ const runCode = defineTabTool({handle: async (tab, params, response) => {response.setIncludeSnapshot();- response.addCode(params.code);+ response.addCode(`await (${params.code})(page);`);const __end__ = new ManualPromise<void>();const context = {page: tab.page,@@ -47,9 +47,7 @@ const runCode = defineTabTool({await tab.waitForCompletion(async () => {const snippet = `(async () => {try {- const result = await (async () => {- ${params.code};- })();+ const result = await (${params.code})(page);__end__.resolve(JSON.stringify(result));} catch (e) {__end__.reject(e);diff --git a/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat0.json b/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat0.jsonindex fb1fbba898..45ca393ea5 100644--- a/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat0.json+++ b/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat0.json@@ -1,27 +1,27 @@{- "72c991f81419aaeb460a1ecea1f6c3678ea7d6e8": {+ "c6e2436f30fc74b09258d515ca66258219b1d296": {"result": {"role": "assistant","content": [{"type": "text",- "text": "I'll help you complete this form. Let me start by navigating to the page and then examining its structure."+ "text": "I'll help you navigate to the page, fill out the order form, and report back the total price and delivery information."}]},"usage": {- "input": 4510,- "output": 112+ "input": 4515,+ "output": 119}},- "1a42992144498618920d2cb48b2ead4e5e93f7be": {+ "208d528f3788e85bbab2a1bf6914985fac1d835a": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Navigate to the form page to begin the order process",- "copilotToolCallId": "toolu_vrtx_019XhE5hdEKbaxtYymNKju9W"+ "text": "Navigate to the form page to start ordering items",+ "copilotToolCallId": "toolu_vrtx_01QJb24SaGmdDk2LSYhVwKFq"},{"type": "tool_call",@@ -29,23 +29,23 @@"arguments": {"url": "http://localhost:<PORT>/evals/fill-form.html"},- "id": "toolu_vrtx_019XhE5hdEKbaxtYymNKju9W"+ "id": "toolu_vrtx_01QJb24SaGmdDk2LSYhVwKFq"}]},"usage": {- "input": 4564,- "output": 93+ "input": 4571,+ "output": 92}},- "a495b5e67367f80010d7a5f0b16595c2b142329c": {+ "f92997bbe28f81024382efcd1b175fabfb9a348b": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select 'Table' as the product type",- "copilotToolCallId": "toolu_vrtx_01NrvJy9DRebD4BprU5vA8ZP"+ "text": "Select Table as the first product",+ "copilotToolCallId": "toolu_vrtx_01Wy78XiFT1hA7s364vd74ML"},{"type": "tool_call",@@ -57,23 +57,23 @@"Table"]},- "id": "toolu_vrtx_01NrvJy9DRebD4BprU5vA8ZP"+ "id": "toolu_vrtx_01Wy78XiFT1hA7s364vd74ML"}]},"usage": {- "input": 5278,- "output": 119+ "input": 5284,+ "output": 116}},- "5dd945f04cdb57e3ffeaa90325b5037d9fc87a26": {+ "224aef3f51ccb59d9003a65fe28f8abbac540d51": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select 'Blue' as the color for the table",- "copilotToolCallId": "toolu_vrtx_01PTSi2zZ334cQUKsoKQgxFi"+ "text": "Select Blue as the color for the table",+ "copilotToolCallId": "toolu_vrtx_01NJ8jnjNYFnyqzKhfkPjpzd"},{"type": "tool_call",@@ -85,84 +85,179 @@"Blue"]},- "id": "toolu_vrtx_01PTSi2zZ334cQUKsoKQgxFi"+ "id": "toolu_vrtx_01NJ8jnjNYFnyqzKhfkPjpzd"}]},"usage": {- "input": 5544,- "output": 120+ "input": 5547,+ "output": 117}},- "7428c2578b57342ef81cbd19caad5edccd210fbd": {+ "38d64bd91fc32d1fe51d2cf641a6025d58b744fa": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in all the customer information fields",- "copilotToolCallId": "toolu_vrtx_01FsQBa8pvipToHkTxEdr1dS"+ "text": "Fill in the name field with John Doe",+ "copilotToolCallId": "toolu_vrtx_01T5ruwZRiLm3nLtFWkc3Gke"},{"type": "tool_call",- "name": "browser_fill_form",+ "name": "browser_type","arguments": {- "fields": [- {- "name": "Full Name",- "type": "textbox",- "ref": "e13",- "value": "John Doe"- },- {- "name": "Email Address",- "type": "textbox",- "ref": "e16",- "value": "[email protected]"- },- {- "name": "Street Address",- "type": "textbox",- "ref": "e19",- "value": "123 Main St"- },- {- "name": "City",- "type": "textbox",- "ref": "e22",- "value": "Anytown"- },- {- "name": "State/Province",- "type": "textbox",- "ref": "e25",- "value": "XYZ state"- },- {- "name": "ZIP/Postal Code",- "type": "textbox",- "ref": "e28",- "value": "12345"- }- ]+ "element": "Full Name textbox",+ "ref": "e13",+ "text": "John Doe"},- "id": "toolu_vrtx_01FsQBa8pvipToHkTxEdr1dS"+ "id": "toolu_vrtx_01T5ruwZRiLm3nLtFWkc3Gke"}]},"usage": {"input": 5813,- "output": 272+ "output": 118}},- "6884d54d0b16587b66507e4e3604e3b42f0353f6": {+ "6c8756bb54afad695e4e4ea901c27fdeffe93d8b": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the order for the blue table",- "copilotToolCallId": "toolu_vrtx_01AFbfH1aCRAKyFw1iZXqsgi"+ "text": "Fill in the email field",+ "copilotToolCallId": "toolu_vrtx_01AZBjdBNyC8htApAJx52BZj"+ },+ {+ "type": "tool_call",+ "name": "browser_type",+ "arguments": {+ "element": "Email Address textbox",+ "ref": "e16",+ "text": "[email protected]"+ },+ "id": "toolu_vrtx_01AZBjdBNyC8htApAJx52BZj"+ }+ ]+ },+ "usage": {+ "input": 5977,+ "output": 116+ }+ },+ "cf1c146f769b391047d65b77367c7452b0f86517": {+ "result": {+ "role": "assistant",+ "content": [+ {+ "type": "text",+ "text": "Fill in the street address field",+ "copilotToolCallId": "toolu_vrtx_0153HGAJZuNiEAZUrqa8hi5E"+ },+ {+ "type": "tool_call",+ "name": "browser_type",+ "arguments": {+ "element": "Street Address textbox",+ "ref": "e19",+ "text": "123 Main St"+ },+ "id": "toolu_vrtx_0153HGAJZuNiEAZUrqa8hi5E"+ }+ ]+ },+ "usage": {+ "input": 6141,+ "output": 116+ }+ },+ "18a4b0b23866628c41c26840c0453cfb5745abe4": {+ "result": {+ "role": "assistant",+ "content": [+ {+ "type": "text",+ "text": "Fill in the city field with Anytown",+ "copilotToolCallId": "toolu_vrtx_012buxK7mWWFe97aRhG4oAnQ"+ },+ {+ "type": "tool_call",+ "name": "browser_type",+ "arguments": {+ "element": "City textbox",+ "ref": "e22",+ "text": "Anytown"+ },+ "id": "toolu_vrtx_012buxK7mWWFe97aRhG4oAnQ"+ }+ ]+ },+ "usage": {+ "input": 6304,+ "output": 117+ }+ },+ "141ace775dfba69a215f874da99dc98394346d83": {+ "result": {+ "role": "assistant",+ "content": [+ {+ "type": "text",+ "text": "Fill in the state field with XYZ",+ "copilotToolCallId": "toolu_vrtx_01S8BLUfWVcRZJxoT2Pxq58c"+ },+ {+ "type": "tool_call",+ "name": "browser_type",+ "arguments": {+ "element": "State/Province textbox",+ "ref": "e25",+ "text": "XYZ"+ },+ "id": "toolu_vrtx_01S8BLUfWVcRZJxoT2Pxq58c"+ }+ ]+ },+ "usage": {+ "input": 6466,+ "output": 119+ }+ },+ "d3d9754688e89faab5c13025f900fd5d148f70a0": {+ "result": {+ "role": "assistant",+ "content": [+ {+ "type": "text",+ "text": "Fill in the ZIP code field",+ "copilotToolCallId": "toolu_vrtx_016vGQAUKWJCFgoXs6SnXRBN"+ },+ {+ "type": "tool_call",+ "name": "browser_type",+ "arguments": {+ "element": "ZIP/Postal Code textbox",+ "ref": "e28",+ "text": "12345"+ },+ "id": "toolu_vrtx_016vGQAUKWJCFgoXs6SnXRBN"+ }+ ]+ },+ "usage": {+ "input": 6632,+ "output": 117+ }+ },+ "6f7c8ef402aa3206eeab2817aadf67757c99dd1f": {+ "result": {+ "role": "assistant",+ "content": [+ {+ "type": "text",+ "text": "Click the Order button to submit the first order (blue table)",+ "copilotToolCallId": "toolu_vrtx_01GeRLXFVbGYPe2CX88GrAD1"},{"type": "tool_call",@@ -171,23 +266,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_01AFbfH1aCRAKyFw1iZXqsgi"+ "id": "toolu_vrtx_01GeRLXFVbGYPe2CX88GrAD1"}]},"usage": {- "input": 6264,- "output": 95+ "input": 6797,+ "output": 100}},- "ba67ed2d1889950d83261f2a48cd4092fdd50fb2": {+ "87d6f9626d8ef40fd4df2a6b5cc87d0a084380db": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Confirm the order for the blue table",- "copilotToolCallId": "toolu_vrtx_013CfdGuK99ukjohDKXESHiL"+ "text": "Accept the confirmation dialog for the blue table order",+ "copilotToolCallId": "toolu_vrtx_01Gze4ViLhq8iKT3cYxkEswg"},{"type": "tool_call",@@ -195,23 +290,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_013CfdGuK99ukjohDKXESHiL"+ "id": "toolu_vrtx_01Gze4ViLhq8iKT3cYxkEswg"}]},"usage": {- "input": 6434,- "output": 79+ "input": 6972,+ "output": 80}},- "a89877b173ccdbd269ca80d4c0fe0d120c8a8cb2": {+ "c85197053f027c8b5644c0dfd452b7860d4f3f9d": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Click the button to place another order for the green desk",- "copilotToolCallId": "toolu_vrtx_01Jy58oYC9FLVJQmnjA8ABph"+ "text": "Click Place Another Order to order the second item (green desk)",+ "copilotToolCallId": "toolu_vrtx_016uofKjtBYpbZ1syvkZJz5T"},{"type": "tool_call",@@ -220,23 +315,23 @@"element": "Place Another Order button","ref": "e58"},- "id": "toolu_vrtx_01Jy58oYC9FLVJQmnjA8ABph"+ "id": "toolu_vrtx_016uofKjtBYpbZ1syvkZJz5T"}]},"usage": {- "input": 7323,- "output": 101+ "input": 7859,+ "output": 102}},- "72801092ddb20d1b074964adce3842a8e57c07c7": {+ "558852b61b70243bc9c07b74d9604eb44159ac3b": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select 'Desk' as the product type for the second order",- "copilotToolCallId": "toolu_vrtx_01CxUcf2MHxGJN5VtdkqMAvB"+ "text": "Select Desk as the second product",+ "copilotToolCallId": "toolu_vrtx_01RDGz26dSJMwZaQHo9Y9UPH"},{"type": "tool_call",@@ -248,23 +343,23 @@"Desk"]},- "id": "toolu_vrtx_01CxUcf2MHxGJN5VtdkqMAvB"+ "id": "toolu_vrtx_01RDGz26dSJMwZaQHo9Y9UPH"}]},"usage": {- "input": 8044,- "output": 125+ "input": 8581,+ "output": 118}},- "1182247a7989725e321b996a893dfde8e2e5e77c": {+ "9074d89eba6dd89300b2705017c4581e3a46688d": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select 'Green' as the color for the desk",- "copilotToolCallId": "toolu_vrtx_01LWcUgiqZMgASddiTJLz4jB"+ "text": "Select Green as the color for the desk",+ "copilotToolCallId": "toolu_vrtx_01QKP2UHW1cFDyC2LMczLaZU"},{"type": "tool_call",@@ -276,23 +371,23 @@"Green"]},- "id": "toolu_vrtx_01LWcUgiqZMgASddiTJLz4jB"+ "id": "toolu_vrtx_01QKP2UHW1cFDyC2LMczLaZU"}]},"usage": {- "input": 8317,- "output": 120+ "input": 8847,+ "output": 117}},- "13948c9c44c45b1bc7a0c8c5cf592a6d2c83225d": {+ "51a702cdde8dd0004e8c6bd30ece543f8145edf7": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in all the customer information fields for the second order",- "copilotToolCallId": "toolu_vrtx_01W6kFr8q8Mg32jSZ44XqpXV"+ "text": "Fill in all the form fields with the customer information",+ "copilotToolCallId": "toolu_vrtx_01QvTrbQvU4wCUPn4dTMhnMZ"},{"type": "tool_call",@@ -301,59 +396,59 @@"fields": [{"name": "Full Name",- "ref": "e13","type": "textbox",+ "ref": "e13","value": "John Doe"},{"name": "Email Address",- "ref": "e16","type": "textbox",+ "ref": "e16","value": "[email protected]"},{"name": "Street Address",- "ref": "e19","type": "textbox",+ "ref": "e19","value": "123 Main St"},{"name": "City",- "ref": "e22","type": "textbox",+ "ref": "e22","value": "Anytown"},{"name": "State/Province",- "ref": "e25","type": "textbox",- "value": "XYZ state"+ "ref": "e25",+ "value": "XYZ"},{"name": "ZIP/Postal Code",- "ref": "e28","type": "textbox",+ "ref": "e28","value": "12345"}]},- "id": "toolu_vrtx_01W6kFr8q8Mg32jSZ44XqpXV"+ "id": "toolu_vrtx_01QvTrbQvU4wCUPn4dTMhnMZ"}]},"usage": {- "input": 8586,- "output": 268+ "input": 9113,+ "output": 274}},- "a0f3de44f39022284ecc076163a57958ea6d4d94": {+ "650b847697eb61f2adca523992b65f63ae77e4f0": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the order for the green desk",- "copilotToolCallId": "toolu_vrtx_01Cw23f6uikMjv8X3yHKxTHt"+ "text": "Click the Order button to submit the second order (green desk)",+ "copilotToolCallId": "toolu_vrtx_019YvTNKEuB34rhe5Tonqikz"},{"type": "tool_call",@@ -362,23 +457,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_01Cw23f6uikMjv8X3yHKxTHt"+ "id": "toolu_vrtx_019YvTNKEuB34rhe5Tonqikz"}]},"usage": {- "input": 9041,- "output": 95+ "input": 9565,+ "output": 100}},- "40f60ed35c283a4554043cf2b214e0f56e894927": {+ "bb66b168e193d00bbfe4c65cff32cb0648ceb9cd": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Confirm the order for the green desk",- "copilotToolCallId": "toolu_vrtx_01BjnDPCGV1GtDy3oGzLTNah"+ "text": "Accept the confirmation dialog for the green desk order",+ "copilotToolCallId": "toolu_vrtx_0122xueFnLyirRBuERQXnvJc"},{"type": "tool_call",@@ -386,23 +481,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_01BjnDPCGV1GtDy3oGzLTNah"+ "id": "toolu_vrtx_0122xueFnLyirRBuERQXnvJc"}]},"usage": {- "input": 9211,- "output": 79+ "input": 9740,+ "output": 80}},- "9b6e85cce940804cd08969342cb6cbea1614b0ad": {+ "9c742682c192e1bea527cdf10420c6b8b5d8e6a7": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Report the total price for both orders (blue table $353.98 + green desk $299.98 = $653.96) and maximum estimated delivery (3 days for both)",- "copilotToolCallId": "toolu_vrtx_01XiqswwnGjpuex33KCAft1Q"+ "text": "Report the combined total price and maximum delivery days for both orders: blue table ($353.98) + green desk ($299.98) = $653.96 total, and both have 3 days estimated delivery",+ "copilotToolCallId": "toolu_vrtx_014LwrYe1UWGYPtXRDZzaLMv"},{"type": "tool_call",@@ -411,13 +506,13 @@"price": 653.96,"deliveryDays": 3},- "id": "toolu_vrtx_01XiqswwnGjpuex33KCAft1Q"+ "id": "toolu_vrtx_014LwrYe1UWGYPtXRDZzaLMv"}]},"usage": {- "input": 10101,- "output": 130+ "input": 10628,+ "output": 136}}}\ No newline at end of filediff --git a/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat1.json b/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat1.jsonindex 236f188c92..4986734836 100644--- a/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat1.json+++ b/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat1.json@@ -1,27 +1,27 @@{- "72c991f81419aaeb460a1ecea1f6c3678ea7d6e8": {+ "c6e2436f30fc74b09258d515ca66258219b1d296": {"result": {"role": "assistant","content": [{"type": "text",- "text": "I'll help you navigate to the form, fill it out with the specified details, and report back the total price and delivery information."+ "text": "I'll help you complete this task. Let me start by navigating to the form and then filling it out with the specified details."}]},"usage": {- "input": 4510,- "output": 121+ "input": 4515,+ "output": 116}},- "42c8b6a0c145e30b6c00aec696aac3c310a17994": {+ "6b58aecc88682e5cf9ac78c5db916972bf2aa632": {"result": {"role": "assistant","content": [{"type": "text","text": "Navigate to the form page",- "copilotToolCallId": "toolu_vrtx_0182jDuGXtgRjkMfyT7Lmrh6"+ "copilotToolCallId": "toolu_vrtx_01KXNJS2AF6Lut6PuyWe3gbp"},{"type": "tool_call",@@ -29,79 +29,79 @@"arguments": {"url": "http://localhost:<PORT>/evals/fill-form.html"},- "id": "toolu_vrtx_0182jDuGXtgRjkMfyT7Lmrh6"+ "id": "toolu_vrtx_01KXNJS2AF6Lut6PuyWe3gbp"}]},"usage": {- "input": 4568,+ "input": 4573,"output": 88}},- "92e77e44f298c5a44472e8cd81cbd97d8b698b7d": {+ "39728354cc6d356e4d5dc072fe8519aaf1cd48fb": {"result": {"role": "assistant","content": [{"type": "text","text": "Select Table as the product type",- "copilotToolCallId": "toolu_vrtx_01WkF25PPYBKNMaciBu9MSCS"+ "copilotToolCallId": "toolu_vrtx_01TiqCpSz8NCbxczVXWJKp7K"},{"type": "tool_call","name": "browser_select_option","arguments": {- "element": "Product Type dropdown",+ "element": "Product Type combobox","ref": "e7","values": ["Table"]},- "id": "toolu_vrtx_01WkF25PPYBKNMaciBu9MSCS"+ "id": "toolu_vrtx_01TiqCpSz8NCbxczVXWJKp7K"}]},"usage": {- "input": 5277,- "output": 116+ "input": 5282,+ "output": 118}},- "da1c109ec016828a7a015f66b3e2de3d24556d38": {+ "47ef8fec29b9227dfaf29a5bcdda43d0f2ac1f91": {"result": {"role": "assistant","content": [{"type": "text","text": "Select Blue as the color",- "copilotToolCallId": "toolu_vrtx_011EQL9QTyDnSzdxKkWa9XPT"+ "copilotToolCallId": "toolu_vrtx_011NPSqEP7jWBGC7gawFgsiQ"},{"type": "tool_call","name": "browser_select_option","arguments": {- "element": "Color dropdown",+ "element": "Color combobox","ref": "e10","values": ["Blue"]},- "id": "toolu_vrtx_011EQL9QTyDnSzdxKkWa9XPT"+ "id": "toolu_vrtx_011NPSqEP7jWBGC7gawFgsiQ"}]},"usage": {- "input": 5540,- "output": 114+ "input": 5547,+ "output": 116}},- "537da538eb262d9e98400b3c55eec586b5f072aa": {+ "176626204d6ba6bec6660c2fcaa67d8d6abe8a8f": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the customer information fields",- "copilotToolCallId": "toolu_vrtx_01S36DvPGHV69bRJtoDZHK2a"+ "text": "Fill in the customer details for the first order",+ "copilotToolCallId": "toolu_vrtx_01CfyfDD5bEBhKQy3st2iuU8"},{"type": "tool_call",@@ -146,23 +146,23 @@}]},- "id": "toolu_vrtx_01S36DvPGHV69bRJtoDZHK2a"+ "id": "toolu_vrtx_01CfyfDD5bEBhKQy3st2iuU8"}]},"usage": {- "input": 5803,- "output": 343+ "input": 5812,+ "output": 346}},- "03dbf3f2e32915a664b5e2296cba1fb4e7f0ac66": {+ "62da0871a0e720786fdb286a6276b211cf5be6ba": {"result": {"role": "assistant","content": [{"type": "text","text": "Click the Order button to submit the first order (blue table)",- "copilotToolCallId": "toolu_vrtx_01XSzSidJJXms5RR5Tz4SE5A"+ "copilotToolCallId": "toolu_vrtx_01LED3srq9PN9dh7CsxLwbMS"},{"type": "tool_call",@@ -171,23 +171,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_01XSzSidJJXms5RR5Tz4SE5A"+ "id": "toolu_vrtx_01LED3srq9PN9dh7CsxLwbMS"}]},"usage": {- "input": 6253,+ "input": 6265,"output": 100}},- "2fd7f663112687e87211fe4816aeb2e513c71530": {+ "0eaa90ef5e1a7a4b998555530a6bee89bf1c8edd": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Accept the confirmation dialog for the blue table order",- "copilotToolCallId": "toolu_vrtx_01Ct5aqw5kcJ1ykvTwzQYdhA"+ "text": "Confirm the order for the blue table",+ "copilotToolCallId": "toolu_vrtx_01F2ynTUAQiW8xu2ExsYZWFk"},{"type": "tool_call",@@ -195,23 +195,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_01Ct5aqw5kcJ1ykvTwzQYdhA"+ "id": "toolu_vrtx_01F2ynTUAQiW8xu2ExsYZWFk"}]},"usage": {- "input": 6428,- "output": 80+ "input": 6440,+ "output": 79}},- "1c8b28e9fb081fad8086fd12d21e6f0dcedc9fa7": {+ "e0a73223c0bda0ff2bfb65c504ba2f60c28265f8": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Click to place another order for the green desk",- "copilotToolCallId": "toolu_vrtx_01TQfpcQL4aT1YtxsqA81p7V"+ "text": "Click the Place Another Order button to order the green desk",+ "copilotToolCallId": "toolu_vrtx_01SzH72CYSm1nJfpo3ywV31H"},{"type": "tool_call",@@ -220,79 +220,79 @@"element": "Place Another Order button","ref": "e58"},- "id": "toolu_vrtx_01TQfpcQL4aT1YtxsqA81p7V"+ "id": "toolu_vrtx_01SzH72CYSm1nJfpo3ywV31H"}]},"usage": {- "input": 7318,- "output": 99+ "input": 7329,+ "output": 101}},- "fc6cbac102e05d7d127b266656ee2b6035a1e603": {+ "e2dfbbc04b8d1a4d5fdfe8518ae4c603c66056c5": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Desk as the product type",- "copilotToolCallId": "toolu_vrtx_011vEW7dtP7jWofnj9YsXbWV"+ "text": "Select Desk as the product type for second order",+ "copilotToolCallId": "toolu_vrtx_014spNiRnyJFG9S5XxdedDdq"},{"type": "tool_call","name": "browser_select_option","arguments": {- "element": "Product Type dropdown",+ "element": "Product Type combobox","ref": "e7","values": ["Desk"]},- "id": "toolu_vrtx_011vEW7dtP7jWofnj9YsXbWV"+ "id": "toolu_vrtx_014spNiRnyJFG9S5XxdedDdq"}]},"usage": {- "input": 8037,- "output": 118+ "input": 8050,+ "output": 123}},- "939dc5610f2a48f8b252a1710403cfb5624c17cf": {+ "1cd9ece884fc13247bbabd1520434f0536c2e5ab": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Green as the color",- "copilotToolCallId": "toolu_vrtx_01UFiQrmnn9tSedmEBy5xJqV"+ "text": "Select Green as the color for the desk",+ "copilotToolCallId": "toolu_vrtx_015a4ReJ8RSgxJgt1R7Ap6Ry"},{"type": "tool_call","name": "browser_select_option","arguments": {- "element": "Color dropdown",+ "element": "Color combobox","ref": "e10","values": ["Green"]},- "id": "toolu_vrtx_01UFiQrmnn9tSedmEBy5xJqV"+ "id": "toolu_vrtx_015a4ReJ8RSgxJgt1R7Ap6Ry"}]},"usage": {- "input": 8303,- "output": 114+ "input": 8321,+ "output": 119}},- "01b1ce85e46110e1d66ad63bdb7df7afe2b0ddfe": {+ "dee9627bf01b277cb98d2bb4806cff6c9c44ac00": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the customer information fields for the second order",- "copilotToolCallId": "toolu_vrtx_01LzuoduwZs76FdYAn266BnY"+ "text": "Fill in the customer details for the second order",+ "copilotToolCallId": "toolu_vrtx_01LNwyANy655VYsrtN4HqMv8"},{"type": "tool_call",@@ -337,23 +337,23 @@}]},- "id": "toolu_vrtx_01LzuoduwZs76FdYAn266BnY"+ "id": "toolu_vrtx_01LNwyANy655VYsrtN4HqMv8"}]},"usage": {- "input": 8566,- "output": 267+ "input": 8589,+ "output": 266}},- "338c070381aa00929c40829eceed5153ba60efee": {+ "df89bda38bd650cff3e4448a96c75f49e89307dc": {"result": {"role": "assistant","content": [{"type": "text","text": "Click the Order button to submit the second order (green desk)",- "copilotToolCallId": "toolu_vrtx_015n9C4cAurXf81UkQSPjZTv"+ "copilotToolCallId": "toolu_vrtx_01U89qrzqXpLUfh3H3RqGRvq"},{"type": "tool_call",@@ -362,23 +362,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_015n9C4cAurXf81UkQSPjZTv"+ "id": "toolu_vrtx_01U89qrzqXpLUfh3H3RqGRvq"}]},"usage": {- "input": 9020,+ "input": 9042,"output": 100}},- "b1da37d5c950a5aaa737d5ea9b3d67330481463d": {+ "c0ae7023c9ffb0c07734dbde9a14115b31934127": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Accept the confirmation dialog for the green desk order",- "copilotToolCallId": "toolu_vrtx_01HeUWmfMZk2vEgv9ga53D4x"+ "text": "Confirm the order for the green desk",+ "copilotToolCallId": "toolu_vrtx_01XSXSFXhqkeCVMxVmDY2Smn"},{"type": "tool_call",@@ -386,23 +386,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_01HeUWmfMZk2vEgv9ga53D4x"+ "id": "toolu_vrtx_01XSXSFXhqkeCVMxVmDY2Smn"}]},"usage": {- "input": 9195,- "output": 80+ "input": 9217,+ "output": 79}},- "8785b545d945c6fac1322e50df31385f4c85cc42": {+ "f21c818657e9219c65e66dea2e83dfb49a576e18": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Report the total price for both items and the maximum estimated delivery time. Blue table: $353.98, Green desk: $299.98. Total: $653.96. Both have 3 days delivery.",- "copilotToolCallId": "toolu_vrtx_01PgWgX6e8uvma9crjhjH5u9"+ "text": "Report the total price for both orders and maximum delivery time",+ "copilotToolCallId": "toolu_vrtx_014ZSZ3KTaH5tcv1mgsLoZ2u"},{"type": "tool_call",@@ -411,13 +411,13 @@"price": 653.96,"deliveryDays": 3},- "id": "toolu_vrtx_01PgWgX6e8uvma9crjhjH5u9"+ "id": "toolu_vrtx_014ZSZ3KTaH5tcv1mgsLoZ2u"}]},"usage": {- "input": 10086,- "output": 135+ "input": 10107,+ "output": 102}}}\ No newline at end of filediff --git a/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat2.json b/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat2.jsonindex cb97f4c6ec..e89529a282 100644--- a/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat2.json+++ b/tests/mcp/__cache__/copilot/mcp-browser-eval-fill-the-form-repeat2.json@@ -1,27 +1,27 @@{- "72c991f81419aaeb460a1ecea1f6c3678ea7d6e8": {+ "c6e2436f30fc74b09258d515ca66258219b1d296": {"result": {"role": "assistant","content": [{"type": "text",- "text": "I'll help you complete this task. Let me start by navigating to the page and then analyzing what's available."+ "text": "I'll navigate to the form and complete the order for you."}]},"usage": {- "input": 4510,- "output": 118+ "input": 4515,+ "output": 103}},- "6651fa402a8ca24a68ca6697420742dd09f26dc5": {+ "056d6552f3ad9000456a3a8678731d2b5cba6578": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Navigate to the form page to start the order process",- "copilotToolCallId": "toolu_vrtx_01VgTpcKYUDAFicAGRhqgv1K"+ "text": "Navigate to the form page to start ordering items",+ "copilotToolCallId": "toolu_vrtx_012ZazvgwjfAJc6AdPfD2Rg3"},{"type": "tool_call",@@ -29,23 +29,23 @@"arguments": {"url": "http://localhost:<PORT>/evals/fill-form.html"},- "id": "toolu_vrtx_01VgTpcKYUDAFicAGRhqgv1K"+ "id": "toolu_vrtx_012ZazvgwjfAJc6AdPfD2Rg3"}]},"usage": {- "input": 4565,- "output": 93+ "input": 4559,+ "output": 92}},- "bdd6a91751a11e0c17a443d889d3d7ab4b13b76e": {+ "f50b69dbcb4642c32ad4eccbd460b6a2d626c64e": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Table as the first product type",- "copilotToolCallId": "toolu_vrtx_01XxETPPBjeR1uuU7EhHWASo"+ "text": "Select 'Table' as the first product",+ "copilotToolCallId": "toolu_vrtx_01SvfQZwupogGaJcUE4csf5h"},{"type": "tool_call",@@ -57,23 +57,23 @@"Table"]},- "id": "toolu_vrtx_01XxETPPBjeR1uuU7EhHWASo"+ "id": "toolu_vrtx_01SvfQZwupogGaJcUE4csf5h"}]},"usage": {- "input": 5279,- "output": 117+ "input": 5272,+ "output": 119}},- "b6dd4ba3f196b4a0cdd7c95ff64bdf2d6ac282a4": {+ "943ffec08bf6a7d2c6bb94c3cd4de405f762141d": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Blue color for the table",- "copilotToolCallId": "toolu_vrtx_014e6hXbw2VxMQ5DNfx5rNeL"+ "text": "Select 'Blue' as the color for the table",+ "copilotToolCallId": "toolu_vrtx_01C7PuTtmKUeNfjnAhyzGLao"},{"type": "tool_call",@@ -85,23 +85,23 @@"Blue"]},- "id": "toolu_vrtx_014e6hXbw2VxMQ5DNfx5rNeL"+ "id": "toolu_vrtx_01C7PuTtmKUeNfjnAhyzGLao"}]},"usage": {- "input": 5543,- "output": 115+ "input": 5538,+ "output": 120}},- "3b85ff525086990b227d917c99853cefef645497": {+ "d97266b46b1ce270203e032759770d7130908c75": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in all the customer details for the order",- "copilotToolCallId": "toolu_vrtx_0153XH9WcQ8BKzfYdZvm6Feb"+ "text": "Fill in all the customer information fields",+ "copilotToolCallId": "toolu_vrtx_01Uwk1FBk6rrSc6dYnaEY64e"},{"type": "tool_call",@@ -146,23 +146,23 @@}]},- "id": "toolu_vrtx_0153XH9WcQ8BKzfYdZvm6Feb"+ "id": "toolu_vrtx_01Uwk1FBk6rrSc6dYnaEY64e"}]},"usage": {"input": 5807,- "output": 345+ "output": 343}},- "0dcdcf9ae339a9d3dfd8b3768ff647dc412f3c56": {+ "fb4ee5ed9895e242986778145316cbad239ec245": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the order for the blue table",- "copilotToolCallId": "toolu_vrtx_014Z2q1RhQUHknLX3cCS7pKF"+ "text": "Submit the first order (blue table)",+ "copilotToolCallId": "toolu_vrtx_01SuepPcu63ezb7A4T1zuKt8"},{"type": "tool_call",@@ -171,23 +171,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_014Z2q1RhQUHknLX3cCS7pKF"+ "id": "toolu_vrtx_01SuepPcu63ezb7A4T1zuKt8"}]},"usage": {- "input": 6258,+ "input": 6256,"output": 95}},- "b2fb521d2ad7135bb1e0528111bec609ce7c42cf": {+ "00580f7cb3850050b9aba09b7a670a2013e977f2": {"result": {"role": "assistant","content": [{"type": "text","text": "Accept the confirmation dialog for the blue table order",- "copilotToolCallId": "toolu_vrtx_016BHZt7CKT6APCTTnXuagiX"+ "copilotToolCallId": "toolu_vrtx_01D7BVzGcbb5GG141CaRGA6b"},{"type": "tool_call",@@ -195,23 +195,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_016BHZt7CKT6APCTTnXuagiX"+ "id": "toolu_vrtx_01D7BVzGcbb5GG141CaRGA6b"}]},"usage": {- "input": 6428,+ "input": 6426,"output": 80}},- "67b334813b8bd02fa4483a5943e094c51ef308a3": {+ "e534d18f4fdb32318c9488f5656d6f51c0eec040": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Click to place another order for the green desk",- "copilotToolCallId": "toolu_vrtx_01JWVZ8S3nSuqCGhUK7GHLbb"+ "text": "Click button to place the second order (green desk)",+ "copilotToolCallId": "toolu_vrtx_01ACMDkwLt9DH2EQrsUZSuAj"},{"type": "tool_call",@@ -220,23 +220,23 @@"element": "Place Another Order button","ref": "e58"},- "id": "toolu_vrtx_01JWVZ8S3nSuqCGhUK7GHLbb"+ "id": "toolu_vrtx_01ACMDkwLt9DH2EQrsUZSuAj"}]},"usage": {- "input": 7315,- "output": 99+ "input": 7313,+ "output": 100}},- "9353bfeb66d5ed7d7a06c7823f7c6e6e3cdc47e4": {+ "30d16e0ea65c3554058fcc2a359f36bfde57fbeb": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Desk as the second product type",- "copilotToolCallId": "toolu_vrtx_015rrG3is2nuSFip8QwMBiFw"+ "text": "Select 'Desk' as the second product",+ "copilotToolCallId": "toolu_vrtx_01Ew1Sw4U4sGhuZquXBSXg81"},{"type": "tool_call",@@ -248,23 +248,23 @@"Desk"]},- "id": "toolu_vrtx_015rrG3is2nuSFip8QwMBiFw"+ "id": "toolu_vrtx_01Ew1Sw4U4sGhuZquXBSXg81"}]},"usage": {- "input": 8034,- "output": 119+ "input": 8033,+ "output": 121}},- "7d74d29ebc3b51cb7fdc56b5c31c70d627562606": {+ "2ff7a84f3e5629e27240bf3e49eddcd874909658": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Green color for the desk",- "copilotToolCallId": "toolu_vrtx_01MHPwTQSnu2K6VShvCKzG4M"+ "text": "Select 'Green' as the color for the desk",+ "copilotToolCallId": "toolu_vrtx_011guHAt5XDWGYodYLbNceRS"},{"type": "tool_call",@@ -276,23 +276,23 @@"Green"]},- "id": "toolu_vrtx_01MHPwTQSnu2K6VShvCKzG4M"+ "id": "toolu_vrtx_011guHAt5XDWGYodYLbNceRS"}]},"usage": {- "input": 8301,- "output": 115+ "input": 8302,+ "output": 120}},- "66e6931fe8bcee63e3c3d21040336166ec592a8b": {+ "9edcdd3441b58a8586ed160e9c250f12f51d1ecd": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in all the customer details for the second order",- "copilotToolCallId": "toolu_vrtx_01V6RPJxv9ARVJmgngagdwSY"+ "text": "Fill in the customer information fields for the second order",+ "copilotToolCallId": "toolu_vrtx_01B9FkesqykHvZqZn8EeN6zz"},{"type": "tool_call",@@ -337,23 +337,23 @@}]},- "id": "toolu_vrtx_01V6RPJxv9ARVJmgngagdwSY"+ "id": "toolu_vrtx_01B9FkesqykHvZqZn8EeN6zz"}]},"usage": {- "input": 8565,+ "input": 8571,"output": 266}},- "3e3132232a53acc21e8225a708b01330ff47a8f4": {+ "6fdde65702d23060ed79f4cf3639b01fba119365": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the order for the green desk",- "copilotToolCallId": "toolu_vrtx_018WLYk9ddEYFagcvSoapq6P"+ "text": "Submit the second order (green desk)",+ "copilotToolCallId": "toolu_vrtx_01NMJ3ZaZUyvycfuW1X88mKS"},{"type": "tool_call",@@ -362,23 +362,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_018WLYk9ddEYFagcvSoapq6P"+ "id": "toolu_vrtx_01NMJ3ZaZUyvycfuW1X88mKS"}]},"usage": {- "input": 9017,+ "input": 9023,"output": 95}},- "6b9dbf9262a11abd13abb2098092ddad1e6cccc8": {+ "d9b25fb9eb9dd671e12b2578ca57750584c7d22d": {"result": {"role": "assistant","content": [{"type": "text","text": "Accept the confirmation dialog for the green desk order",- "copilotToolCallId": "toolu_vrtx_012cdAkmvnsjrEky7Ryg8Mdm"+ "copilotToolCallId": "toolu_vrtx_0194ZbMphKfywXCJrotBARzJ"},{"type": "tool_call",@@ -386,23 +386,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_012cdAkmvnsjrEky7Ryg8Mdm"+ "id": "toolu_vrtx_0194ZbMphKfywXCJrotBARzJ"}]},"usage": {- "input": 9187,+ "input": 9193,"output": 80}},- "561a8e72c67c32b7cea87ea4b22ef35e15fed1e4": {+ "fc2e5cead2dfb952bc04c51ffd6f69911587c20d": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Report the combined total price and maximum delivery time for both orders",- "copilotToolCallId": "toolu_vrtx_017Fy5fXYz26T5JuNM81Ruqb"+ "text": "Report the total price and maximum delivery time for both orders completed: blue table ($353.98, 3 days) and green desk ($299.98, 3 days)",+ "copilotToolCallId": "toolu_vrtx_01AW3AuiY8uPE6qBtY6Nn5GF"},{"type": "tool_call",@@ -411,13 +411,13 @@"price": 653.96,"deliveryDays": 3},- "id": "toolu_vrtx_017Fy5fXYz26T5JuNM81Ruqb"+ "id": "toolu_vrtx_01AW3AuiY8uPE6qBtY6Nn5GF"}]},"usage": {- "input": 10075,- "output": 103+ "input": 10081,+ "output": 128}}}\ No newline at end of filediff --git a/tests/mcp/run-code.spec.ts b/tests/mcp/run-code.spec.tsindex c6929c4f6d..8a10abf1d2 100644--- a/tests/mcp/run-code.spec.ts+++ b/tests/mcp/run-code.spec.ts@@ -25,13 +25,14 @@ test('browser_run_code', async ({ client, server }) => {arguments: { url: server.PREFIX },});+ const code = 'async (page) => await page.getByRole("button", { name: "Submit" }).click()';expect(await client.callTool({name: 'browser_run_code',arguments: {- code: 'await page.getByRole("button", { name: "Submit" }).click()',+ code,},})).toHaveResponse({- code: `await page.getByRole(\"button\", { name: \"Submit\" }).click()`,+ code: `await (${code})(page);`,consoleMessages: expect.stringContaining('- [LOG] Submit'),});});@@ -48,7 +49,7 @@ test('browser_run_code block', async ({ client, server }) => {expect(await client.callTool({name: 'browser_run_code',arguments: {- code: 'await page.getByRole("button", { name: "Submit" }).click(); await page.getByRole("button", { name: "Submit" }).click();',+ code: 'async (page) => { await page.getByRole("button", { name: "Submit" }).click(); await page.getByRole("button", { name: "Submit" }).click(); }',},})).toHaveResponse({code: expect.stringContaining(`await page.getByRole(\"button\", { name: \"Submit\" }).click()`),@@ -68,7 +69,7 @@ test('browser_run_code no-require', async ({ client, server }) => {expect(await client.callTool({name: 'browser_run_code',arguments: {- code: `require('fs');`,+ code: `(page) => { require('fs'); }`,},})).toHaveResponse({result: expect.stringContaining(`ReferenceError: require is not defined`),@@ -84,14 +85,14 @@ test('browser_run_code return value', async ({ client, server }) => {arguments: { url: server.PREFIX },});- const code = 'await page.getByRole("button", { name: "Submit" }).click(); return { message: "Hello, world!" }; await page.getByRole("banner").click();';+ const code = 'async (page) => { await page.getByRole("button", { name: "Submit" }).click(); return { message: "Hello, world!" }; await page.getByRole("banner").click(); }';expect(await client.callTool({name: 'browser_run_code',arguments: {code,},})).toHaveResponse({- code,+ code: `await (${code})(page);`,consoleMessages: expect.stringContaining('- [LOG] Submit'),result: '{"message":"Hello, world!"}',});