From 37c4e0c99e7063f77949d5ef339687bbac33fdb8 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Sat, 25 Apr 2026 15:21:25 -0400 Subject: [PATCH] fix(e2e): update 5 selectors that drifted with FlowPilot/PSA UI changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mechanical drift between the e2e selectors and the current UI surfaced on the first CI run after PR #149 unblocked the artifact upload step. Five tests, three categories of drift: 1. **Page heading renames** (navigation.spec.ts) - `Sessions` → `Session History` on /sessions - `Account Settings` → `Account Management` on /account 2. **Route rename** (command-palette.spec.ts:74) - The "Troubleshoot with FlowPilot" command palette option now lands on /pilot (Phase 1 of the FlowPilot migration renamed /assistant). /assistant still 301-redirects, so the assertion accepts either. 3. **Feature moved to /sessions** (history.spec.ts, resume.spec.ts) - Default tab on /sessions is "AI Sessions"; flow-session filtering and the Resume button moved behind the "Flow Sessions" tab. Both tests now click that tab before asserting. - resume.spec.ts no longer starts at /trees (Resume buttons aren't rendered there anymore — the flow lives on /sessions). Destination URL (/trees/:id/navigate) is unchanged. No product-code changes — these are pure test updates against the shipped UI. Run the suite locally with `cd frontend && npm run test:e2e` once a fresh build is available. Co-Authored-By: Claude Opus 4.7 --- frontend/e2e/command-palette.spec.ts | 4 +++- frontend/e2e/history.spec.ts | 6 +++++- frontend/e2e/navigation.spec.ts | 4 ++-- frontend/e2e/resume.spec.ts | 12 ++++++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/frontend/e2e/command-palette.spec.ts b/frontend/e2e/command-palette.spec.ts index c011a1a9..419e679c 100644 --- a/frontend/e2e/command-palette.spec.ts +++ b/frontend/e2e/command-palette.spec.ts @@ -88,6 +88,8 @@ test.describe('command palette smoke tests', () => { await flowpilotOption.click() - await expect(page).toHaveURL(/\/assistant/) + // Phase 1 of the FlowPilot migration renamed /assistant to /pilot. + // /assistant still 301-redirects to /pilot, so accept either landing URL. + await expect(page).toHaveURL(/\/(pilot|assistant)/) }) }) diff --git a/frontend/e2e/history.spec.ts b/frontend/e2e/history.spec.ts index feb14379..7483ec64 100644 --- a/frontend/e2e/history.spec.ts +++ b/frontend/e2e/history.spec.ts @@ -24,9 +24,13 @@ test.describe('session history smoke tests', () => { await page.goto('/sessions') await expect( - page.getByRole('heading', { name: 'Sessions', exact: true }), + page.getByRole('heading', { name: 'Session History', exact: true }), ).toBeVisible() + // Default tab on /sessions is "AI Sessions"; flow sessions live behind + // the "Flow Sessions" tab and only that tab exposes ticket/client filters. + await page.getByRole('button', { name: 'Flow Sessions' }).click() + await page.getByPlaceholder('Search by ticket number...').fill(ticketNumber) await page.getByPlaceholder('Search by client name...').fill(clientName) diff --git a/frontend/e2e/navigation.spec.ts b/frontend/e2e/navigation.spec.ts index 2cfa3141..c2858ee8 100644 --- a/frontend/e2e/navigation.spec.ts +++ b/frontend/e2e/navigation.spec.ts @@ -14,7 +14,7 @@ test.describe('authenticated navigation smoke tests', () => { await page.goto('/sessions') await expect( - page.getByRole('heading', { name: 'Sessions', exact: true }), + page.getByRole('heading', { name: 'Session History', exact: true }), ).toBeVisible() }) @@ -30,7 +30,7 @@ test.describe('authenticated navigation smoke tests', () => { await page.goto('/account') await expect( - page.getByRole('heading', { name: 'Account Settings' }), + page.getByRole('heading', { name: 'Account Management' }), ).toBeVisible() }) }) diff --git a/frontend/e2e/resume.spec.ts b/frontend/e2e/resume.spec.ts index 8d51a9d1..73211735 100644 --- a/frontend/e2e/resume.spec.ts +++ b/frontend/e2e/resume.spec.ts @@ -18,9 +18,17 @@ test.describe('session resume smoke tests', () => { }) try { - await page.goto('/trees') + // 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.locator('.bg-card').filter({ hasText: tree.name }).filter({ hasText: 'Resume' }).first() + const resumeCard = page.locator('.bg-card').filter({ hasText: tree.name }).first() await expect(resumeCard).toBeVisible() await resumeCard.getByRole('button', { name: 'Resume' }).first().click()