Files
resolutionflow/frontend/e2e/session-to-flow.spec.ts
chihlasm 2b5f63c5a8 fix: update Playwright test selectors to match actual UI
- Use specific command palette placeholder to avoid ambiguous matches
- Fix 'Quick Actions' scoping (two elements with same text)
- Fix 'Resolved' exact match on session detail page
- Fix tree editor to use getByText instead of getByDisplayValue
- Fix 'Add Step' strict mode by using .first()
- Fix fallback description placeholder text
- Update playwright.config.ts to use port 5433 and resolutionflow DB
- Update FlowPilot chat selectors to match actual page layout

11/17 new tests now passing. Remaining 6 need procedural session
navigation investigation.

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

41 lines
1.4 KiB
TypeScript

import { expect, test } from '@playwright/test'
import {
completeSession,
createAuthenticatedApiContext,
createSession,
createTroubleshootingTree,
disposeApiContext,
} from './helpers/api'
test.describe('session-to-flow converter smoke tests', () => {
test('shows Create Flow from Session button on completed session detail page', async ({ page }) => {
const api = await createAuthenticatedApiContext()
const tree = await createTroubleshootingTree(api, {
name: 'PW Session-to-Flow Source',
})
const session = await createSession(api, tree.id, {
ticket_number: 'PW-S2F',
client_name: 'Session Flow Client',
})
await completeSession(api, session.id, {
outcome_notes: 'Resolved via standard DNS fix',
})
try {
await page.goto(`/sessions/${session.id}`)
// Session detail page should load with completed status
await expect(page.getByText('Resolved', { exact: true })).toBeVisible({ timeout: 10000 })
// Should show the Create Flow from Session button
await expect(page.getByText('Create Flow from Session')).toBeVisible()
} finally {
await disposeApiContext(api)
}
})
// Note: Full AI generation test requires ANTHROPIC_API_KEY in the environment.
// This test verifies the UI flow exists and the button triggers correctly.
// In CI without an API key, the AI call will fail gracefully with a toast error.
})