Files
SystemSimulationApp/frontend/playwright.live.config.ts
T
lujingze e18399c022 整合求解器活动监控与步长回归证据
同步远端 PNL0003 诊断和大采样网格能力,语义合并活动感知的 60 秒真停滞判定与旧后端 15 分钟兼容兜底。

纳管热路径优化、15 单元运行证据、浏览器与 API 报告,并补充北京时间更新日志和遗留问题。
2026-08-19 16:24:31 +00:00

60 lines
2.1 KiB
TypeScript

import { defineConfig } from "@playwright/test";
import { fileURLToPath } from "node:url";
const channel = process.env.PLAYWRIGHT_CHANNEL?.trim();
const executablePath = process.env.PLAYWRIGHT_EXECUTABLE_PATH?.trim();
const frontendRoot = fileURLToPath(new URL(".", import.meta.url));
const repositoryRoot = fileURLToPath(new URL("..", import.meta.url));
const simulationEnvironment = {
...process.env,
SIMULATION_CAUSAL_EXECUTOR_V2: "1",
SIMULATION_CAUSAL_COORDINATE_KERNEL: "1",
SIMULATION_CAUSAL_DIRECT_SUM_ASSIGNMENTS: "1",
SIMULATION_CAUSAL_DIRECT_EQUATION_READERS: "1",
SIMULATION_CAUSAL_FAST_PATH: "1",
SIMULATION_MECHANICAL_ATOL_MODE: "legacy",
SIMULATION_ODE_JACOBIAN_MODE: "scipy",
SIMULATIONAPP_PROPERTY_CACHE: "on",
};
export default defineConfig({
testDir: "./tests/e2e",
fullyParallel: false,
workers: 1,
timeout: 600_000,
expect: {
timeout: 15_000,
},
outputDir: "test-results/live-mql8",
use: {
baseURL: "http://127.0.0.1:14173",
...(channel ? { channel } : {}),
...(executablePath ? { launchOptions: { executablePath } } : {}),
headless: true,
viewport: { width: 1440, height: 900 },
screenshot: "only-on-failure",
trace: "on",
},
webServer: [
{
command:
".venv/bin/python -m uvicorn app.main:app --host 127.0.0.1 --port 18181",
cwd: repositoryRoot,
env: simulationEnvironment,
url: "http://127.0.0.1:18181/api/components/catalog",
reuseExistingServer: false,
timeout: 120_000,
gracefulShutdown: { signal: "SIGTERM", timeout: 10_000 },
},
{
command:
"node --input-type=module -e \"import { createServer } from 'vite'; import react from '@vitejs/plugin-react'; const server = await createServer({ configFile: false, root: process.cwd(), plugins: [react()], server: { host: '127.0.0.1', port: 14173, strictPort: true, proxy: { '/api': 'http://127.0.0.1:18181' } } }); await server.listen();\"",
cwd: frontendRoot,
url: "http://127.0.0.1:14173",
reuseExistingServer: false,
timeout: 120_000,
gracefulShutdown: { signal: "SIGTERM", timeout: 10_000 },
},
],
});