Files
resolutionflow/frontend/e2e/resume.spec.ts
Michael Chihlas 1e3a6cfa01
All checks were successful
Mirror to GitHub / mirror (push) Successful in 12s
CI / frontend (pull_request) Successful in 5m43s
CI / backend (pull_request) Successful in 10m21s
CI / e2e (pull_request) Successful in 11m23s
fix(e2e): harden card selectors for session resume
Co-Authored-By: Codex <noreply@openai.com>
2026-04-25 16:42:33 -04:00

47 lines
1.7 KiB
TypeScript

import { expect, test } from '@playwright/test'
import {
createAuthenticatedApiContext,
createSession,
createTroubleshootingTree,
disposeApiContext,
} from './helpers/api'
test.describe('session resume smoke tests', () => {
test('can resume an incomplete session from the library page', async ({ page }) => {
const api = await createAuthenticatedApiContext()
const tree = await createTroubleshootingTree(api, {
question: 'Is the affected service still down?',
})
await createSession(api, tree.id, {
ticket_number: 'PW-RESUME',
client_name: 'Resume Client',
})
try {
// Resume flow moved off /trees onto the Flow Sessions tab of /sessions
// during the FlowPilot migration. The destination (/trees/:id/navigate)
// is unchanged — only the entry point shifted.
await page.goto('/sessions')
await expect(
page.getByRole('heading', { name: 'Session History', exact: true }),
).toBeVisible()
await page.getByRole('button', { name: 'Flow Sessions' }).click()
// Active sub-tab is the default and surfaces in-progress sessions.
const resumeCard = page.getByTestId('flow-session-card').filter({ hasText: tree.name }).first()
await expect(resumeCard).toBeVisible()
await resumeCard.getByRole('button', { name: 'Resume' }).first().click()
await expect(page).toHaveURL(new RegExp(`/trees/${tree.id}/navigate`))
await expect(
page.getByRole('heading', { name: tree.name }),
).toBeVisible()
await expect(
page.getByRole('heading', { name: 'Is the affected service still down?' }),
).toBeVisible()
} finally {
await disposeApiContext(api)
}
})
})