Files
workinf_Blender_Wasm/web/tests/e2e/user-manual-smoke.spec.ts
mes123456 63db6caf1f
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
feat(web): studio worlds, camera-view/offscreen environment parity, material and undo coverage
Environment lighting:
- ship all eight desktop studiolights/world datasets (WBENV1 float32) and a
  shared loader used by both the main viewport and the offscreen worker
- add the N-panel "studio 环境" selector
- rotate the world background together with the environment
  (backgroundRotation/backgroundIntensity), so camera view and offscreen
  renders match the desktop Mapping-node behaviour

Verification (Chromium, OPFS, NOT_CLAIMED):
- environment lighting + 8 world pixel identity
- camera-view rotation correspondence (camera matrices, 207 samples)
- offscreen vs on-screen background parity after hiding geometry (1305 samples)
- metals case extended with material-field OPFS roundtrip
- material Principled edits and rename undo/redo
- eight studio worlds: pairwise frame differences + luminance rank correlation
- undo history depth capped at 64 steps and undo across OPFS save/reopen

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 09:27:47 +08:00

46 lines
2.5 KiB
TypeScript

import { expect, test } from "@playwright/test";
test.use({ viewport: { width: 1600, height: 900 } });
test("HTML manual has chapters, figures, working search and no overflow", async ({ page }) => {
test.setTimeout(240_000);
await page.goto("/manuals/index.html", { waitUntil: "load" });
await expect(page.locator(".manual-chapter")).toHaveCount(31);
await expect(page.locator(".manual-nav a[data-nav-id]")).toHaveCount(35);
await expect(page.getByLabel("搜索手册", { exact: true })).toBeVisible();
await expect(page.locator("figure img").first()).toBeVisible();
const firstImage = await page.locator("figure img").first().evaluate((element) => ({ complete: (element as HTMLImageElement).complete, width: (element as HTMLImageElement).naturalWidth }));
expect(firstImage.complete).toBe(true);
expect(firstImage.width).toBeGreaterThan(0);
await page.getByLabel("搜索手册", { exact: true }).fill("相机");
await expect(page.locator(".manual-search-status")).toContainText("匹配");
await expect.poll(async () => page.locator(".manual-nav a[data-nav-id][hidden]").count()).toBeGreaterThan(0);
await page.getByLabel("搜索手册", { exact: true }).fill("");
await expect(page.locator(".manual-search-status")).toHaveText("");
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - window.innerWidth);
expect(overflow).toBeLessThanOrEqual(1);
});
test("manual is responsive and reachable from Help", async ({ page, context }) => {
test.setTimeout(240_000);
await page.setViewportSize({ width: 390, height: 844 });
await page.goto("/manuals/index.html", { waitUntil: "load" });
await expect(page.locator(".manual-menu-toggle")).toBeVisible();
expect(await page.evaluate(() => document.documentElement.scrollWidth - window.innerWidth)).toBeLessThanOrEqual(1);
await page.setViewportSize({ width: 1600, height: 900 });
await page.goto("/?ui=web", { waitUntil: "domcontentloaded" });
await page.locator("main.blender-app").waitFor({ timeout: 120_000 });
await page.getByRole("button", { name: "帮助", exact: true }).click();
const entry = page.getByRole("menuitem", { name: "使用手册(网页版)", exact: true });
await expect(entry).toBeVisible();
const popupPromise = context.waitForEvent("page", { timeout: 30_000 });
await entry.click();
const popup = await popupPromise;
await popup.waitForLoadState("domcontentloaded");
expect(new URL(popup.url()).pathname).toBe("/manuals/index.html");
await expect(popup.locator(".manual-chapter")).toHaveCount(31);
});