(page: Page, message: string)
| 81 | * Send a message in the chat UI |
| 82 | */ |
| 83 | export async function sendMessage(page: Page, message: string): Promise<void> { |
| 84 | // Find the textarea input |
| 85 | const textarea = page.locator('textarea').first() |
| 86 | await textarea.waitFor({ state: 'visible' }) |
| 87 | |
| 88 | // Click to focus and clear any existing content |
| 89 | await textarea.click() |
| 90 | await textarea.fill('') |
| 91 | |
| 92 | // Type the message character by character to properly trigger React state updates |
| 93 | await textarea.pressSequentially(message, { delay: 10 }) |
| 94 | |
| 95 | // Verify the input has the message |
| 96 | await textarea.waitFor({ state: 'visible' }) |
| 97 | |
| 98 | // Use keyboard Enter to send (more reliable than finding the button) |
| 99 | // The chat UI handles Enter key to send messages |
| 100 | await textarea.press('Enter') |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Wait for the assistant response to complete |
no outgoing calls
no test coverage detected