feat(browser): add MCP tool dispatch

This commit is contained in:
Peter Steinberger
2025-12-19 23:57:26 +00:00
parent 0ac7a93c28
commit fa54950d2e
19 changed files with 2991 additions and 1243 deletions

View File

@@ -28,11 +28,13 @@ function createPage(opts: {
};
const click = vi.fn().mockResolvedValue(undefined);
const locator = vi.fn().mockReturnValue({ click });
const dblclick = vi.fn().mockResolvedValue(undefined);
const locator = vi.fn().mockReturnValue({ click, dblclick });
const page = {
context: () => context,
locator,
on: vi.fn(),
...(opts.hasSnapshotForAI === false
? {}
: {
@@ -48,6 +50,7 @@ function createPage(opts: {
function createBrowser(pages: unknown[]) {
const ctx = {
pages: () => pages,
on: vi.fn(),
};
return {
contexts: () => [ctx],