36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|||
|
|
|
||
|
|
// Playwright smoke tests (Gitea #90). Two tiers live under e2e/:
|
||
|
|
// - boot.spec.ts always runs; serves the built dist/ via `vite preview`
|
||
|
|
// and checks the client actually boots in a real browser.
|
||
|
|
// - e2ee-composer.spec.ts skips itself unless E2E_HOMESERVER/E2E_USER/E2E_PASSWORD
|
||
|
|
// are set (CI secrets — see LOTUS_TESTING.md).
|
||
|
|
// `npm run build` must have produced dist/ before `npm run test:e2e`.
|
||
|
|
const PORT = 4173;
|
||
|
|
const BASE_URL = `http://localhost:${PORT}/`;
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
testDir: './e2e',
|
||
|
|
timeout: 60_000,
|
||
|
|
expect: { timeout: 15_000 },
|
||
|
|
fullyParallel: false,
|
||
|
|
forbidOnly: !!process.env.CI,
|
||
|
|
retries: process.env.CI ? 1 : 0,
|
||
|
|
workers: 1,
|
||
|
|
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : [['list']],
|
||
|
|
outputDir: 'test-results',
|
||
|
|
use: {
|
||
|
|
baseURL: BASE_URL,
|
||
|
|
screenshot: 'only-on-failure',
|
||
|
|
trace: 'retain-on-failure',
|
||
|
|
...devices['Desktop Chrome'],
|
||
|
|
},
|
||
|
|
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
|
||
|
|
webServer: {
|
||
|
|
command: `npx vite preview --port ${PORT} --strictPort`,
|
||
|
|
url: BASE_URL,
|
||
|
|
reuseExistingServer: !process.env.CI,
|
||
|
|
timeout: 60_000,
|
||
|
|
},
|
||
|
|
});
|