test(ci): 增加 Playwright 冒烟用例
覆盖登录进入工作台、403/404 错误页、模块切换与面包屑联动,并接入 CI 产物归档。
This commit is contained in:
1 parent
073d210a92
commit
1876c56008
2 files changed
+74
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
const channel = process.env.CI ? undefined : 'chrome';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
timeout: 60_000,
|
||||
expect: { timeout: 10_000 },
|
||||
fullyParallel: true,
|
||||
forbidOnly: Boolean(process.env.CI),
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
reporter: process.env.CI
|
||||
? [['list'], ['html', { open: 'never' }], ['junit', { outputFile: 'test-results/e2e.xml' }]]
|
||||
: [['list'], ['html', { open: 'never' }]],
|
||||
use: {
|
||||
baseURL: 'http://127.0.0.1:4173',
|
||||
trace: 'on-first-retry',
|
||||
screenshot: 'only-on-failure',
|
||||
channel,
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: { ...devices['Desktop Chrome'], channel },
|
||||
},
|
||||
],
|
||||
webServer: {
|
||||
command: 'node node_modules/vite/bin/vite.js preview --host 127.0.0.1 --port 4173 --strictPort',
|
||||
cwd: 'apps/web',
|
||||
url: 'http://127.0.0.1:4173/login',
|
||||
reuseExistingServer: false,
|
||||
timeout: 60_000,
|
||||
stdout: 'ignore',
|
||||
stderr: 'pipe',
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user