Boot tier (runs against vite preview of dist/): login screen renders with no page or console errors, sw.js is served and registers, the bundled Element Call mounts in a frame with no failed asset requests. E2EE tier (skipped without E2E_HOMESERVER/E2E_USER/E2E_PASSWORD): password login, create an encrypted room, send text, attach a compressed JPEG, and assert at the network level that every send is m.room.encrypted with no plaintext body/url/file — the regression test #6/#7/#11 lacked. Secrets and local usage documented in LOTUS_TESTING.md. Fixes #90 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
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,
|
|
},
|
|
});
|