test(e2e): 前后台联调 Playwright 与 admin 冒烟
新增 e2e-live 真 API 一致性全路径,并为 admin-h5 增加 mock 浏览器冒烟。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
|
||||
/**
|
||||
* Live full-stack e2e: real Go API + user-h5 + admin-h5.
|
||||
* Prerequisites: `npm run deps:up` and API on :8080 (or started via webServer).
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: './tests',
|
||||
fullyParallel: false,
|
||||
workers: 1,
|
||||
timeout: 180_000,
|
||||
expect: { timeout: 20_000 },
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: 0,
|
||||
use: {
|
||||
trace: 'retain-on-failure',
|
||||
screenshot: 'only-on-failure',
|
||||
video: 'retain-on-failure',
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: {
|
||||
...devices['Desktop Chrome'],
|
||||
...(process.env.PW_CHANNEL ? { channel: process.env.PW_CHANNEL } : {}),
|
||||
},
|
||||
},
|
||||
],
|
||||
webServer: [
|
||||
{
|
||||
command: 'npm run dev -w @yuxingu/user-h5 -- --host 127.0.0.1 --port 5173',
|
||||
url: 'http://127.0.0.1:5173/psy/',
|
||||
reuseExistingServer: true,
|
||||
timeout: 120_000,
|
||||
},
|
||||
{
|
||||
command: 'npm run dev -w @yuxingu/admin-h5 -- --host 127.0.0.1 --port 5174',
|
||||
url: 'http://127.0.0.1:5174/',
|
||||
reuseExistingServer: true,
|
||||
timeout: 120_000,
|
||||
},
|
||||
],
|
||||
})
|
||||
Reference in New Issue
Block a user