test: add playwright config and e2e tests

This commit is contained in:
2026-05-27 23:28:44 +08:00
parent 13846a0b61
commit 88ec132579
8 changed files with 515 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './e2e',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: 'list',
use: {
baseURL: 'http://localhost:5158',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
channel: 'chrome',
},
},
],
webServer: {
command: 'pnpm dev',
url: 'http://localhost:5158',
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
});