mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
* fix(app): keep long custom models removable Custom model labels and IDs could consume the row width and push Remove outside the sheet. Allow those text cells to shrink while preserving the button width and short-name alignment. * test(app): wait for legacy agent creation before checking prompts Agent-list membership includes initialization. Waiting for finish at that point can return on the initial idle transition before the initial prompt starts. Wait for the matching creation response before checking each completed turn, preserving the existing exact-once assertions. * test(app): wait for directory search keyboard focus The search page becomes visible before its deferred focus callback runs. Wait for the input to own keyboard focus so the journey types its query rather than dropping it during navigation. --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
38 lines
1.6 KiB
TypeScript
38 lines
1.6 KiB
TypeScript
import { expect, type Page } from "@playwright/test";
|
|
import { gotoAppShell, openSettings } from "./app";
|
|
import { openSettingsHostSection } from "./settings";
|
|
import { getServerId } from "./server-id";
|
|
|
|
export async function openCustomModels(page: Page): Promise<void> {
|
|
await gotoAppShell(page);
|
|
await openSettings(page);
|
|
await openSettingsHostSection(page, getServerId(), "providers");
|
|
await page.getByRole("button", { name: "Claude provider details", exact: true }).click();
|
|
await expect(page.getByRole("textbox", { name: "Search models" })).toBeVisible();
|
|
}
|
|
|
|
export async function addCustomModel(page: Page, id: string): Promise<void> {
|
|
await page.getByRole("button", { name: "Add model", exact: true }).click();
|
|
await page.getByPlaceholder("e.g. openai/gpt-5").fill(id);
|
|
await page
|
|
.getByTestId("add-custom-model-sheet")
|
|
.getByRole("button", { name: "Add", exact: true })
|
|
.click();
|
|
await expect(page.getByRole("button", { name: `Remove ${id}`, exact: true })).toHaveCount(1);
|
|
}
|
|
|
|
export async function removeCustomModel(page: Page, id: string): Promise<void> {
|
|
await page.getByRole("textbox", { name: "Search models" }).fill(id);
|
|
const remove = page.getByRole("button", { name: `Remove ${id}`, exact: true });
|
|
await expect(remove).toBeInViewport({ ratio: 1 });
|
|
await remove.click();
|
|
await expect(remove).toHaveCount(0);
|
|
}
|
|
|
|
export async function expectCustomModelRetained(page: Page, id: string): Promise<void> {
|
|
await page.getByRole("textbox", { name: "Search models" }).fill(id);
|
|
await expect(page.getByRole("button", { name: `Remove ${id}`, exact: true })).toBeInViewport({
|
|
ratio: 1,
|
|
});
|
|
}
|