mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
fix: update e2e test navigation to use direct routes
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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<void> {
|
||||
// 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 });
|
||||
}
|
||||
|
||||
|
||||
@@ -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<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user