Files
ontime/playwright.config.ts
Alex Christoffer Rasmussen fc7ed6bd20 clean turbo config and cache github actions (#1805)
* refactor: turbo scripts

refactor dev and build scripts

remove cleanup

* fix e2e script

* cache playwright

* cache pnpm

* fix docker env in vite

* fixup! refactor: turbo scripts

* chore: add comment
2025-10-07 12:32:12 +02:00

65 lines
1.4 KiB
TypeScript

import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';
const isDevMode = process.env.NODE_ENV === 'development';
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './e2e/tests',
timeout: 60 * 1000,
expect: {
timeout: 5000,
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: 'html',
webServer: isDevMode
? {
command: 'turbo run dev',
port: 3000,
reuseExistingServer: true,
timeout: 60 * 1000,
}
: {
command: 'turbo run dev --filter=ontime-server',
port: 4001,
reuseExistingServer: true,
timeout: 60 * 1000,
},
use: {
screenshot: 'only-on-failure',
video: 'retain-on-failure',
viewport: { width: 1920, height: 1080 },
actionTimeout: 5000,
baseURL: isDevMode ? 'http://localhost:3000' : 'http://localhost:4001',
ignoreHTTPSErrors: true,
trace: 'on-first-retry',
launchOptions: {
slowMo: process.env.CI ? undefined : 250,
},
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'webkit',
testMatch: /.*.spec.mac.ts/,
use: {
...devices['Desktop Safari'],
},
},
],
outputDir: 'test-results/',
};
export default config;