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): support return statement in browser_run_code (#38515)
Yury Semikhatsky1075a901fa49
diff --git a/packages/playwright/src/mcp/browser/tools/runCode.ts b/packages/playwright/src/mcp/browser/tools/runCode.tsindex 34c2fd217f..eafe672c30 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. For example: \`await page.getByRole('button', { name: 'Submit' }).click();\``),+ 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();\``),});const runCode = defineTabTool({@@ -47,14 +47,18 @@ const runCode = defineTabTool({await tab.waitForCompletion(async () => {const snippet = `(async () => {try {- ${params.code};- __end__.resolve();+ const result = await (async () => {+ ${params.code};+ })();+ __end__.resolve(JSON.stringify(result));} catch (e) {__end__.reject(e);}})()`;- vm.runInContext(snippet, context);- await __end__;+ await vm.runInContext(snippet, context);+ const result = await __end__;+ if (typeof result === 'string')+ response.addResult(result);});},});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 660806af61..fb1fbba898 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 @@{- "9618bcb461bf695d7a9f9dff483361df53be8815": {+ "72c991f81419aaeb460a1ecea1f6c3678ea7d6e8": {"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 price and delivery information."+ "text": "I'll help you complete this form. Let me start by navigating to the page and then examining its structure."}]},"usage": {- "input": 4498,- "output": 115+ "input": 4510,+ "output": 112}},- "cc75c9676a9e2450d7da588c814a28f5b464fafa": {+ "1a42992144498618920d2cb48b2ead4e5e93f7be": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Navigate to the form page to start the ordering process",- "copilotToolCallId": "toolu_vrtx_019A43H2Z6Vk52FtTtmdgUkv"+ "text": "Navigate to the form page to begin the order process",+ "copilotToolCallId": "toolu_vrtx_019XhE5hdEKbaxtYymNKju9W"},{"type": "tool_call",@@ -29,23 +29,23 @@"arguments": {"url": "http://localhost:<PORT>/evals/fill-form.html"},- "id": "toolu_vrtx_019A43H2Z6Vk52FtTtmdgUkv"+ "id": "toolu_vrtx_019XhE5hdEKbaxtYymNKju9W"}]},"usage": {- "input": 4555,+ "input": 4564,"output": 93}},- "980f66d3b436de385561bc71b6f708714d55a480": {+ "a495b5e67367f80010d7a5f0b16595c2b142329c": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select 'Table' as the first product type",- "copilotToolCallId": "toolu_vrtx_01Q78j2chYdXjoS8zWxgbMsM"+ "text": "Select 'Table' as the product type",+ "copilotToolCallId": "toolu_vrtx_01NrvJy9DRebD4BprU5vA8ZP"},{"type": "tool_call",@@ -57,23 +57,23 @@"Table"]},- "id": "toolu_vrtx_01Q78j2chYdXjoS8zWxgbMsM"+ "id": "toolu_vrtx_01NrvJy9DRebD4BprU5vA8ZP"}]},"usage": {- "input": 5269,- "output": 120+ "input": 5278,+ "output": 119}},- "e1ca8894598ec04fc844f0f661dfb7588695e652": {+ "5dd945f04cdb57e3ffeaa90325b5037d9fc87a26": {"result": {"role": "assistant","content": [{"type": "text","text": "Select 'Blue' as the color for the table",- "copilotToolCallId": "toolu_vrtx_01XL8rxxtEXgN9ykGXpj1cWu"+ "copilotToolCallId": "toolu_vrtx_01PTSi2zZ334cQUKsoKQgxFi"},{"type": "tool_call",@@ -85,23 +85,23 @@"Blue"]},- "id": "toolu_vrtx_01XL8rxxtEXgN9ykGXpj1cWu"+ "id": "toolu_vrtx_01PTSi2zZ334cQUKsoKQgxFi"}]},"usage": {- "input": 5536,+ "input": 5544,"output": 120}},- "dd6dbb24cce4fe3129f0a830faf6048802a55c4b": {+ "7428c2578b57342ef81cbd19caad5edccd210fbd": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the customer details for the first order",- "copilotToolCallId": "toolu_vrtx_013confcdST6e9sheNQFrmV9"+ "text": "Fill in all the customer information fields",+ "copilotToolCallId": "toolu_vrtx_01FsQBa8pvipToHkTxEdr1dS"},{"type": "tool_call",@@ -146,23 +146,23 @@}]},- "id": "toolu_vrtx_013confcdST6e9sheNQFrmV9"+ "id": "toolu_vrtx_01FsQBa8pvipToHkTxEdr1dS"}]},"usage": {- "input": 5805,- "output": 274+ "input": 5813,+ "output": 272}},- "e985be3f0fdacd8dcdb86bc7540bc0d4b102f4ab": {+ "6884d54d0b16587b66507e4e3604e3b42f0353f6": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the first order for a blue table",- "copilotToolCallId": "toolu_vrtx_01CaraEChMZBTSy5yBU2i5Tt"+ "text": "Submit the order for the blue table",+ "copilotToolCallId": "toolu_vrtx_01AFbfH1aCRAKyFw1iZXqsgi"},{"type": "tool_call",@@ -171,23 +171,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_01CaraEChMZBTSy5yBU2i5Tt"+ "id": "toolu_vrtx_01AFbfH1aCRAKyFw1iZXqsgi"}]},"usage": {- "input": 6258,- "output": 96+ "input": 6264,+ "output": 95}},- "0fc3f5e5cde041ffb80ba10114d4d5eb35a5dfcd": {+ "ba67ed2d1889950d83261f2a48cd4092fdd50fb2": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Accept the confirmation dialog for the blue table order",- "copilotToolCallId": "toolu_vrtx_017SiTrBCbZmhLci7SSm123d"+ "text": "Confirm the order for the blue table",+ "copilotToolCallId": "toolu_vrtx_013CfdGuK99ukjohDKXESHiL"},{"type": "tool_call",@@ -195,23 +195,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_017SiTrBCbZmhLci7SSm123d"+ "id": "toolu_vrtx_013CfdGuK99ukjohDKXESHiL"}]},"usage": {- "input": 6429,- "output": 80+ "input": 6434,+ "output": 79}},- "55e321443a3b6141b36538f285e21731b68c337c": {+ "a89877b173ccdbd269ca80d4c0fe0d120c8a8cb2": {"result": {"role": "assistant","content": [{"type": "text","text": "Click the button to place another order for the green desk",- "copilotToolCallId": "toolu_vrtx_01CxZFPgcehAJyZgFN8neKUk"+ "copilotToolCallId": "toolu_vrtx_01Jy58oYC9FLVJQmnjA8ABph"},{"type": "tool_call",@@ -220,23 +220,23 @@"element": "Place Another Order button","ref": "e58"},- "id": "toolu_vrtx_01CxZFPgcehAJyZgFN8neKUk"+ "id": "toolu_vrtx_01Jy58oYC9FLVJQmnjA8ABph"}]},"usage": {- "input": 7319,+ "input": 7323,"output": 101}},- "4d1794ac41beff04dc0fa4145315a5bcc6ddf57f": {+ "72801092ddb20d1b074964adce3842a8e57c07c7": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select 'Desk' as the second product type",- "copilotToolCallId": "toolu_vrtx_01SW8tZ18V51sx8UYX9SkVEH"+ "text": "Select 'Desk' as the product type for the second order",+ "copilotToolCallId": "toolu_vrtx_01CxUcf2MHxGJN5VtdkqMAvB"},{"type": "tool_call",@@ -248,23 +248,23 @@"Desk"]},- "id": "toolu_vrtx_01SW8tZ18V51sx8UYX9SkVEH"+ "id": "toolu_vrtx_01CxUcf2MHxGJN5VtdkqMAvB"}]},"usage": {- "input": 8040,- "output": 122+ "input": 8044,+ "output": 125}},- "db83906845c209b0970abe762d515c3eff3e157d": {+ "1182247a7989725e321b996a893dfde8e2e5e77c": {"result": {"role": "assistant","content": [{"type": "text","text": "Select 'Green' as the color for the desk",- "copilotToolCallId": "toolu_vrtx_01FzNfhLHb8P6etWvaZfVoPd"+ "copilotToolCallId": "toolu_vrtx_01LWcUgiqZMgASddiTJLz4jB"},{"type": "tool_call",@@ -276,23 +276,23 @@"Green"]},- "id": "toolu_vrtx_01FzNfhLHb8P6etWvaZfVoPd"+ "id": "toolu_vrtx_01LWcUgiqZMgASddiTJLz4jB"}]},"usage": {- "input": 8310,+ "input": 8317,"output": 120}},- "e5766217902078a0f31d7d61a66d431fb8330064": {+ "13948c9c44c45b1bc7a0c8c5cf592a6d2c83225d": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the customer details for the second order",- "copilotToolCallId": "toolu_vrtx_01DTZk3sgWdkwEcTnQvNWk8u"+ "text": "Fill in all the customer information fields for the second order",+ "copilotToolCallId": "toolu_vrtx_01W6kFr8q8Mg32jSZ44XqpXV"},{"type": "tool_call",@@ -337,23 +337,23 @@}]},- "id": "toolu_vrtx_01DTZk3sgWdkwEcTnQvNWk8u"+ "id": "toolu_vrtx_01W6kFr8q8Mg32jSZ44XqpXV"}]},"usage": {- "input": 8579,- "output": 266+ "input": 8586,+ "output": 268}},- "eb966490e95b464a6ab8834e3bd7cb2909ac17ea": {+ "a0f3de44f39022284ecc076163a57958ea6d4d94": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the second order for a green desk",- "copilotToolCallId": "toolu_vrtx_01MhFtYhTdNE99Zzzzc7q2pF"+ "text": "Submit the order for the green desk",+ "copilotToolCallId": "toolu_vrtx_01Cw23f6uikMjv8X3yHKxTHt"},{"type": "tool_call",@@ -362,23 +362,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_01MhFtYhTdNE99Zzzzc7q2pF"+ "id": "toolu_vrtx_01Cw23f6uikMjv8X3yHKxTHt"}]},"usage": {- "input": 9032,- "output": 96+ "input": 9041,+ "output": 95}},- "053fba57de7fbb68c913562b623324a34788df24": {+ "40f60ed35c283a4554043cf2b214e0f56e894927": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Accept the confirmation dialog for the green desk order",- "copilotToolCallId": "toolu_vrtx_01CB3dJULpX59rXX3S9Spkbb"+ "text": "Confirm the order for the green desk",+ "copilotToolCallId": "toolu_vrtx_01BjnDPCGV1GtDy3oGzLTNah"},{"type": "tool_call",@@ -386,23 +386,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_01CB3dJULpX59rXX3S9Spkbb"+ "id": "toolu_vrtx_01BjnDPCGV1GtDy3oGzLTNah"}]},"usage": {- "input": 9203,- "output": 80+ "input": 9211,+ "output": 79}},- "e62145520af148b1bb0e735f14cddab91f4bf639": {+ "9b6e85cce940804cd08969342cb6cbea1614b0ad": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Report the total price for both items and maximum delivery time. Blue table: $353.98, Green desk: $299.98. Total: $653.96. Both orders have 3 days delivery.",- "copilotToolCallId": "toolu_vrtx_01J347sjiTcJ4P3WUq3ehW9R"+ "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"},{"type": "tool_call",@@ -411,13 +411,13 @@"price": 653.96,"deliveryDays": 3},- "id": "toolu_vrtx_01J347sjiTcJ4P3WUq3ehW9R"+ "id": "toolu_vrtx_01XiqswwnGjpuex33KCAft1Q"}]},"usage": {- "input": 10094,- "output": 134+ "input": 10101,+ "output": 130}}}\ 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 13df8bbaed..236f188c92 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 @@{- "9618bcb461bf695d7a9f9dff483361df53be8815": {+ "72c991f81419aaeb460a1ecea1f6c3678ea7d6e8": {"result": {"role": "assistant","content": [{"type": "text",- "text": "I'll help you navigate to the form, fill in the order details, and report back the results. Let me start by navigating to the page."+ "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."}]},"usage": {- "input": 4498,- "output": 120+ "input": 4510,+ "output": 121}},- "6dcc2c52acd06283151dfbd5e29f59186a89e2d5": {+ "42c8b6a0c145e30b6c00aec696aac3c310a17994": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Navigate to the form page to start the order process",- "copilotToolCallId": "toolu_vrtx_01Jekq7CtSogEHaP6U7MYCuZ"+ "text": "Navigate to the form page",+ "copilotToolCallId": "toolu_vrtx_0182jDuGXtgRjkMfyT7Lmrh6"},{"type": "tool_call",@@ -29,23 +29,23 @@"arguments": {"url": "http://localhost:<PORT>/evals/fill-form.html"},- "id": "toolu_vrtx_01Jekq7CtSogEHaP6U7MYCuZ"+ "id": "toolu_vrtx_0182jDuGXtgRjkMfyT7Lmrh6"}]},"usage": {- "input": 4560,- "output": 93+ "input": 4568,+ "output": 88}},- "e0aa88b89e1a8fe978fbed56774a0f57621ac72d": {+ "92e77e44f298c5a44472e8cd81cbd97d8b698b7d": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Table as the first product",- "copilotToolCallId": "toolu_vrtx_01BaHkDosZGEZXs6YjuvLdFa"+ "text": "Select Table as the product type",+ "copilotToolCallId": "toolu_vrtx_01WkF25PPYBKNMaciBu9MSCS"},{"type": "tool_call",@@ -57,23 +57,23 @@"Table"]},- "id": "toolu_vrtx_01BaHkDosZGEZXs6YjuvLdFa"+ "id": "toolu_vrtx_01WkF25PPYBKNMaciBu9MSCS"}]},"usage": {- "input": 5274,+ "input": 5277,"output": 116}},- "61aba6d5fc9c3ac919b5336e19b1cd52fdd02121": {+ "da1c109ec016828a7a015f66b3e2de3d24556d38": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Blue as the color for the table",- "copilotToolCallId": "toolu_vrtx_01WN9vgEzcxWmUgDADdX4b3T"+ "text": "Select Blue as the color",+ "copilotToolCallId": "toolu_vrtx_011EQL9QTyDnSzdxKkWa9XPT"},{"type": "tool_call",@@ -85,179 +85,84 @@"Blue"]},- "id": "toolu_vrtx_01WN9vgEzcxWmUgDADdX4b3T"+ "id": "toolu_vrtx_011EQL9QTyDnSzdxKkWa9XPT"}]},"usage": {- "input": 5537,- "output": 117- }- },- "33d14001ce5af7847b134df5adf2229124538057": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the name field",- "copilotToolCallId": "toolu_vrtx_019UBYFGPaM1r1s7p2WJut1W"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Full Name textbox",- "ref": "e13",- "text": "John Doe"- },- "id": "toolu_vrtx_019UBYFGPaM1r1s7p2WJut1W"- }- ]- },- "usage": {- "input": 5803,+ "input": 5540,"output": 114}},- "74038cf37965dc7824a01a036e9a04e4bae6a721": {+ "537da538eb262d9e98400b3c55eec586b5f072aa": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the email field",- "copilotToolCallId": "toolu_vrtx_01MEoP2sPB6DqaGGv3ERgcGs"+ "text": "Fill in the customer information fields",+ "copilotToolCallId": "toolu_vrtx_01S36DvPGHV69bRJtoDZHK2a"},{"type": "tool_call",- "name": "browser_type",+ "name": "browser_fill_form","arguments": {- "element": "Email Address textbox",- "ref": "e16",- "text": "[email protected]"- },- "id": "toolu_vrtx_01MEoP2sPB6DqaGGv3ERgcGs"- }- ]- },- "usage": {- "input": 5963,- "output": 116- }- },- "2136b8e6418e90e20ee465f406579da6bf065bd5": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the street address field",- "copilotToolCallId": "toolu_vrtx_011AAMYvdaj9v6Lj6MWRZRdh"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Street Address textbox",- "ref": "e19",- "text": "123 Main St"- },- "id": "toolu_vrtx_011AAMYvdaj9v6Lj6MWRZRdh"- }- ]- },- "usage": {- "input": 6127,- "output": 116- }- },- "29800f02b0f51a774d4e7f69f99b1c9ac4f26511": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the city field with Anytown",- "copilotToolCallId": "toolu_vrtx_01X3nicst7BVm8LWbSoHM59s"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "City textbox",- "ref": "e22",- "text": "Anytown"- },- "id": "toolu_vrtx_01X3nicst7BVm8LWbSoHM59s"- }- ]- },- "usage": {- "input": 6290,- "output": 117- }- },- "1de325e1e70e801b92a1ad6e1c628fa084d862b8": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the state field with XYZ",- "copilotToolCallId": "toolu_vrtx_0154bhMfXbG9vcfEKYHKL8AJ"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "State/Province textbox",- "ref": "e25",- "text": "XYZ"- },- "id": "toolu_vrtx_0154bhMfXbG9vcfEKYHKL8AJ"- }- ]- },- "usage": {- "input": 6452,- "output": 119- }- },- "f80886b488400b4a7840b02abf25cc7b8d334394": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the ZIP code field",- "copilotToolCallId": "toolu_vrtx_017KCKyqrm6Nr1RJ8MNVjYrU"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "ZIP/Postal Code textbox",- "ref": "e28",- "text": "12345"+ "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"+ }+ ]},- "id": "toolu_vrtx_017KCKyqrm6Nr1RJ8MNVjYrU"+ "id": "toolu_vrtx_01S36DvPGHV69bRJtoDZHK2a"}]},"usage": {- "input": 6618,- "output": 117+ "input": 5803,+ "output": 343}},- "6a4d45c6995b3070d336621bc3f3587d9bf23b1d": {+ "03dbf3f2e32915a664b5e2296cba1fb4e7f0ac66": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the first order (blue table)",- "copilotToolCallId": "toolu_vrtx_0195LEteYBG6fxNVGxPuyb3k"+ "text": "Click the Order button to submit the first order (blue table)",+ "copilotToolCallId": "toolu_vrtx_01XSzSidJJXms5RR5Tz4SE5A"},{"type": "tool_call",@@ -266,23 +171,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_0195LEteYBG6fxNVGxPuyb3k"+ "id": "toolu_vrtx_01XSzSidJJXms5RR5Tz4SE5A"}]},"usage": {- "input": 6783,- "output": 95+ "input": 6253,+ "output": 100}},- "7744f2df7189cd0edd36fd53671660cced79f716": {+ "2fd7f663112687e87211fe4816aeb2e513c71530": {"result": {"role": "assistant","content": [{"type": "text","text": "Accept the confirmation dialog for the blue table order",- "copilotToolCallId": "toolu_vrtx_01SAAcwWFPqroJzW7My84G4z"+ "copilotToolCallId": "toolu_vrtx_01Ct5aqw5kcJ1ykvTwzQYdhA"},{"type": "tool_call",@@ -290,23 +195,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_01SAAcwWFPqroJzW7My84G4z"+ "id": "toolu_vrtx_01Ct5aqw5kcJ1ykvTwzQYdhA"}]},"usage": {- "input": 6953,+ "input": 6428,"output": 80}},- "e8ec627c81c07f9566337a80ee39323d3210abc0": {+ "1c8b28e9fb081fad8086fd12d21e6f0dcedc9fa7": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Click Place Another Order button to order the second item (green desk)",- "copilotToolCallId": "toolu_vrtx_01A6XjxYpScgiKggZPmdyyBL"+ "text": "Click to place another order for the green desk",+ "copilotToolCallId": "toolu_vrtx_01TQfpcQL4aT1YtxsqA81p7V"},{"type": "tool_call",@@ -315,23 +220,23 @@"element": "Place Another Order button","ref": "e58"},- "id": "toolu_vrtx_01A6XjxYpScgiKggZPmdyyBL"+ "id": "toolu_vrtx_01TQfpcQL4aT1YtxsqA81p7V"}]},"usage": {- "input": 7840,- "output": 103+ "input": 7318,+ "output": 99}},- "acbaa036380782cb995285df7bc2346ef2b6d756": {+ "fc6cbac102e05d7d127b266656ee2b6035a1e603": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Desk as the second product",- "copilotToolCallId": "toolu_vrtx_01Ko4WVozNnZTuvY9AP3YmeC"+ "text": "Select Desk as the product type",+ "copilotToolCallId": "toolu_vrtx_011vEW7dtP7jWofnj9YsXbWV"},{"type": "tool_call",@@ -343,23 +248,23 @@"Desk"]},- "id": "toolu_vrtx_01Ko4WVozNnZTuvY9AP3YmeC"+ "id": "toolu_vrtx_011vEW7dtP7jWofnj9YsXbWV"}]},"usage": {- "input": 8563,+ "input": 8037,"output": 118}},- "462192a6362e907a2b9ea0e6e545b521a3e3c09d": {+ "939dc5610f2a48f8b252a1710403cfb5624c17cf": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Green as the color for the desk",- "copilotToolCallId": "toolu_vrtx_01CDBDKtPA7ZwbTJJRHCUFoM"+ "text": "Select Green as the color",+ "copilotToolCallId": "toolu_vrtx_01UFiQrmnn9tSedmEBy5xJqV"},{"type": "tool_call",@@ -371,179 +276,84 @@"Green"]},- "id": "toolu_vrtx_01CDBDKtPA7ZwbTJJRHCUFoM"+ "id": "toolu_vrtx_01UFiQrmnn9tSedmEBy5xJqV"}]},"usage": {- "input": 8829,- "output": 117- }- },- "13567665222bacf36f5d7157ef02c0d22612676c": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the name field for second order",- "copilotToolCallId": "toolu_vrtx_01ARssnd9eTw1uHRbWLFQaAA"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Full Name textbox",- "ref": "e13",- "text": "John Doe"- },- "id": "toolu_vrtx_01ARssnd9eTw1uHRbWLFQaAA"- }- ]- },- "usage": {- "input": 9095,- "output": 117- }- },- "7b8bd077cd1541bfca55303c45fd96a4fdd6337e": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the email field for second order",- "copilotToolCallId": "toolu_vrtx_01QwWGsWv9EKzghtCawineA5"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Email Address textbox",- "ref": "e16",- "text": "[email protected]"- },- "id": "toolu_vrtx_01QwWGsWv9EKzghtCawineA5"- }- ]- },- "usage": {- "input": 9258,- "output": 119- }- },- "aec3d303241453b82b622337aea0a774f1490908": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the street address field for second order",- "copilotToolCallId": "toolu_vrtx_01KXY1BeK5D62GkRwrKuTzoD"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Street Address textbox",- "ref": "e19",- "text": "123 Main St"- },- "id": "toolu_vrtx_01KXY1BeK5D62GkRwrKuTzoD"- }- ]- },- "usage": {- "input": 9425,- "output": 119- }- },- "ab3c87f72a039a7bd16601c4a77ef6c6f6c8d36f": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the city field for second order",- "copilotToolCallId": "toolu_vrtx_01AQ8ymjcSsF9inQD4Vdi9qx"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "City textbox",- "ref": "e22",- "text": "Anytown"- },- "id": "toolu_vrtx_01AQ8ymjcSsF9inQD4Vdi9qx"- }- ]- },- "usage": {- "input": 9591,- "output": 116- }- },- "3444e227160908670bb9267f25ab95112550a5b6": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the state field for second order",- "copilotToolCallId": "toolu_vrtx_013sgmYiQHkztUVLRY8FUEKq"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "State/Province textbox",- "ref": "e25",- "text": "XYZ"- },- "id": "toolu_vrtx_013sgmYiQHkztUVLRY8FUEKq"- }- ]- },- "usage": {- "input": 9752,- "output": 118+ "input": 8303,+ "output": 114}},- "a284cc1b4f7f15a31cea4f5b6301058cf0935ea4": {+ "01b1ce85e46110e1d66ad63bdb7df7afe2b0ddfe": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the ZIP code field for second order",- "copilotToolCallId": "toolu_vrtx_01Ep3dXycgf6gLsB45tQgisL"+ "text": "Fill in the customer information fields for the second order",+ "copilotToolCallId": "toolu_vrtx_01LzuoduwZs76FdYAn266BnY"},{"type": "tool_call",- "name": "browser_type",+ "name": "browser_fill_form","arguments": {- "element": "ZIP/Postal Code textbox",- "ref": "e28",- "text": "12345"+ "fields": [+ {+ "name": "Full Name",+ "ref": "e13",+ "type": "textbox",+ "value": "John Doe"+ },+ {+ "name": "Email Address",+ "ref": "e16",+ "type": "textbox",+ "value": "[email protected]"+ },+ {+ "name": "Street Address",+ "ref": "e19",+ "type": "textbox",+ "value": "123 Main St"+ },+ {+ "name": "City",+ "ref": "e22",+ "type": "textbox",+ "value": "Anytown"+ },+ {+ "name": "State/Province",+ "ref": "e25",+ "type": "textbox",+ "value": "XYZ state"+ },+ {+ "name": "ZIP/Postal Code",+ "ref": "e28",+ "type": "textbox",+ "value": "12345"+ }+ ]},- "id": "toolu_vrtx_01Ep3dXycgf6gLsB45tQgisL"+ "id": "toolu_vrtx_01LzuoduwZs76FdYAn266BnY"}]},"usage": {- "input": 9917,- "output": 120+ "input": 8566,+ "output": 267}},- "fd7b954cb041fcf5fa0fb998761dd9b398cc1cee": {+ "338c070381aa00929c40829eceed5153ba60efee": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Submit the second order (green desk)",- "copilotToolCallId": "toolu_vrtx_01Ugc3Z7yYLZtiTuMifEfhAZ"+ "text": "Click the Order button to submit the second order (green desk)",+ "copilotToolCallId": "toolu_vrtx_015n9C4cAurXf81UkQSPjZTv"},{"type": "tool_call",@@ -552,23 +362,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_01Ugc3Z7yYLZtiTuMifEfhAZ"+ "id": "toolu_vrtx_015n9C4cAurXf81UkQSPjZTv"}]},"usage": {- "input": 10085,- "output": 95+ "input": 9020,+ "output": 100}},- "6c7a1d4b5bb21c55df6eaaeee1cc3fd93a20978c": {+ "b1da37d5c950a5aaa737d5ea9b3d67330481463d": {"result": {"role": "assistant","content": [{"type": "text","text": "Accept the confirmation dialog for the green desk order",- "copilotToolCallId": "toolu_vrtx_01Lpxhy6JBxhSTkJHFemHrEc"+ "copilotToolCallId": "toolu_vrtx_01HeUWmfMZk2vEgv9ga53D4x"},{"type": "tool_call",@@ -576,23 +386,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_01Lpxhy6JBxhSTkJHFemHrEc"+ "id": "toolu_vrtx_01HeUWmfMZk2vEgv9ga53D4x"}]},"usage": {- "input": 10255,+ "input": 9195,"output": 80}},- "7a450713f8ee68d4c1e806ae3144c9c167335ba5": {+ "8785b545d945c6fac1322e50df31385f4c85cc42": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Report the total price and maximum delivery time for both orders: Blue Table ($353.98, 3 days) and Green Desk ($299.98, 3 days). Total: $653.96, Max delivery: 3 days",- "copilotToolCallId": "toolu_vrtx_01UvTtaaPPEWqLR1mtJjLB3k"+ "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"},{"type": "tool_call",@@ -601,13 +411,13 @@"price": 653.96,"deliveryDays": 3},- "id": "toolu_vrtx_01UvTtaaPPEWqLR1mtJjLB3k"+ "id": "toolu_vrtx_01PgWgX6e8uvma9crjhjH5u9"}]},"usage": {- "input": 11143,- "output": 143+ "input": 10086,+ "output": 135}}}\ 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 2f7073a0bc..cb97f4c6ec 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 @@{- "9618bcb461bf695d7a9f9dff483361df53be8815": {+ "72c991f81419aaeb460a1ecea1f6c3678ea7d6e8": {"result": {"role": "assistant","content": [{"type": "text",- "text": "I'll help you navigate to the form, fill it out with the specified items and details, and report back the results."+ "text": "I'll help you complete this task. Let me start by navigating to the page and then analyzing what's available."}]},"usage": {- "input": 4498,+ "input": 4510,"output": 118}},- "651ad41a348d6db6488f4746b0b4905094330b85": {+ "6651fa402a8ca24a68ca6697420742dd09f26dc5": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Navigate to the form page",- "copilotToolCallId": "toolu_vrtx_015A4Qxa4UTA1YLM31KPKBk5"+ "text": "Navigate to the form page to start the order process",+ "copilotToolCallId": "toolu_vrtx_01VgTpcKYUDAFicAGRhqgv1K"},{"type": "tool_call",@@ -29,23 +29,23 @@"arguments": {"url": "http://localhost:<PORT>/evals/fill-form.html"},- "id": "toolu_vrtx_015A4Qxa4UTA1YLM31KPKBk5"+ "id": "toolu_vrtx_01VgTpcKYUDAFicAGRhqgv1K"}]},"usage": {- "input": 4554,- "output": 88+ "input": 4565,+ "output": 93}},- "c03b93553be7a4f582a9481cd7ceef812cc3f1a2": {+ "bdd6a91751a11e0c17a443d889d3d7ab4b13b76e": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Table as the first product",- "copilotToolCallId": "toolu_vrtx_01URHnaVsJXwPYiCcwLfLqLP"+ "text": "Select Table as the first product type",+ "copilotToolCallId": "toolu_vrtx_01XxETPPBjeR1uuU7EhHWASo"},{"type": "tool_call",@@ -57,23 +57,23 @@"Table"]},- "id": "toolu_vrtx_01URHnaVsJXwPYiCcwLfLqLP"+ "id": "toolu_vrtx_01XxETPPBjeR1uuU7EhHWASo"}]},"usage": {- "input": 5263,- "output": 116+ "input": 5279,+ "output": 117}},- "45c9e0f04d5ec6adea27cb529f321db6b7f3a217": {+ "b6dd4ba3f196b4a0cdd7c95ff64bdf2d6ac282a4": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Blue as the color for the table",- "copilotToolCallId": "toolu_vrtx_01MUvkws5Pqa1NKuidpY27Js"+ "text": "Select Blue color for the table",+ "copilotToolCallId": "toolu_vrtx_014e6hXbw2VxMQ5DNfx5rNeL"},{"type": "tool_call",@@ -85,179 +85,84 @@"Blue"]},- "id": "toolu_vrtx_01MUvkws5Pqa1NKuidpY27Js"- }- ]- },- "usage": {- "input": 5526,- "output": 117- }- },- "f01b96c033547e823a688aaa59e57e45d581244f": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the Full Name field",- "copilotToolCallId": "toolu_vrtx_01VzYhHy84gaE8mvmUgmPsoa"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Full Name textbox",- "ref": "e13",- "text": "John Doe"- },- "id": "toolu_vrtx_01VzYhHy84gaE8mvmUgmPsoa"+ "id": "toolu_vrtx_014e6hXbw2VxMQ5DNfx5rNeL"}]},"usage": {- "input": 5792,+ "input": 5543,"output": 115}},- "6de46f95cbe9459b6af5f56cbab64e6a140afa14": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the Email Address field",- "copilotToolCallId": "toolu_vrtx_019meT2mNudZyQwmT7fnCrsA"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Email Address textbox",- "ref": "e16",- "text": "[email protected]"- },- "id": "toolu_vrtx_019meT2mNudZyQwmT7fnCrsA"- }- ]- },- "usage": {- "input": 5953,- "output": 117- }- },- "e25f3a5f2011bdddcb17e6797577346ccef2899f": {+ "3b85ff525086990b227d917c99853cefef645497": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the Street Address field",- "copilotToolCallId": "toolu_vrtx_01LvRRG2trw2FbUE3AZSJk7Z"+ "text": "Fill in all the customer details for the order",+ "copilotToolCallId": "toolu_vrtx_0153XH9WcQ8BKzfYdZvm6Feb"},{"type": "tool_call",- "name": "browser_type",+ "name": "browser_fill_form","arguments": {- "element": "Street Address textbox",- "ref": "e19",- "text": "123 Main St"- },- "id": "toolu_vrtx_01LvRRG2trw2FbUE3AZSJk7Z"- }- ]- },- "usage": {- "input": 6118,- "output": 116- }- },- "e939604b2f4bd1eafeb5be883ca4811d8af3c5f6": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the City field",- "copilotToolCallId": "toolu_vrtx_01YcSZZtz11FVhUB5ZuCiVHT"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "City textbox",- "ref": "e22",- "text": "Anytown"- },- "id": "toolu_vrtx_01YcSZZtz11FVhUB5ZuCiVHT"- }- ]- },- "usage": {- "input": 6281,- "output": 113- }- },- "b7ebb78e78e4c0e4cebfd3802160e994dff80374": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the State/Province field",- "copilotToolCallId": "toolu_vrtx_01KR4DM6jFZFX1ze7kMisxa6"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "State/Province textbox",- "ref": "e25",- "text": "XYZ"- },- "id": "toolu_vrtx_01KR4DM6jFZFX1ze7kMisxa6"- }- ]- },- "usage": {- "input": 6439,- "output": 117- }- },- "a808e5354acfb3617a6a9723dfe95478e2652e63": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the ZIP/Postal Code field",- "copilotToolCallId": "toolu_vrtx_01PtJxTGzWz5ogj7d1nm2aKS"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "ZIP/Postal Code textbox",- "ref": "e28",- "text": "12345"+ "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"+ },+ {+ "name": "ZIP/Postal Code",+ "type": "textbox",+ "ref": "e28",+ "value": "12345"+ }+ ]},- "id": "toolu_vrtx_01PtJxTGzWz5ogj7d1nm2aKS"+ "id": "toolu_vrtx_0153XH9WcQ8BKzfYdZvm6Feb"}]},"usage": {- "input": 6603,- "output": 120+ "input": 5807,+ "output": 345}},- "d9b4832077829284be3acbe935349b329c47518c": {+ "0dcdcf9ae339a9d3dfd8b3768ff647dc412f3c56": {"result": {"role": "assistant","content": [{"type": "text","text": "Submit the order for the blue table",- "copilotToolCallId": "toolu_vrtx_01FDvdEQK9V9deeRt3WJLAok"+ "copilotToolCallId": "toolu_vrtx_014Z2q1RhQUHknLX3cCS7pKF"},{"type": "tool_call",@@ -266,23 +171,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_01FDvdEQK9V9deeRt3WJLAok"+ "id": "toolu_vrtx_014Z2q1RhQUHknLX3cCS7pKF"}]},"usage": {- "input": 6771,+ "input": 6258,"output": 95}},- "2cc8d0e79ffa0eaca9792d2b1e292688effcca6b": {+ "b2fb521d2ad7135bb1e0528111bec609ce7c42cf": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Accept the order confirmation for blue table",- "copilotToolCallId": "toolu_vrtx_014eUSnWVV85a5yhgtkhx7uN"+ "text": "Accept the confirmation dialog for the blue table order",+ "copilotToolCallId": "toolu_vrtx_016BHZt7CKT6APCTTnXuagiX"},{"type": "tool_call",@@ -290,23 +195,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_014eUSnWVV85a5yhgtkhx7uN"+ "id": "toolu_vrtx_016BHZt7CKT6APCTTnXuagiX"}]},"usage": {- "input": 6941,- "output": 78+ "input": 6428,+ "output": 80}},- "92e5599d7913f24dde5c2eedafede877dfc76594": {+ "67b334813b8bd02fa4483a5943e094c51ef308a3": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Click Place Another Order button to order the green desk",- "copilotToolCallId": "toolu_vrtx_01VWmtWDYCiEQ51LqFSqRVyt"+ "text": "Click to place another order for the green desk",+ "copilotToolCallId": "toolu_vrtx_01JWVZ8S3nSuqCGhUK7GHLbb"},{"type": "tool_call",@@ -315,23 +220,23 @@"element": "Place Another Order button","ref": "e58"},- "id": "toolu_vrtx_01VWmtWDYCiEQ51LqFSqRVyt"+ "id": "toolu_vrtx_01JWVZ8S3nSuqCGhUK7GHLbb"}]},"usage": {- "input": 7826,- "output": 100+ "input": 7315,+ "output": 99}},- "da4ec3f6c3c748eff025f787e4264ad01fcfb0f5": {+ "9353bfeb66d5ed7d7a06c7823f7c6e6e3cdc47e4": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Desk as the second product",- "copilotToolCallId": "toolu_vrtx_018KwJC7fJJSrPKtknozFFFr"+ "text": "Select Desk as the second product type",+ "copilotToolCallId": "toolu_vrtx_015rrG3is2nuSFip8QwMBiFw"},{"type": "tool_call",@@ -343,23 +248,23 @@"Desk"]},- "id": "toolu_vrtx_018KwJC7fJJSrPKtknozFFFr"+ "id": "toolu_vrtx_015rrG3is2nuSFip8QwMBiFw"}]},"usage": {- "input": 8546,- "output": 118+ "input": 8034,+ "output": 119}},- "6ee97d09a08742750496ab8b193d715eca619172": {+ "7d74d29ebc3b51cb7fdc56b5c31c70d627562606": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Select Green as the color for the desk",- "copilotToolCallId": "toolu_vrtx_01PAWTp8xxLpWDcekkdVD9bF"+ "text": "Select Green color for the desk",+ "copilotToolCallId": "toolu_vrtx_01MHPwTQSnu2K6VShvCKzG4M"},{"type": "tool_call",@@ -371,179 +276,84 @@"Green"]},- "id": "toolu_vrtx_01PAWTp8xxLpWDcekkdVD9bF"+ "id": "toolu_vrtx_01MHPwTQSnu2K6VShvCKzG4M"}]},"usage": {- "input": 8812,- "output": 117- }- },- "b6dfb1610253206d76e22c6cb14b79e1a8868dc5": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the Full Name field for second order",- "copilotToolCallId": "toolu_vrtx_018Usc5oevz9wb9ZKpftC4sH"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Full Name textbox",- "ref": "e13",- "text": "John Doe"- },- "id": "toolu_vrtx_018Usc5oevz9wb9ZKpftC4sH"- }- ]- },- "usage": {- "input": 9078,- "output": 118- }- },- "bb68d65b11d6f1744be333a30b4b2a2910559d8b": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the Email Address field for second order",- "copilotToolCallId": "toolu_vrtx_0157WoyBbU9kXomtZMpLvnBd"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Email Address textbox",- "ref": "e16",- "text": "[email protected]"- },- "id": "toolu_vrtx_0157WoyBbU9kXomtZMpLvnBd"- }- ]- },- "usage": {- "input": 9242,- "output": 120- }- },- "a38c3850dcde9ef2dafcc13e03d17212dbd2de9d": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the Street Address field for second order",- "copilotToolCallId": "toolu_vrtx_01F9YjYR5DXdVYf8bebw1fdG"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "Street Address textbox",- "ref": "e19",- "text": "123 Main St"- },- "id": "toolu_vrtx_01F9YjYR5DXdVYf8bebw1fdG"- }- ]- },- "usage": {- "input": 9410,- "output": 119- }- },- "59648493dce87d10e25e5d50abebac4e2392ecc1": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the City field for second order",- "copilotToolCallId": "toolu_vrtx_01BETdPBJWrtPMurfg49Vjoj"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "City textbox",- "ref": "e22",- "text": "Anytown"- },- "id": "toolu_vrtx_01BETdPBJWrtPMurfg49Vjoj"- }- ]- },- "usage": {- "input": 9576,- "output": 116- }- },- "a87a7f06ffdf0d79613739ac83936a87142c6d7f": {- "result": {- "role": "assistant",- "content": [- {- "type": "text",- "text": "Fill in the State/Province field for second order",- "copilotToolCallId": "toolu_vrtx_01KXjCLqC74fLfD56Yb2rb3T"- },- {- "type": "tool_call",- "name": "browser_type",- "arguments": {- "element": "State/Province textbox",- "ref": "e25",- "text": "XYZ"- },- "id": "toolu_vrtx_01KXjCLqC74fLfD56Yb2rb3T"- }- ]- },- "usage": {- "input": 9737,- "output": 120+ "input": 8301,+ "output": 115}},- "0edb63f376b23ae85e2319c8dcfd8167be315357": {+ "66e6931fe8bcee63e3c3d21040336166ec592a8b": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Fill in the ZIP/Postal Code field for second order",- "copilotToolCallId": "toolu_vrtx_01QdpV2UD1ynJBEz3t2vEBZY"+ "text": "Fill in all the customer details for the second order",+ "copilotToolCallId": "toolu_vrtx_01V6RPJxv9ARVJmgngagdwSY"},{"type": "tool_call",- "name": "browser_type",+ "name": "browser_fill_form","arguments": {- "element": "ZIP/Postal Code textbox",- "ref": "e28",- "text": "12345"+ "fields": [+ {+ "name": "Full Name",+ "ref": "e13",+ "type": "textbox",+ "value": "John Doe"+ },+ {+ "name": "Email Address",+ "ref": "e16",+ "type": "textbox",+ "value": "[email protected]"+ },+ {+ "name": "Street Address",+ "ref": "e19",+ "type": "textbox",+ "value": "123 Main St"+ },+ {+ "name": "City",+ "ref": "e22",+ "type": "textbox",+ "value": "Anytown"+ },+ {+ "name": "State/Province",+ "ref": "e25",+ "type": "textbox",+ "value": "XYZ"+ },+ {+ "name": "ZIP/Postal Code",+ "ref": "e28",+ "type": "textbox",+ "value": "12345"+ }+ ]},- "id": "toolu_vrtx_01QdpV2UD1ynJBEz3t2vEBZY"+ "id": "toolu_vrtx_01V6RPJxv9ARVJmgngagdwSY"}]},"usage": {- "input": 9904,- "output": 123+ "input": 8565,+ "output": 266}},- "4a49bf78bda39f22b05bb0dabdb778eab42f5d0e": {+ "3e3132232a53acc21e8225a708b01330ff47a8f4": {"result": {"role": "assistant","content": [{"type": "text","text": "Submit the order for the green desk",- "copilotToolCallId": "toolu_vrtx_018WKajMd3gK6LsoHkMSqqF4"+ "copilotToolCallId": "toolu_vrtx_018WLYk9ddEYFagcvSoapq6P"},{"type": "tool_call",@@ -552,23 +362,23 @@"element": "Order button","ref": "e29"},- "id": "toolu_vrtx_018WKajMd3gK6LsoHkMSqqF4"+ "id": "toolu_vrtx_018WLYk9ddEYFagcvSoapq6P"}]},"usage": {- "input": 10075,+ "input": 9017,"output": 95}},- "9a1806f90b31427e91b08c182a1f530b01687395": {+ "6b9dbf9262a11abd13abb2098092ddad1e6cccc8": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Accept the order confirmation for green desk",- "copilotToolCallId": "toolu_vrtx_01958UH1ER5ox2DiKfqF6gSp"+ "text": "Accept the confirmation dialog for the green desk order",+ "copilotToolCallId": "toolu_vrtx_012cdAkmvnsjrEky7Ryg8Mdm"},{"type": "tool_call",@@ -576,23 +386,23 @@"arguments": {"accept": true},- "id": "toolu_vrtx_01958UH1ER5ox2DiKfqF6gSp"+ "id": "toolu_vrtx_012cdAkmvnsjrEky7Ryg8Mdm"}]},"usage": {- "input": 10245,- "output": 78+ "input": 9187,+ "output": 80}},- "70d0aca5ce593777cf52a420da7aece1173004a1": {+ "561a8e72c67c32b7cea87ea4b22ef35e15fed1e4": {"result": {"role": "assistant","content": [{"type": "text",- "text": "Report the total price for both items ($353.98 + $299.98 = $653.96) and maximum estimated delivery (3 days for both)",- "copilotToolCallId": "toolu_vrtx_01R97Mi28WVqRvEH25ky3aqa"+ "text": "Report the combined total price and maximum delivery time for both orders",+ "copilotToolCallId": "toolu_vrtx_017Fy5fXYz26T5JuNM81Ruqb"},{"type": "tool_call",@@ -601,13 +411,13 @@"price": 653.96,"deliveryDays": 3},- "id": "toolu_vrtx_01R97Mi28WVqRvEH25ky3aqa"+ "id": "toolu_vrtx_017Fy5fXYz26T5JuNM81Ruqb"}]},"usage": {- "input": 11131,- "output": 125+ "input": 10075,+ "output": 103}}}\ No newline at end of filediff --git a/tests/mcp/run-code.spec.ts b/tests/mcp/run-code.spec.tsindex a2e9471939..c6929c4f6d 100644--- a/tests/mcp/run-code.spec.ts+++ b/tests/mcp/run-code.spec.ts@@ -74,3 +74,25 @@ test('browser_run_code no-require', async ({ client, server }) => {result: expect.stringContaining(`ReferenceError: require is not defined`),});});++test('browser_run_code return value', async ({ client, server }) => {+ server.setContent('/', `+ <button onclick="console.log('Submit')">Submit</button>+ `, 'text/html');+ await client.callTool({+ name: 'browser_navigate',+ arguments: { url: server.PREFIX },+ });++ const code = '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,+ consoleMessages: expect.stringContaining('- [LOG] Submit'),+ result: '{"message":"Hello, world!"}',+ });+});