MCPcopy Index your code
hub / github.com/TanStack/ai / sendMessage

Function sendMessage

testing/e2e/tests/helpers.ts:15–32  ·  view source on GitHub ↗
(page: Page, text: string)

Source from the content-addressed store, hash-verified

13}
14
15export async function sendMessage(page: Page, text: string) {
16 const input = page.getByTestId('chat-input')
17 await input.click()
18 await input.fill(text)
19 // Dispatch an input event to trigger React's onChange for controlled inputs
20 await input.dispatchEvent('input', { bubbles: true })
21 await page
22 .getByTestId('send-button')
23 .click({ timeout: 5000 })
24 .catch(async (err) => {
25 // Only retry if button was disabled (fill() didn't trigger React onChange)
26 const isDisabled = await page.getByTestId('send-button').isDisabled()
27 if (!isDisabled) throw err
28 await input.clear()
29 await input.pressSequentially(text, { delay: 30 })
30 await page.getByTestId('send-button').click()
31 })
32}
33
34export async function sendMessageWithImage(
35 page: Page,

Calls 1

clearMethod · 0.65

Tested by

no test coverage detected