fix: 修复测试中操作admin用户导致后续测试失败的问题

- 修复密码哈希格式问题(从$2a$改为$2b$)
- 更新所有测试用例密码从Test@123改为admin123
- 修改测试2.3、2.5、2.6,避免操作admin用户(第1行)
- 在beforeEach中添加页面初始化,避免localStorage访问错误
- 添加测试数据清理机制
This commit is contained in:
张翔
2026-04-04 13:01:38 +08:00
parent f7e7cfc78d
commit be1c587dbf
12 changed files with 350 additions and 46 deletions
@@ -10,7 +10,7 @@ test.describe('用户创建诊断测试', () => {
test('诊断用户创建流程', async ({ page }) => {
await loginPage.goto();
await loginPage.login('admin', 'Test@123');
await loginPage.login('admin', 'admin123');
console.log('=== 开始诊断用户创建流程 ===');
await page.goto('/users');
@@ -27,7 +27,7 @@ test.describe('用户创建诊断测试', () => {
const timestamp = Date.now();
const userData = {
username: `testuser_${timestamp}`,
password: 'Test@123',
password: 'admin123',
email: `testuser_${timestamp}@test.com`,
phone: '13800138000',
nickname: `测试用户${timestamp}`