Open History to see the last commit
1import { test, expect } from './fixtures'
2import {
3 selectScenario,
4 runTest,
5 waitForTestComplete,
6 getMetadata,
7 getToolCalls,
8} from './tools-test/helpers'
9
10test.describe('Lazy Tool Discovery', () => {
11 test('discovers and uses lazy tool', async ({ page, testId, aimockPort }) => {
12 await selectScenario(page, 'lazy-tool-discovery', testId, aimockPort)
13 await runTest(page)
14 await waitForTestComplete(page, 20000, 2)
15
16 const metadata = await getMetadata(page)
17 expect(parseInt(metadata.toolCallCount)).toBeGreaterThanOrEqual(2)
18
19 const toolCalls = await getToolCalls(page)
20 const toolNames = toolCalls.map((tc: any) => tc.name)
21 expect(toolNames).toContain('__lazy__tool__discovery__')
22 expect(toolNames).toContain('search_inventory')
23 })
24})