Files
workinf_Blender_Wasm/web/tests/e2e/io-format-ui-gate.spec.ts
mes123456 d5e736b80d
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
fix(web): synchronize WebEngine WASM with Blender sources
2026-09-07 11:33:34 +08:00

30 lines
1.5 KiB
TypeScript

import { expect, test } from "@playwright/test";
import path from "node:path";
const basicBlend = path.resolve(import.meta.dirname, "../../../tests/files/web/basic_scene.blend");
const objFixture = path.resolve(import.meta.dirname, "../../../tests/files/web/m12_obj_desktop_v1/single-mesh.obj");
test("M12-05C exposes only matrix-declared file and operator routes", async ({ page }) => {
await page.goto("/");
const input = page.getByTestId("blend-file-input");
await expect(input).toHaveAttribute("accept", ".blend,application/octet-stream,.gltf,.glb,.obj,.stl,.ply");
await expect(input).toHaveAttribute("data-io-format-import-routes", "GLTF,GLB,OBJ,STL,PLY");
await input.setInputFiles(basicBlend);
await expect(page.getByText("BasicCube", { exact: true })).toBeVisible();
await page.keyboard.press("F3");
const search = page.getByRole("textbox", { name: "搜索 Blender 操作" });
await search.fill("export glb");
await expect(page.getByRole("button", { name: "Export GLB", exact: true })).toHaveCount(1);
await search.fill("export usd");
await expect(page.getByRole("button", { name: /Export USD|导出 USD/ })).toHaveCount(0);
await search.fill("import obj");
await expect(page.getByRole("button", { name: /Import OBJ|导入 OBJ/ })).toHaveCount(0);
await page.keyboard.press("Escape");
await input.setInputFiles(objFixture);
await expect(page.getByTestId("engine-status")).toContainText("OBJ imported");
await expect(page.getByTestId("engine-status")).toContainText(/OBJ imported r\d+ \(\d+ objects\)/);
});