Files
workinf_Blender_Wasm/web/tests/e2e/wbv2-data-instance-add-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

34 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 a data instance from the active object", 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);
const cubeRow = page.locator('[data-node-id="object:BasicCube"]');
await cubeRow.click();
// Outliner selection is a native Main command; wait for its snapshot before
// the Add route resolves the active object's data-block.
await expect(cubeRow).toHaveAttribute("aria-selected", "true", { timeout: 60_000 });
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(/已执行:object\.data_instance_add/, { timeout: 60_000 });
await expect(page.getByRole("treeitem", { name: "Cube.001", exact: true })).toBeVisible({ timeout: 60_000 });
fs.writeFileSync(path.join(receiptDir, "data-instance-add-production.json"), JSON.stringify({
schemaVersion: 1,
browser: "chromium",
scope: "Web Add menu -> active object data lookup -> desktop_operator(object.data_instance_add) -> Main/SceneIR",
status: "PASS",
evidence: ["engine-status reported 已执行:object.data_instance_add", "Outliner exposed the new Cube.001 linked-data object"],
}, null, 2));
});