test: 添加浏览器烟测套件 (#750)

* test: add Playwright browser smoke suite

* Update playwright.yml

---------

Co-authored-by: ekko <152005280+EKKOLearnAI@users.noreply.github.com>
This commit is contained in:
Zhicheng Han
2026-05-15 11:35:10 +02:00
committed by GitHub
parent e0bfa828cb
commit 97b15d6514
7 changed files with 339 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
/// <reference types="node" />
import { defineConfig, devices } from '@playwright/test'
const PORT = Number(process.env.PLAYWRIGHT_PORT || 4173)
const BASE_URL = `http://127.0.0.1:${PORT}`
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? [['dot'], ['html', { open: 'never' }]] : [['list']],
use: {
baseURL: BASE_URL,
locale: 'en-US',
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
webServer: {
command: `npx vite --host 127.0.0.1 --port ${PORT}`,
url: BASE_URL,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
})