2026-09-13 00:56:23 -04:00
|
|
|
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'],
|
|
|
|
|
},
|
2026-09-20 13:11:38 -04:00
|
|
|
projects: [
|
|
|
|
|
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
|
|
|
|
|
// [Gitea #221] WebKit as the Safari/iOS proxy. It runs the subset tagged
|
|
|
|
|
// @webkit / @ios (boot, composer round-trip, thread panel, lightbox): it
|
|
|
|
|
// catches WebKit-only breakage (CSS, dvh, IndexedDB, media decode) that
|
|
|
|
|
// Chromium emulation can't, but does not emulate the iOS keyboard or the
|
|
|
|
|
// Home-Screen install flow.
|
|
|
|
|
{ name: 'webkit', use: { ...devices['Desktop Safari'] }, grep: /@webkit/ },
|
|
|
|
|
{ name: 'iphone', use: { ...devices['iPhone 14'] }, grep: /@ios/ },
|
|
|
|
|
],
|
2026-09-13 00:56:23 -04:00
|
|
|
webServer: {
|
|
|
|
|
command: `npx vite preview --port ${PORT} --strictPort`,
|
|
|
|
|
url: BASE_URL,
|
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
|
timeout: 60_000,
|
|
|
|
|
},
|
|
|
|
|
});
|