mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-26 08:32:26 +08:00
Fix misleading browser_close message by adding resultOverride
Co-authored-by: Skn0tt <14912729+Skn0tt@users.noreply.github.com>
This commit is contained in:
parent
a5ffc9671b
commit
37973f0876
@ -34,6 +34,12 @@ const close = defineTool({
|
|||||||
code: [`await page.close()`],
|
code: [`await page.close()`],
|
||||||
captureSnapshot: false,
|
captureSnapshot: false,
|
||||||
waitForNetwork: false,
|
waitForNetwork: false,
|
||||||
|
resultOverride: {
|
||||||
|
content: [{
|
||||||
|
type: 'text',
|
||||||
|
text: 'Browser closed successfully.',
|
||||||
|
}],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -29,7 +29,7 @@ test('test reopen browser', async ({ startClient, server, mcpMode }) => {
|
|||||||
|
|
||||||
expect(await client.callTool({
|
expect(await client.callTool({
|
||||||
name: 'browser_close',
|
name: 'browser_close',
|
||||||
})).toContainTextContent('No open pages available');
|
})).toContainTextContent('Browser closed successfully.');
|
||||||
|
|
||||||
expect(await client.callTool({
|
expect(await client.callTool({
|
||||||
name: 'browser_navigate',
|
name: 'browser_navigate',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user