Files
opencode-manager/e2e/playwright.config.ts
T

49 lines
1.2 KiB
TypeScript

import path from 'node:path'
import { defineConfig, devices } from '@playwright/test'
import { BASE_URL, E2E_ROOT, REPO_ROOT, STORAGE_STATE, createServerEnv } from './env'
export default defineConfig({
testDir: E2E_ROOT,
outputDir: path.join(REPO_ROOT, 'test-results'),
fullyParallel: false,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
timeout: 60_000,
expect: { timeout: 15_000 },
reporter: [
['list'],
['html', { open: 'never', outputFolder: path.join(REPO_ROOT, 'playwright-report') }],
],
use: {
baseURL: BASE_URL,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'setup',
testMatch: /auth\.setup\.ts/,
},
{
name: 'chromium',
testMatch: /.*\.spec\.ts/,
use: {
...devices['Desktop Chrome'],
storageState: STORAGE_STATE,
},
dependencies: ['setup'],
},
],
webServer: {
command: 'bash e2e/server.sh',
cwd: REPO_ROOT,
url: `${BASE_URL}/api/health`,
timeout: 180_000,
reuseExistingServer: false,
gracefulShutdown: { signal: 'SIGTERM', timeout: 15_000 },
env: createServerEnv(),
},
})