(page: Page)
| 78 | } |
| 79 | |
| 80 | export async function getLastAssistantMessage(page: Page): Promise<string> { |
| 81 | const messages = page.getByTestId('assistant-message') |
| 82 | const count = await messages.count() |
| 83 | if (count === 0) return '' |
| 84 | return messages.nth(count - 1).innerText() |
| 85 | } |
| 86 | |
| 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) */ |
no test coverage detected