Files
workinf_Blender_Wasm/web/playwright.config.ts
mes123456 d5dd647881
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): finish RE 5000PBR lesson video and fix non-ASCII GLB import
- Add 11:07 Chinese-narrated lesson video, VTT, poster and 13 chapter screenshots.
- Regenerate 20-render WebGL2 matrix and 15 operation captures on RTX 4060.
- Fix WASM staging for non-ASCII import filenames (猴头.glb); rebuild web_engine.
- Harden lesson video recording pipeline; fix stale lesson-link E2E selector.
- Add RE PBR derived libraries, lesson page, evidence and status report.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-12 21:49:24 +08:00

57 lines
1.7 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test";
import { execFileSync } from "node:child_process";
function resolveChromePath(): string | undefined {
if (process.env.CHROME_PATH) return process.env.CHROME_PATH;
try { return execFileSync("which", ["google-chrome"], { encoding: "utf8" }).trim() || undefined; }
catch { return undefined; }
}
const chromePath = resolveChromePath();
const testPort = Number.parseInt(process.env.WEB_TEST_PORT ?? "5173", 10) || 5173;
const testOrigin = `http://127.0.0.1:${testPort}`;
const gpuMode = process.env.GPU_MODE ?? (process.env.DISPLAY ? "hardware" : "swiftshader");
const hardwareArgs = [
"--no-sandbox",
"--use-gl=angle",
"--use-angle=gl",
"--ignore-gpu-blocklist",
"--enable-gpu-rasterization",
"--enable-zero-copy",
"--enable-unsafe-webgpu",
];
const swiftshaderArgs = [
"--no-sandbox",
"--use-gl=swiftshader",
"--enable-unsafe-swiftshader",
"--enable-unsafe-webgpu",
"--enable-dawn-features=allow_unsafe_apis",
"--use-webgpu-adapter=swiftshader",
];
export default defineConfig({
testDir: "tests/e2e",
testIgnore: ["archive-offline.spec.ts", "single-thread-unisolated.spec.ts"],
timeout: 30_000,
expect: { timeout: 10_000 },
fullyParallel: false,
reporter: [["list"]],
use: {
baseURL: testOrigin,
...devices["Desktop Chrome"],
headless: gpuMode !== "hardware",
launchOptions: {
...(chromePath ? { executablePath: chromePath } : {}),
args: gpuMode === "hardware" ? hardwareArgs : swiftshaderArgs,
},
screenshot: "only-on-failure",
trace: "retain-on-failure",
},
webServer: {
command: `npm run dev -- --host 127.0.0.1 --port ${testPort} --strictPort`,
url: testOrigin,
reuseExistingServer: false,
timeout: 30_000,
},
});