完善建模交互、组件图标与系统协议

This commit is contained in:
ljz committed 2026-08-15 17:40:18 +08:00
1 parent 456c29b3b6
commit 6572defaa4
66 files changed
+10067 -4163

No files matched your search

+12 -4
View File
@@ -1,5 +1,5 @@
import { expect, test } from "@playwright/test";
import { prepareApp } from "./fixtures";
import { expandSimulationConsole, prepareApp } from "./fixtures";
test.beforeEach(async ({ page }) => {
await prepareApp(page);
@@ -62,8 +62,9 @@ test("拖入介质定义后可供气动元件选择,删除定义会回退到
);
await page.getByRole("button", { name: "生成系统 XML" }).click();
await expandSimulationConsole(page);
const xmlBlock = consolePanel.getByLabel("生成的系统 XML");
await expect(xmlBlock).toContainText('mediumReferenceVersion="1"');
await expect(xmlBlock).toContainText('schemaVersion="3"');
await expect(xmlBlock).toContainText('<Parameter name="gi" value="0"');
});
@@ -82,6 +83,7 @@ test("介质定义的物性计算模型会写入 XML", async ({ page }) => {
await expect(page.getByLabel("物性计算模型")).toHaveValue("0");
await page.getByRole("button", { name: "生成系统 XML" }).click();
await expandSimulationConsole(page);
const consolePanel = page.getByRole("complementary", {
name: "仿真控制台",
exact: true,
@@ -133,6 +135,7 @@ test("氦气介质自动分配 gi,并以 Peng–Robinson 模型写入 XML", as
await expect(mediumSelect).toHaveValue("2");
await page.getByRole("button", { name: "生成系统 XML" }).click();
await expandSimulationConsole(page);
const consolePanel = page.getByRole("complementary", {
name: "仿真控制台",
exact: true,
@@ -156,8 +159,8 @@ test("氦气介质自动分配 gi,并以 Peng–Robinson 模型写入 XML", as
test("导入工程中的未知物性计算模型会被检查出来", async ({ page }) => {
await page.goto("/");
const project = {
projectSchemaVersion: 1,
name: "invalid-property-model",
mediumReferenceVersion: 1,
nodes: [
{
id: "amesim_ideal_air_medium_1",
@@ -196,7 +199,12 @@ test("导入工程中的未知物性计算模型会被检查出来", async ({ pa
name: "仿真控制台",
exact: true,
});
await expect(consolePanel).toContainText(
await expect(consolePanel).toHaveClass(/minimized/);
await expect(
consolePanel.locator(".simulation-console-dock-summary"),
).toContainText("模型检查发现");
await expandSimulationConsole(page);
await expect(consolePanel.locator(".simulation-console-dock-log")).toContainText(
"空气介质_1:物性计算模型不在支持的可选项中",
);
});