chore: only reset network log upon explicit navigation (#377)
Fixes https://github.com/microsoft/playwright-mcp/issues/376
This commit is contained in:
@@ -19,7 +19,12 @@ import fs from 'node:fs';
|
||||
import { Config } from '../config.js';
|
||||
import { test, expect } from './fixtures.js';
|
||||
|
||||
test('config user data dir', async ({ startClient, localOutputPath }) => {
|
||||
test('config user data dir', async ({ startClient, localOutputPath, server }) => {
|
||||
server.setContent('/', `
|
||||
<title>Title</title>
|
||||
<body>Hello, world!</body>
|
||||
`, 'text/html');
|
||||
|
||||
const config: Config = {
|
||||
browser: {
|
||||
userDataDir: localOutputPath('user-data-dir'),
|
||||
@@ -31,9 +36,7 @@ test('config user data dir', async ({ startClient, localOutputPath }) => {
|
||||
const client = await startClient({ args: ['--config', configPath] });
|
||||
expect(await client.callTool({
|
||||
name: 'browser_navigate',
|
||||
arguments: {
|
||||
url: 'data:text/html,<html><body>Hello, world!</body></html>',
|
||||
},
|
||||
arguments: { url: server.PREFIX },
|
||||
})).toContainTextContent(`Hello, world!`);
|
||||
|
||||
const files = await fs.promises.readdir(config.browser!.userDataDir!);
|
||||
|
||||
Reference in New Issue
Block a user