Files
resolutionflow/frontend/e2e/procedural-session.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

79 lines
2.6 KiB
TypeScript

import { expect, test } from '@playwright/test'
import {
createAuthenticatedApiContext,
createProceduralTree,
disposeApiContext,
uniqueName,
} from './helpers/api'
test.describe('procedural session smoke tests', () => {
test('can start and step through a procedural session with intake form', async ({ page }) => {
const api = await createAuthenticatedApiContext()
const tree = await createProceduralTree(api, {
name: uniqueName('PW Procedural Session Flow'),
})
try {
await page.goto(`/flows/${tree.id}/navigate`)
await expect(page.getByText(tree.name)).toBeVisible({ timeout: 10000 })
// Fill intake form
await page.getByLabel('Server IP Address').fill('10.1.50.22')
await page.getByLabel('Service Name').fill('nginx')
// Start the session
await page.getByRole('button', { name: /Start/ }).click()
// Should see the first step
await expect(page.getByText('Verify the server is reachable')).toBeVisible({ timeout: 5000 })
// Mark first step complete and advance
const completeButton = page.getByRole('button', { name: 'Mark Complete & Next' })
await completeButton.click()
// Should advance to second step
await expect(page.getByText('Check the service status')).toBeVisible({ timeout: 5000 })
} finally {
await disposeApiContext(api)
}
})
test('can complete a full procedural session end to end', async ({ page }) => {
const api = await createAuthenticatedApiContext()
const tree = await createProceduralTree(api, {
name: uniqueName('PW Full Procedural Flow'),
steps: [
{
id: 'step-1',
type: 'procedure_step',
title: 'Single step procedure',
description: 'Just one step to complete.',
content_type: 'action',
},
{ id: 'step-end', type: 'procedure_end', title: 'End' },
],
intake_form: [],
})
try {
await page.goto(`/flows/${tree.id}/navigate`)
await expect(page.getByText(tree.name)).toBeVisible({ timeout: 10000 })
// Start session (no intake form)
await page.getByRole('button', { name: /Start/ }).click()
// Should see the single step
await expect(page.getByText('Single step procedure')).toBeVisible({ timeout: 5000 })
// Complete the step
const completeButton = page.getByRole('button', { name: 'Mark Complete & Next' })
await completeButton.click()
// Should reach completion — look for completion indicators
await expect(page.getByText(/Complete|Finished|Summary/i)).toBeVisible({ timeout: 5000 })
} finally {
await disposeApiContext(api)
}
})
})