From 2c9f77356fcfac1bc68374e52b696a27ee98a6d8 Mon Sep 17 00:00:00 2001 From: Kacper Date: Wed, 17 Dec 2025 22:08:05 +0100 Subject: [PATCH] fix: update e2e test navigation to use direct routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The index route (/) now shows WelcomeView instead of auto-redirecting to board view. Updated test utilities to navigate directly to the correct routes: - navigateToBoard -> /board - navigateToContext -> /context - navigateToSpec -> /spec - navigateToAgent -> /agent - navigateToSettings -> /settings - waitForBoardView -> navigates to /board first 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/ui/tests/utils/git/worktree.ts | 7 +++ apps/ui/tests/utils/navigation/views.ts | 73 +++++-------------------- 2 files changed, 22 insertions(+), 58 deletions(-) diff --git a/apps/ui/tests/utils/git/worktree.ts b/apps/ui/tests/utils/git/worktree.ts index 3873777a..52fc3900 100644 --- a/apps/ui/tests/utils/git/worktree.ts +++ b/apps/ui/tests/utils/git/worktree.ts @@ -458,8 +458,15 @@ export async function setupProjectWithStaleWorktree(page: Page, projectPath: str /** * Wait for the board view to load + * Navigates to /board first since the index route shows WelcomeView */ export async function waitForBoardView(page: Page): Promise { + // Navigate directly to /board route (index route shows welcome view) + const currentUrl = page.url(); + if (!currentUrl.includes('/board')) { + await page.goto('/board'); + await page.waitForLoadState('networkidle'); + } await page.waitForSelector('[data-testid="board-view"]', { timeout: TIMEOUTS.long }); } diff --git a/apps/ui/tests/utils/navigation/views.ts b/apps/ui/tests/utils/navigation/views.ts index 3bb35fc4..f04f995a 100644 --- a/apps/ui/tests/utils/navigation/views.ts +++ b/apps/ui/tests/utils/navigation/views.ts @@ -4,108 +4,65 @@ import { waitForElement } from "../core/waiting"; /** * Navigate to the board/kanban view + * Note: Navigates directly to /board since index route shows WelcomeView */ export async function navigateToBoard(page: Page): Promise { - await page.goto("/"); - - // Wait for the page to load + // Navigate directly to /board route + await page.goto("/board"); await page.waitForLoadState("networkidle"); - // Check if we're on the board view already - const boardView = page.locator('[data-testid="board-view"]'); - const isOnBoard = await boardView.isVisible().catch(() => false); - - if (!isOnBoard) { - // Try to click on a recent project first (from welcome screen) - const recentProject = page.locator('p:has-text("Test Project")').first(); - if (await recentProject.isVisible().catch(() => false)) { - await recentProject.click(); - await page.waitForTimeout(200); - } - - // Then click on Kanban Board nav button to ensure we're on the board - const kanbanNav = page.locator('[data-testid="nav-board"]'); - if (await kanbanNav.isVisible().catch(() => false)) { - await kanbanNav.click(); - } - } - // Wait for the board view to be visible await waitForElement(page, "board-view", { timeout: 10000 }); } /** * Navigate to the context view + * Note: Navigates directly to /context since index route shows WelcomeView */ export async function navigateToContext(page: Page): Promise { - await page.goto("/"); - - // Wait for the page to load + // Navigate directly to /context route + await page.goto("/context"); await page.waitForLoadState("networkidle"); - // Click on the Context nav button - const contextNav = page.locator('[data-testid="nav-context"]'); - if (await contextNav.isVisible().catch(() => false)) { - await contextNav.click(); - } - // Wait for the context view to be visible await waitForElement(page, "context-view", { timeout: 10000 }); } /** * Navigate to the spec view + * Note: Navigates directly to /spec since index route shows WelcomeView */ export async function navigateToSpec(page: Page): Promise { - await page.goto("/"); - - // Wait for the page to load + // Navigate directly to /spec route + await page.goto("/spec"); await page.waitForLoadState("networkidle"); - // Click on the Spec nav button - const specNav = page.locator('[data-testid="nav-spec"]'); - if (await specNav.isVisible().catch(() => false)) { - await specNav.click(); - } - // Wait for the spec view to be visible await waitForElement(page, "spec-view", { timeout: 10000 }); } /** * Navigate to the agent view + * Note: Navigates directly to /agent since index route shows WelcomeView */ export async function navigateToAgent(page: Page): Promise { - await page.goto("/"); - - // Wait for the page to load + // Navigate directly to /agent route + await page.goto("/agent"); await page.waitForLoadState("networkidle"); - // Click on the Agent nav button - const agentNav = page.locator('[data-testid="nav-agent"]'); - if (await agentNav.isVisible().catch(() => false)) { - await agentNav.click(); - } - // Wait for the agent view to be visible await waitForElement(page, "agent-view", { timeout: 10000 }); } /** * Navigate to the settings view + * Note: Navigates directly to /settings since index route shows WelcomeView */ export async function navigateToSettings(page: Page): Promise { - await page.goto("/"); - - // Wait for the page to load + // Navigate directly to /settings route + await page.goto("/settings"); await page.waitForLoadState("networkidle"); - // Click on the Settings button in the sidebar - const settingsButton = page.locator('[data-testid="settings-button"]'); - if (await settingsButton.isVisible().catch(() => false)) { - await settingsButton.click(); - } - // Wait for the settings view to be visible await waitForElement(page, "settings-view", { timeout: 10000 }); }