import { resolve, join, relative } from 'path'; import { PlaywrightTestConfig } from '@playwright/test'; import { getProjectRootPath } from './bin/build-tools/helper'; const port = parseInt(process.env.E2E_PORT, 10) || 38271; const cwd = resolve(join(getProjectRootPath(), 'dist')); const webserverBin = join(__dirname, 'node_modules', '.bin', 'http-server'); const command = `node ${relative(cwd, webserverBin)} -p ${port} -c-1 --cors`; const config: PlaywrightTestConfig = { use: { browserName: 'chromium', acceptDownloads: true, }, webServer: { command, port, timeout: 120 * 1000, reuseExistingServer: false, cwd, }, testDir: resolve(join(getProjectRootPath(), 'tests')), outputDir: resolve(join(getProjectRootPath(), 'test-results')), }; export default config;