fix(e2e): 移除测试文件中的重复登录逻辑

问题:
- 其他测试文件仍在使用beforeEach进行登录
- 这会覆盖setup中保存的登录状态
- 导致测试失败

修复:
- 移除audit-workflow.spec.ts中的beforeEach登录
- 移除system-config-workflow.spec.ts中的beforeEach登录
- 移除file-management-workflow.spec.ts中的beforeEach登录

优势:
- 统一使用setup保存的登录状态
- 减少重复代码
- 提高测试稳定性
This commit is contained in:
张翔
2026-04-07 11:55:41 +08:00
parent b34c09bdaf
commit 4363af5ed1
4 changed files with 22 additions and 24 deletions
@@ -1,14 +1,6 @@
import { test, expect } from '@playwright/test';
test.describe('审计工作流', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/login');
await page.locator('input[placeholder*="用户名"]').fill('admin');
await page.locator('input[placeholder*="密码"]').fill('admin123');
await page.locator('button:has-text("登录")').click();
await page.waitForURL('**/dashboard', { timeout: 30000 });
});
test('执行操作并查看操作日志', async ({ page }) => {
await test.step('执行用户管理操作', async () => {
await page.goto('/users');