mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
- Delete clickNewTabButton (duplicate of clickNewChat) and clickNewTerminalButton (duplicate of clickNewTerminal); update all call sites - Rename clickTerminal → clickNewTerminal to match clickNewChat naming pattern - Delete waitForLauncherPanel (deprecated no-op) - Delete waitForAgentFinishUI and getToolCallCount (dead exports never imported) - Remove ensureE2EStorageSeeded, assertE2EUsesSeededTestDaemon, and related helpers from app.ts — the paseoE2ESetup auto-fixture seeds via addInitScript on every navigation, making these redundant - Simplify gotoAppShell to a one-liner; simplify gotoHome to use .or() instead of three-way if-else chain - Strip try/catch self-heal from ensureHostSelected — the fixture guarantees preferences alignment, so the workaround is never needed
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { expect, type Page } from "@playwright/test";
|
|
import { clickNewChat, clickNewTerminal } from "./launcher";
|
|
import { setupDeterministicPrompt, waitForTerminalContent } from "./terminal-perf";
|
|
|
|
function terminalSurface(page: Page) {
|
|
return page.locator('[data-testid="terminal-surface"]').first();
|
|
}
|
|
|
|
function composerInput(page: Page) {
|
|
return page.getByRole("textbox", { name: "Message agent..." }).first();
|
|
}
|
|
|
|
export async function expectTerminalCwd(page: Page, expectedPath: string): Promise<void> {
|
|
const terminal = terminalSurface(page);
|
|
await expect(terminal).toBeVisible({ timeout: 20_000 });
|
|
await terminal.click();
|
|
await setupDeterministicPrompt(page, `SENTINEL_${Date.now()}`);
|
|
await terminal.pressSequentially("pwd\n", { delay: 0 });
|
|
await waitForTerminalContent(page, (text) => text.includes(expectedPath), 10_000);
|
|
}
|
|
|
|
export async function createStandaloneTerminalFromLauncher(page: Page): Promise<void> {
|
|
await clickNewTerminal(page);
|
|
await expect(terminalSurface(page)).toBeVisible({ timeout: 20_000 });
|
|
}
|
|
|
|
export async function createAgentChatFromLauncher(page: Page): Promise<void> {
|
|
await clickNewChat(page);
|
|
await expect(composerInput(page)).toBeVisible({ timeout: 15_000 });
|
|
await expect(composerInput(page)).toBeEditable({ timeout: 15_000 });
|
|
await expect(page.getByTestId("agent-loading")).toHaveCount(0);
|
|
}
|