test: add browser agent integration tests (#21151)

This commit is contained in:
Aditya Bijalwan
2026-03-05 18:59:35 +05:30
committed by GitHub
parent 173376ba67
commit 09259a8ec4
9 changed files with 241 additions and 4 deletions
@@ -147,7 +147,7 @@ describe('BrowserManager', () => {
// Verify StdioClientTransport was created with correct args
expect(StdioClientTransport).toHaveBeenCalledWith(
expect.objectContaining({
command: 'npx',
command: process.platform === 'win32' ? 'npx.cmd' : 'npx',
args: expect.arrayContaining([
'-y',
expect.stringMatching(/chrome-devtools-mcp@/),
@@ -185,7 +185,7 @@ describe('BrowserManager', () => {
expect(StdioClientTransport).toHaveBeenCalledWith(
expect.objectContaining({
command: 'npx',
command: process.platform === 'win32' ? 'npx.cmd' : 'npx',
args: expect.arrayContaining(['--headless']),
}),
);
@@ -210,7 +210,7 @@ describe('BrowserManager', () => {
expect(StdioClientTransport).toHaveBeenCalledWith(
expect.objectContaining({
command: 'npx',
command: process.platform === 'win32' ? 'npx.cmd' : 'npx',
args: expect.arrayContaining(['--userDataDir', '/path/to/profile']),
}),
);
@@ -283,7 +283,7 @@ export class BrowserManager {
// stderr is piped (not inherited) to prevent MCP server banners and
// warnings from corrupting the UI in alternate buffer mode.
this.mcpTransport = new StdioClientTransport({
command: 'npx',
command: process.platform === 'win32' ? 'npx.cmd' : 'npx',
args: mcpArgs,
stderr: 'pipe',
});