Files
resolutionflow/frontend/e2e/session-to-flow.spec.ts
chihlasm d71638ffb4 test: add Playwright e2e tests for new features and uncovered workflows
High priority (new PR #108 features):
- Command palette: open/close, search flows, page navigation, FlowPilot handoff
- Fallback branches: add in editor, execute in session runner
- Session-to-flow: verify button appears on completed session detail

Medium priority (existing features without coverage):
- Procedural session: intake form, step-through, completion
- Tree editor: troubleshooting and procedural editor load/edit/save
- FlowPilot chat: page load, new chat creation
- Admin panel: dashboard, user management, settings access

Also adds API helpers: createProceduralTree(), createProceduralTreeWithFallbacks()

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

42 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')).toBeVisible({ timeout: 10000 })
// Should show the Create Flow from Session button
const createFlowButton = page.getByRole('button', { name: /Create Flow from Session/ })
await expect(createFlowButton).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.
})