it("adds profile and browser status details on ws-backed timeouts",async()=>{
dispatcherMocks.dispatch
.mockImplementationOnce(async()=>{
awaitnewPromise(()=>{});
})
.mockResolvedValueOnce({
status: 200,
body:{
running: true,
cdpHttp: true,
cdpReady: false,
cdpUrl:"http://127.0.0.1:18792",
},
});
awaitexpect(
runBrowserProxyCommand(
JSON.stringify({
method:"GET",
path:"/snapshot",
profile:"chrome",
timeoutMs: 5,
}),
),
).rejects.toThrow(
/browser proxy timed out for GET \/snapshot after 5ms; ws-backed browser action; profile=chrome; status\(running=true, cdpHttp=true, cdpReady=false, cdpUrl=http:\/\/127\.0\.0\.1:18792\)/,
it("includes chrome-mcp transport in timeout diagnostics when no CDP URL exists",async()=>{
dispatcherMocks.dispatch
.mockImplementationOnce(async()=>{
awaitnewPromise(()=>{});
})
.mockResolvedValueOnce({
status: 200,
body:{
running: true,
transport:"chrome-mcp",
cdpHttp: true,
cdpReady: false,
cdpUrl: null,
},
});
awaitexpect(
runBrowserProxyCommand(
JSON.stringify({
method:"GET",
path:"/snapshot",
profile:"chrome-live",
timeoutMs: 5,
}),
),
).rejects.toThrow(
/browser proxy timed out for GET \/snapshot after 5ms; ws-backed browser action; profile=chrome-live; status\(running=true, cdpHttp=true, cdpReady=false, transport=chrome-mcp\)/,