( page: Page, text: string, timeout = 15_000, )
| 87 | /** Wait for an assistant message containing specific text (useful for tool-calling where |
| 88 | * the agentic loop produces multiple responses and waitForResponse returns too early) */ |
| 89 | export async function waitForAssistantText( |
| 90 | page: Page, |
| 91 | text: string, |
| 92 | timeout = 15_000, |
| 93 | ) { |
| 94 | await page |
| 95 | .getByTestId('assistant-message') |
| 96 | .filter({ hasText: text }) |
| 97 | .first() |
| 98 | .waitFor({ state: 'visible', timeout }) |
| 99 | } |
| 100 | |
| 101 | export async function getToolCalls( |
| 102 | page: Page, |
no outgoing calls
no test coverage detected