Files
next-tjwater-frontend/tests/browser/workbench-panel-map-stability.e2e.ts
jiang f4318a9b9c feat: refine workbench visuals and map controls
Unify the Agent history extension with the header acrylic surface, preserve the full conversation body, and consolidate shared control and status styling.

Restore map flow and SCADA controller behavior, remove obsolete rendering paths, and extend regression coverage. Button press coverage now releases outside the target so state assertions cannot accidentally toggle the control.
2026-07-28 16:39:36 +08:00

35 lines
1.3 KiB
TypeScript

import { expect, test } from "@playwright/test";
test("opening Agent and condition panels does not move the map camera", async ({ page }) => {
await page.goto("/", { waitUntil: "domcontentloaded" });
await page.waitForFunction(() =>
Boolean(window.__waterNetworkMap?.getLayer("scada-hit"))
);
await page.waitForTimeout(500);
await page.evaluate(() => {
const map = window.__waterNetworkMap;
document.documentElement.dataset.panelCameraMoveCount = "0";
map?.on("movestart", () => {
const currentCount = Number(
document.documentElement.dataset.panelCameraMoveCount ?? "0"
);
document.documentElement.dataset.panelCameraMoveCount = String(currentCount + 1);
});
});
await page.getByRole("button", { name: "折叠 Agent 面板" }).click();
await page.waitForTimeout(250);
await page.getByRole("button", { name: /展开 Agent 助手面板/ }).click();
await page.waitForTimeout(250);
const conditionPanel = page.getByRole("region", { name: "工况任务", exact: true });
await conditionPanel.getByRole("button", { name: "展开工况任务" }).click();
await page.waitForTimeout(250);
expect(
await page.evaluate(
() => document.documentElement.dataset.panelCameraMoveCount
)
).toBe("0");
});