Files
workinf_Blender_Wasm/web/tests/e2e/wbv2-add-menu-native-production.spec.ts
mes123456 d1e6b63d54
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
chore: checkpoint web Blender feature-gap work, docs and tests
- update native web_engine sources and rebuilt wasm artifacts
- add task cards, status notes and tooling scripts
- add web e2e specs, tutorial UI sources and tutorial assets
- sync golden task manifests and audit records

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-11 10:46:55 +08:00

29 lines
1.6 KiB
TypeScript

import { test, expect } from "@playwright/test";
import fs from "node:fs";
import path from "node:path";
import { exposeWebTools } from "../fixtures/native-ui-workflow";
const root = path.resolve(import.meta.dirname, "../../..");
const receiptDir = path.join(root, "tests/golden/WBV2-P1425-001/verification");
fs.mkdirSync(receiptDir, { recursive: true });
test("Add menu creates Monkey through the native operator channel", async ({ page }) => {
test.setTimeout(120_000);
await page.goto("/");
await page.getByTestId("blend-file-input").setInputFiles(path.join(root, "tests/files/web/basic_scene.blend"));
await expect(page.getByTestId("engine-status")).toContainText(/SceneIR r\d+/, { timeout: 60_000 });
await exposeWebTools(page);
await page.getByRole("button", { name: "添加", exact: true }).click();
await page.getByRole("menuitem", { name: "网格", exact: true }).click();
await page.getByRole("menuitem", { name: "猴头", exact: true }).click();
await expect(page.getByTestId("engine-status")).toContainText(/mesh\.primitive_monkey_add/, { timeout: 60_000 });
await expect(page.getByRole("treeitem").filter({ hasText: /Suzanne|Monkey/ }).first()).toBeVisible({ timeout: 60_000 });
fs.writeFileSync(path.join(receiptDir, "add-menu-native-production.json"), JSON.stringify({
schemaVersion: 1,
browser: "chromium",
scope: "Web Add menu -> desktop_operator(mesh.primitive_monkey_add) -> Main/SceneIR",
status: "PASS",
evidence: ["engine-status reported mesh.primitive_monkey_add", "Outliner exposed the new Suzanne/Monkey object"],
}, null, 2));
});