Files
his/openhis-ui-vue3/tests/e2e/utils/test-data.ts
liubei e0e6693897 fix: 修正Playwright测试方案架构问题(诸葛亮审查反馈)
- 新增fixtures/auth.ts 登录认证夹具
- 新增pages/LoginPage.ts 页面对象模型
- 新增specs/login.spec.ts 登录测试用例(成功/失败/空用户名)
- 新增specs/bug-regression.spec.ts Bug回归测试(#437/#427)
- 新增.env.test 测试环境变量模板
- package.json添加test:e2e/test:e2e:ui/test:e2e:report脚本
- 移除test-data.ts中密码硬编码,改用环境变量
- .gitignore添加.env.test.local/playwright-report/test-results

感谢诸葛亮架构审查!
2026-04-25 21:07:40 +08:00

24 lines
603 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export const TEST_USERS = {
admin: {
username: process.env.TEST_USERNAME || '',
password: process.env.TEST_PASSWORD || '',
},
};
export const TEST_URLS = {
login: '/',
dashboard: '/dashboard',
doctorStation: '/doctorstation',
surgeryBilling: '/surgery-billing',
outpatientSchedule: '/surgicalschedule',
};
// 验证必要环境变量
export function validateTestEnv() {
if (!TEST_USERS.admin.username || !TEST_USERS.admin.password) {
throw new Error(
'测试环境变量未配置!请设置 TEST_USERNAME 和 TEST_PASSWORD或创建 .env.test 文件'
);
}
}