Files
workinf_Blender_Wasm/web/tests/e2e/web-save-download-semantics.spec.ts
mes123456 b932db7642 feat(manual): add the illustrated Web Blender HTML user manual
A single-page 28-chapter manual generated from manual.json covers the
11 workspaces, all React editors, OPFS save/reopen, explicit local
downloads, import/export routes, preferences/keymap and the capability
matrix. It reuses verified course screenshots and adds 14 fresh
Chromium captures for shell, storage, area, camera, preferences, IO and
troubleshooting chapters.

Manual-driven fixes: Save As now states OPFS-only, GLTF import is
restored, quick toolbar honors its preference, startup workspace is
applied, Properties tabs jump to sections, Outliner fallback search
filters, and the editor-header ⋮ opens the area menu. Help and the
tutorial landing link the new manual; the PDF remains as an archive.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-13 11:58:40 +08:00

29 lines
1.6 KiB
TypeScript

import { expect, test } from "@playwright/test";
test.use({ viewport: { width: 1440, height: 900 } });
async function openSaveAs(page: import("@playwright/test").Page): Promise<void> {
await page.getByRole("button", { name: "文件", exact: true }).click();
await page.getByRole("menuitem", { name: "另存为", exact: true }).click();
await page.getByLabel("另存为文件名", { exact: true }).waitFor({ timeout: 30_000 });
}
test("Save As writes OPFS only and local .blend requires the explicit download action", async ({ page }) => {
test.setTimeout(240_000);
await page.goto("/?ui=web");
await page.locator("main.blender-app").waitFor({ timeout: 120_000 });
await expect(page.getByTestId("scene-stats")).toBeVisible({ timeout: 120_000 });
await openSaveAs(page);
await expect(page.getByText("不会自动下载文件", { exact: false })).toBeVisible();
await page.getByLabel("另存为文件名", { exact: true }).fill("manual-save-as.blend");
const unexpectedDownload = page.waitForEvent("download", { timeout: 2_000 }).then(() => true).catch(() => false);
await page.getByRole("button", { name: "确认", exact: true }).click();
expect(await unexpectedDownload).toBe(false);
await expect(page.locator("main.blender-app")).toHaveAttribute("data-user-action-save-as-status", "SUCCEEDED", { timeout: 60_000 });
const download = page.waitForEvent("download", { timeout: 60_000 });
await page.locator('button[aria-label="下载 .blend"]').evaluate((element) => (element as HTMLElement).click());
expect((await download).suggestedFilename()).toMatch(/\.blend$/);
});