mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2026-02-02 20:43:39 +00:00
fix: don't error on navigating to a download link (#328)
This commit is contained in:
@@ -119,3 +119,21 @@ test('clicking on download link emits download', async ({ startClient }, testInf
|
||||
### Downloads
|
||||
- Downloaded file test.txt to ${path.join(outputDir, 'test.txt')}`);
|
||||
});
|
||||
|
||||
test('navigating to download link emits download', async ({ client, server, mcpBrowser }) => {
|
||||
test.skip(mcpBrowser === 'webkit' && process.platform === 'linux', 'https://github.com/microsoft/playwright/blob/8e08fdb52c27bb75de9bf87627bf740fadab2122/tests/library/download.spec.ts#L436');
|
||||
server.route('/download', (req, res) => {
|
||||
res.writeHead(200, {
|
||||
'Content-Type': 'text/plain',
|
||||
'Content-Disposition': 'attachment; filename=test.txt',
|
||||
});
|
||||
res.end('Hello world!');
|
||||
});
|
||||
|
||||
expect(await client.callTool({
|
||||
name: 'browser_navigate',
|
||||
arguments: {
|
||||
url: server.PREFIX + '/download',
|
||||
},
|
||||
})).toContainTextContent('### Downloads');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user