diff --git a/tests/McpContext.test.ts b/tests/McpContext.test.ts index 4b5de0911..e1c34f52c 100644 --- a/tests/McpContext.test.ts +++ b/tests/McpContext.test.ts @@ -11,11 +11,11 @@ import sinon from 'sinon'; import type {TraceResult} from '../src/trace-processing/parse.js'; -import {html, withBrowser} from './utils.js'; +import {html, withMcpContext} from './utils.js'; describe('McpContext', () => { it('list pages', async () => { - await withBrowser(async (_response, context) => { + await withMcpContext(async (_response, context) => { const page = context.getSelectedPage(); await page.setContent( html` { }); it('can store and retrieve performance traces', async () => { - await withBrowser(async (_response, context) => { + await withMcpContext(async (_response, context) => { const fakeTrace1 = {} as unknown as TraceResult; const fakeTrace2 = {} as unknown as TraceResult; context.storeTraceRecording(fakeTrace1); @@ -50,7 +50,7 @@ describe('McpContext', () => { }); it('should update default timeout when cpu throttling changes', async () => { - await withBrowser(async (_response, context) => { + await withMcpContext(async (_response, context) => { const page = await context.newPage(); const timeoutBefore = page.getDefaultTimeout(); context.setCpuThrottlingRate(2); @@ -60,7 +60,7 @@ describe('McpContext', () => { }); it('should update default timeout when network conditions changes', async () => { - await withBrowser(async (_response, context) => { + await withMcpContext(async (_response, context) => { const page = await context.newPage(); const timeoutBefore = page.getDefaultNavigationTimeout(); context.setNetworkConditions('Slow 3G'); @@ -70,7 +70,7 @@ describe('McpContext', () => { }); it('should call waitForEventsAfterAction with correct multipliers', async () => { - await withBrowser(async (_response, context) => { + await withMcpContext(async (_response, context) => { const page = await context.newPage(); context.setCpuThrottlingRate(2); @@ -86,7 +86,7 @@ describe('McpContext', () => { }); it('should should detect open DevTools pages', async () => { - await withBrowser( + await withMcpContext( async (_response, context) => { const page = await context.newPage(); // TODO: we do not know when the CLI flag to auto open DevTools will run diff --git a/tests/McpResponse.test.ts b/tests/McpResponse.test.ts index 9031f6ddb..5feb66fdc 100644 --- a/tests/McpResponse.test.ts +++ b/tests/McpResponse.test.ts @@ -16,12 +16,12 @@ import { getMockResponse, html, stabilizeResponseOutput, - withBrowser, + withMcpContext, } from './utils.js'; describe('McpResponse', () => { it('list pages', async t => { - await withBrowser(async (response, context) => { + await withMcpContext(async (response, context) => { response.setIncludePages(true); const result = await response.handle('test', context); assert.equal(result[0].type, 'text'); @@ -30,7 +30,7 @@ describe('McpResponse', () => { }); it('allows response text lines to be added', async t => { - await withBrowser(async (response, context) => { + await withMcpContext(async (response, context) => { response.appendResponseLine('Testing 1'); response.appendResponseLine('Testing 2'); const result = await response.handle('test', context); @@ -40,7 +40,7 @@ describe('McpResponse', () => { }); it('does not include anything in response if snapshot is null', async () => { - await withBrowser(async (response, context) => { + await withMcpContext(async (response, context) => { const page = context.getSelectedPage(); page.accessibility.snapshot = async () => null; const result = await response.handle('test', context); @@ -50,7 +50,7 @@ describe('McpResponse', () => { }); it('returns correctly formatted snapshot for a simple tree', async t => { - await withBrowser(async (response, context) => { + await withMcpContext(async (response, context) => { const page = context.getSelectedPage(); await page.setContent( html` { }); it('returns values for textboxes', async t => { - await withBrowser(async (response, context) => { + await withMcpContext(async (response, context) => { const page = context.getSelectedPage(); await page.setContent( html`