旧版前端工程文件导入时版本对比查验、审阅与仿真时部分阻挡功能实现;前端参数输入格式统一规范
This commit is contained in:
1 parent
22579e51c9
commit
44b6ea74ab
32 files changed
+2087
-322
No files matched your search
@@ -883,7 +883,7 @@ test("MECMAS21 旧的 0/1 编码不转换并阻止执行", async ({
|
||||
await expect(consolePanel).toContainText("模型检查发现");
|
||||
});
|
||||
|
||||
test("缺失模型版本的工程可查看但不补默认参数且不能执行", async ({
|
||||
test("缺失模型版本保留来源并补当前默认值,生成 XML 只警告", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
@@ -923,8 +923,8 @@ test("缺失模型版本的工程可查看但不补默认参数且不能执行",
|
||||
const node = page.locator(
|
||||
'.flow-canvas .react-flow__node[data-id="amesim_mecmas21_1"]',
|
||||
);
|
||||
await expect(node.locator('[data-model-contract-compatible="false"]')).toBeVisible();
|
||||
await expect(node.getByLabel(/模型合同不兼容/)).toBeVisible();
|
||||
await expect(node.locator('[data-model-contract-compatible="true"]')).toBeVisible();
|
||||
await expect(node.getByLabel(/模型合同不兼容/)).toHaveCount(0);
|
||||
await page.getByRole("button", { name: "保存工程", exact: true }).click();
|
||||
const persistedWithoutDefaults = await page.evaluate(() => {
|
||||
const key = Object.keys(window.localStorage).find((candidate) =>
|
||||
@@ -950,7 +950,7 @@ test("缺失模型版本的工程可查看但不补默认参数且不能执行",
|
||||
data &&
|
||||
data.modelVersion === undefined &&
|
||||
data.parameters &&
|
||||
!("strib" in data.parameters),
|
||||
("strib" in data.parameters),
|
||||
);
|
||||
});
|
||||
expect(persistedWithoutDefaults).toBe(true);
|
||||
@@ -959,20 +959,13 @@ test("缺失模型版本的工程可查看但不补默认参数且不能执行",
|
||||
name: "仿真控制台",
|
||||
exact: true,
|
||||
});
|
||||
await page.getByRole("button", { name: "检查模型", exact: true }).click();
|
||||
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(
|
||||
"缺少 modelVersion",
|
||||
);
|
||||
await expect(consolePanel).toContainText("工程包含旧版或版本未知的组件");
|
||||
await page.getByRole("button", { name: "生成系统 XML", exact: true }).click();
|
||||
await expandSimulationConsole(page);
|
||||
await expect(consolePanel).toContainText("不能生成执行 XML");
|
||||
await page.getByRole("button", { name: "运行仿真", exact: true }).click();
|
||||
await expect(consolePanel).toContainText("模型检查发现");
|
||||
await expect(consolePanel).toContainText("XML 已生成");
|
||||
await expect(consolePanel).toContainText("可能出现仿真失败或仿真结果与实际不符");
|
||||
await expect(consolePanel).not.toContainText("不能生成执行 XML");
|
||||
});
|
||||
|
||||
test("详情浮层只在参数列悬停且下拉选择期间不触发", async ({ page }) => {
|
||||
|
||||
Reference in new issue
Block a user