Files
resolutionflow/frontend/e2e/flowpilot-chat.spec.ts
chihlasm e9c24cbbf7 fix: update Playwright test selectors to match actual UI
- Use Control+k instead of Meta+k (Linux/CI compatibility)
- Use 'AI Assistant' group label instead of 'FlowPilot AI'
- Match actual FlowPilot chat page elements (Start a Conversation, New Chat, textarea)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 13:34:44 -04:00

31 lines
1.2 KiB
TypeScript

import { expect, test } from '@playwright/test'
test.describe('FlowPilot assistant chat smoke tests', () => {
test('can open the assistant chat page and see the interface', async ({ page }) => {
await page.goto('/assistant')
// Should load the assistant chat page — UI shows "AI Assistant" heading
await expect(page.getByText('AI Assistant')).toBeVisible({ timeout: 10000 })
// Should show the start conversation button when no chats exist
await expect(page.getByRole('button', { name: /Start a Conversation/i })).toBeVisible()
})
test('can create a new chat session', async ({ page }) => {
await page.goto('/assistant')
await expect(page.getByText('AI Assistant')).toBeVisible({ timeout: 10000 })
// Click "New Chat" button in the sidebar
const newChatButton = page.getByRole('button', { name: /New Chat/i })
await expect(newChatButton).toBeVisible()
await newChatButton.click()
// After creating a chat, the message input area should appear
// The textarea may use various placeholders
const messageInput = page.locator('textarea').first()
await expect(messageInput).toBeVisible({ timeout: 5000 })
})
// Note: Full AI response tests require ANTHROPIC_API_KEY in the environment.
})