Files
workinf_Blender_Wasm/web/playwright.single-thread.config.ts
mes123456 7c16b279ae
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
Advance M7 workflows and release operations
2026-08-15 17:43:53 -04:00

40 lines
1.3 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 ?? "5202", 10) || 5202;
const testOrigin = `http://127.0.0.1:${testPort}`;
export default defineConfig({
testDir: "tests/e2e",
testMatch: "single-thread-unisolated.spec.ts",
timeout: 45_000,
expect: { timeout: 20_000 },
fullyParallel: false,
reporter: [["list"]],
use: {
baseURL: testOrigin,
...devices["Desktop Chrome"],
headless: true,
launchOptions: {
...(chromePath ? { executablePath: chromePath } : {}),
args: ["--no-sandbox", "--use-gl=swiftshader", "--enable-unsafe-swiftshader"],
},
screenshot: "only-on-failure",
trace: "retain-on-failure",
},
webServer: {
command: `WEB_TEST_UNISOLATED_SINGLE_THREAD=1 npm run dev -- --host 127.0.0.1 --port ${testPort} --strictPort`,
cwd: import.meta.dirname,
url: testOrigin,
reuseExistingServer: false,
timeout: 30_000,
},
});