完善建模交互与结果曲线功能
支持元件接口接触吸附、旋转后兼容连接及无连线逻辑边。 完善 AMESim 图标显示、参数双栏、结果曲线待定窗口及相关端到端测试。
This commit is contained in:
1 parent
410ef535e8
commit
503394f3ed
10 files changed
+2542
-389
No files matched your search
@@ -202,6 +202,88 @@ test("参数表列宽可调整并在刷新后保留", async ({ page }) => {
|
||||
await expect(reloadedSeparator).toHaveAttribute("aria-valuenow", "120");
|
||||
});
|
||||
|
||||
test("组件参数和仿真设置是可独立滚动并可调高度的子栏", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await addPneumaticTestComponent(page);
|
||||
|
||||
const componentPane = page.getByRole("region", {
|
||||
name: "组件参数子栏",
|
||||
exact: true,
|
||||
});
|
||||
const simulationPane = page.getByRole("region", {
|
||||
name: "仿真设置子栏",
|
||||
exact: true,
|
||||
});
|
||||
const separator = page.getByRole("separator", {
|
||||
name: "调整组件参数和仿真设置区域高度",
|
||||
exact: true,
|
||||
});
|
||||
await expect(componentPane).toBeVisible();
|
||||
await expect(simulationPane).toBeVisible();
|
||||
await expect(separator).toBeVisible();
|
||||
|
||||
const initialValue = Number(await separator.getAttribute("aria-valuenow"));
|
||||
const initialMaximum = Number(await separator.getAttribute("aria-valuemax"));
|
||||
expect(initialMaximum).toBeGreaterThanOrEqual(initialValue);
|
||||
const initialComponentBox = await componentPane.boundingBox();
|
||||
const initialSimulationBox = await simulationPane.boundingBox();
|
||||
const separatorBox = await separator.boundingBox();
|
||||
expect(initialComponentBox).not.toBeNull();
|
||||
expect(initialSimulationBox).not.toBeNull();
|
||||
expect(separatorBox).not.toBeNull();
|
||||
expect(initialSimulationBox!.height).toBeGreaterThanOrEqual(120);
|
||||
|
||||
await page.mouse.move(
|
||||
separatorBox!.x + separatorBox!.width / 2,
|
||||
separatorBox!.y + separatorBox!.height / 2,
|
||||
);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(
|
||||
separatorBox!.x + separatorBox!.width / 2,
|
||||
separatorBox!.y + separatorBox!.height / 2 + 40,
|
||||
{ steps: 4 },
|
||||
);
|
||||
await page.mouse.up();
|
||||
|
||||
await expect(separator).toHaveAttribute(
|
||||
"aria-valuenow",
|
||||
String(initialValue + 40),
|
||||
);
|
||||
const resizedComponentBox = await componentPane.boundingBox();
|
||||
const resizedSimulationBox = await simulationPane.boundingBox();
|
||||
expect(resizedComponentBox!.height).toBeGreaterThan(
|
||||
initialComponentBox!.height + 38,
|
||||
);
|
||||
expect(resizedSimulationBox!.height).toBeLessThan(
|
||||
initialSimulationBox!.height - 38,
|
||||
);
|
||||
|
||||
const overflowModes = await page
|
||||
.locator(".properties-subpane-content")
|
||||
.evaluateAll((elements) =>
|
||||
elements.map((element) => getComputedStyle(element).overflowY),
|
||||
);
|
||||
expect(overflowModes).toEqual(["auto", "auto"]);
|
||||
|
||||
await page.reload();
|
||||
const reloadedSeparator = page.getByRole("separator", {
|
||||
name: "调整组件参数和仿真设置区域高度",
|
||||
exact: true,
|
||||
});
|
||||
await expect(reloadedSeparator).toHaveAttribute(
|
||||
"aria-valuenow",
|
||||
String(initialValue + 40),
|
||||
);
|
||||
await reloadedSeparator.focus();
|
||||
await page.keyboard.press("ArrowUp");
|
||||
await expect(reloadedSeparator).toHaveAttribute(
|
||||
"aria-valuenow",
|
||||
String(initialValue + 20),
|
||||
);
|
||||
await reloadedSeparator.dblclick();
|
||||
await expect(reloadedSeparator).toHaveAttribute("aria-valuenow", "340");
|
||||
});
|
||||
|
||||
test("组件参数公式保留原式,并在说明中显示计算值且 XML 只写数值", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in new issue
Block a user