feat: expand intelligent investigation workspace
This commit is contained in:
@@ -20,13 +20,15 @@ test.beforeEach(async ({ page }) => {
|
||||
});
|
||||
|
||||
for (const width of [1440, 375]) {
|
||||
test(`model options show hover and keyboard highlight without changing selection at ${width}px`, async ({ page }) => {
|
||||
test(`model options show hover and keyboard highlight without changing selection at ${width}px`, async ({ page }, testInfo) => {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
await page.goto("/", { waitUntil: "domcontentloaded" });
|
||||
await page.getByRole("button", { name: width < 1024 ? "打开 Agent 面板" : /展开 Agent 助手面板/ }).click();
|
||||
// Radix hides the trigger from the accessibility tree while its modal menu is open.
|
||||
const trigger = page.locator('button[aria-label="选择 Agent 模型"]');
|
||||
await expect(trigger).toHaveAccessibleDescription("当前模型:快速");
|
||||
await expectQuietCaretHover(trigger);
|
||||
await page.locator("form.agent-panel-input-form").screenshot({ path: testInfo.outputPath("model-trigger-hover.png"), animations: "disabled" });
|
||||
await trigger.click();
|
||||
await waitForMenuAnimations(page.getByRole("menu"));
|
||||
const fast = page.getByRole("menuitem", { name: /快速回答和日常任务处理/ });
|
||||
@@ -52,11 +54,13 @@ for (const width of [1440, 375]) {
|
||||
await expect(trigger).toBeFocused();
|
||||
});
|
||||
|
||||
test(`approval options highlight both selected and unselected modes at ${width}px`, async ({ page }) => {
|
||||
test(`approval options highlight both selected and unselected modes at ${width}px`, async ({ page }, testInfo) => {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
await page.goto("/", { waitUntil: "domcontentloaded" });
|
||||
await page.getByRole("button", { name: width < 1024 ? "打开 Agent 面板" : /展开 Agent 助手面板/ }).click();
|
||||
const trigger = page.locator('button[aria-label="权限批准模式"]');
|
||||
await expectQuietCaretHover(trigger);
|
||||
await page.locator("form.agent-panel-input-form").screenshot({ path: testInfo.outputPath("approval-trigger-hover.png"), animations: "disabled" });
|
||||
await trigger.click();
|
||||
await waitForMenuAnimations(page.getByRole("menu"));
|
||||
const request = page.getByRole("menuitem", { name: /需要审批的请求逐次确认/ });
|
||||
@@ -160,6 +164,14 @@ test("does not send a generation request when the refreshed catalog is empty", a
|
||||
expect(requests).toEqual([]);
|
||||
});
|
||||
|
||||
async function expectQuietCaretHover(trigger: Locator) {
|
||||
const caret = trigger.locator(".agent-panel-toolbar-caret");
|
||||
const idleColor = await caret.evaluate((element) => getComputedStyle(element).color);
|
||||
await trigger.hover();
|
||||
await expect(caret).toHaveCSS("color", idleColor);
|
||||
await expect(trigger).toHaveCSS("border-radius", "10px");
|
||||
}
|
||||
|
||||
async function waitForMenuAnimations(menu: Locator) {
|
||||
await expect(menu).toBeVisible();
|
||||
await menu.evaluate((element) => Promise.all(
|
||||
|
||||
Reference in New Issue
Block a user