test: 增强Playwright E2E测试方案 - 新增手术计费/医生站/并发测试用例

- 新增页面对象: SurgeryBillingPage, DoctorStationPage
- 新增测试用例: 手术计费防重复(#437), 签发耗材验证(#443), 并发操作测试
- 增强登录测试: 多场景覆盖
- 完善测试数据工具: 支持多角色用户配置
- 清理冗余备份文件
This commit is contained in:
2026-04-25 22:04:36 +08:00
parent 46a7076460
commit 305ab15436
13 changed files with 361 additions and 2503 deletions

View File

@@ -1,21 +1,40 @@
import { defineConfig, devices } from '@playwright/test';
/**
* OpenHIS Playwright E2E 测试配置 v2.0
*
* 运行命令:
* npx playwright test # 全部测试
* npx playwright test --project=chromium # 仅Chrome
* npx playwright test login # 仅登录测试
* npx playwright test --ui # UI交互模式
* npx playwright test --headed # 有头模式(可视化)
* npx playwright test --tags=@smoke # 仅冒烟测试
*/
export default defineConfig({
testDir: './tests/e2e/specs',
timeout: 60 * 1000,
expect: { timeout: 10000 },
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: [['html', { outputFolder: 'playwright-report' }], ['list']],
fullyParallel: true,
timeout: 60_000,
expect: { timeout: 10_000 },
retries: process.env.CI ? 2 : 1,
workers: process.env.CI ? 2 : undefined,
reporter: [
['html', { outputFolder: 'tests/e2e/report', open: 'never' }],
['list'],
],
use: {
baseURL: process.env.TEST_BASE_URL || 'http://localhost:80',
trace: 'on-first-retry',
baseURL: process.env.TEST_BASE_URL || 'http://localhost:81',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
trace: 'retain-on-failure',
viewport: { width: 1920, height: 1080 },
locale: 'zh-CN',
timezoneId: 'Asia/Shanghai',
actionTimeout: 15_000,
navigationTimeout: 30_000,
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
],
});