feat: expand intelligent investigation workspace
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { expect, test, type Page } from "@playwright/test";
|
||||
import { mockAgentApi } from "./support/mock-agent-api";
|
||||
import { mockWorkbenchContext } from "./support/mock-workbench-context";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await mockWorkbenchContext(page);
|
||||
await mockAgentApi(page);
|
||||
});
|
||||
|
||||
@@ -10,7 +12,7 @@ async function openAgentPanel(page: Page) {
|
||||
await expect(page.getByRole("complementary", { name: "Agent 命令面板" })).toBeVisible();
|
||||
}
|
||||
|
||||
test("speech capability detection preserves the server hydration tree", async ({ page }) => {
|
||||
test("speech capability detection preserves the server hydration tree", async ({ page }, testInfo) => {
|
||||
const hydrationErrors: string[] = [];
|
||||
|
||||
page.on("console", (message) => {
|
||||
@@ -31,6 +33,21 @@ test("speech capability detection preserves the server hydration tree", async ({
|
||||
await expect(page.getByRole("button", { name: "语音输入" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "权限批准模式" })).toBeVisible();
|
||||
expect(hydrationErrors).toEqual([]);
|
||||
const form = page.locator("form.agent-panel-input-form");
|
||||
await form.screenshot({ path: testInfo.outputPath("composer-idle.png"), animations: "disabled" });
|
||||
await form.getByRole("textbox").fill("检查城南压力");
|
||||
await form.screenshot({ path: testInfo.outputPath("composer-ready.png"), animations: "disabled" });
|
||||
const voice = form.getByRole("button", { name: "语音输入", exact: true });
|
||||
await voice.hover();
|
||||
await expect(voice).toHaveCSS("border-radius", "50%");
|
||||
await form.screenshot({ path: testInfo.outputPath("composer-voice-hover.png"), animations: "disabled" });
|
||||
await page.setViewportSize({ width: 375, height: 900 });
|
||||
const mobilePanel = page.getByRole("complementary", { name: "Agent 命令面板" });
|
||||
if (!await mobilePanel.isVisible()) await page.getByRole("button", { name: "打开 Agent 面板", exact: true }).click();
|
||||
const mobileVoice = mobilePanel.getByRole("button", { name: "语音输入", exact: true });
|
||||
await mobileVoice.hover();
|
||||
await expect(mobileVoice).toHaveCSS("border-radius", "50%");
|
||||
await mobilePanel.locator("form").screenshot({ path: testInfo.outputPath("composer-voice-hover-narrow.png"), animations: "disabled" });
|
||||
});
|
||||
|
||||
test("speech recognition failure clears the active animation and explains the error", async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user