import { defineConfig } from '@playwright/test'; const production = process.env.CADWORLD_PRODUCTION_TEST === '1'; const dev = process.env.CADWORLD_BUILTIN_DEV === '1'; export default defineConfig({ testDir: './e2e', testMatch: 'builtinRobots.spec.ts', workers: 1, timeout: 180_000, use: { baseURL: production ? 'https://cadworld-sim.robotquan.com' : 'http://127.0.0.1:4182', viewport: { width: 1440, height: 1000 }, trace: production ? 'off' : 'retain-on-failure', screenshot: 'only-on-failure', launchOptions: { args: [ '--use-angle=swiftshader', '--enable-unsafe-swiftshader', ...(production ? ['--host-resolver-rules=MAP cadworld-sim.robotquan.com 47.93.31.109'] : []), ], }, }, webServer: production ? undefined : { command: `cd .. && npm run ${dev ? 'dev:website' : 'preview -- --mode website'} ${dev ? '--' : ''} --host 127.0.0.1 --port 4182 --strictPort`, url: 'http://127.0.0.1:4182', reuseExistingServer: false, }, });