* fix(acp): preserve permission choices ACP question bridges encode answers as repeated permission options. Preserve each option through the UI and return the exact selected ID, while keeping auto-accept from choosing on the user's behalf. * fix(acp): validate selected permission behavior Reject inconsistent action IDs instead of allowing the action ID to override the response behavior. Move the misplaced browser spec so the current base CI contract can run. * fix(acp): preserve invalid permission requests Validate selected ACP actions before consuming the pending request so inconsistent client responses can be corrected and retried. * test(acp): verify real permission questions * fix(acp): reject empty permission action ids * test(e2e): scope Kimi config to ACP spec
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import { expect, type Page } from "@playwright/test";
|
|
|
|
export async function waitForPermissionPrompt(page: Page, timeout = 30_000): Promise<void> {
|
|
await expect(page.getByTestId("permission-request-question").first()).toBeVisible({ timeout });
|
|
}
|
|
|
|
export async function allowPermission(page: Page): Promise<void> {
|
|
const acceptButton = page.getByTestId("permission-request-accept").first();
|
|
await expect(acceptButton).toBeVisible({ timeout: 5_000 });
|
|
await acceptButton.click();
|
|
}
|
|
|
|
export async function denyPermission(page: Page): Promise<void> {
|
|
const denyButton = page.getByTestId("permission-request-deny").first();
|
|
await expect(denyButton).toBeVisible({ timeout: 5_000 });
|
|
await denyButton.click();
|
|
}
|
|
|
|
export async function expectPermissionActions(page: Page, labels: string[]): Promise<void> {
|
|
await waitForPermissionPrompt(page, 120_000);
|
|
const card = page.getByTestId("permission-request-question").first().locator("..");
|
|
for (const label of labels) {
|
|
await expect(card.getByRole("button", { name: label })).toBeVisible();
|
|
}
|
|
}
|
|
|
|
export async function choosePermissionAction(page: Page, label: string): Promise<void> {
|
|
const card = page.getByTestId("permission-request-question").first().locator("..");
|
|
await card.getByRole("button", { name: label }).click();
|
|
}
|