diff --git a/@tooling/e2e/e2e/chat.e2e.ts b/@tooling/e2e/e2e/chat.e2e.ts index 7861ae6..787908d 100644 --- a/@tooling/e2e/e2e/chat.e2e.ts +++ b/@tooling/e2e/e2e/chat.e2e.ts @@ -36,10 +36,35 @@ test.describe('Text chat', () => { test('sending a message shows it in the chat', async ({ page }) => { const input = page.getByRole('textbox', { name: 'Message input' }); + const requests: string[] = []; + page.on('request', (req) => { + if (req.url().includes('session') || req.url().includes('chat')) { + requests.push(`${req.method()} ${req.url()}`); + } + }); + page.on('response', (res) => { + if (res.url().includes('session') || res.url().includes('chat')) { + requests.push(` → ${res.status()} ${res.url()}`); + } + }); + await input.fill('What can you help me with?'); await input.press('Enter'); - await expect(page.getByText('What can you help me with?')).toBeVisible(); + // Give React time to render + await page.waitForTimeout(500); + + // Capture state for debugging + const htmlSnapshot = await page.content(); + const hasText = htmlSnapshot.includes('What can you help me with?'); + console.log('Text in DOM after 500ms:', hasText); + console.log('Network requests during test:', JSON.stringify(requests, null, 2)); + + try { + await expect(page.getByText('What can you help me with?')).toBeVisible(); + } catch (e) { + throw e; + } }); test('input clears after sending', async ({ page }) => {