浏览代码

✅ test(e2e): 确保测试套件按顺序执行

- 将登录页面测试套件改为串行执行,避免测试间相互干扰
- 将用户管理测试套件改为串行执行,确保测试环境稳定性
yourname 2 月之前
父节点
当前提交
3e066812d4
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      tests/e2e/specs/admin/login.spec.ts
  2. 1 1
      tests/e2e/specs/admin/users.spec.ts

+ 1 - 1
tests/e2e/specs/admin/login.spec.ts

@@ -1,7 +1,7 @@
 import { test, expect } from '../../utils/test-setup';
 import testUsers from '../../fixtures/test-users.json' with { type: 'json' };
 
-test.describe('登录页面 E2E 测试', () => {
+test.describe.serial('登录页面 E2E 测试', () => {
   test.beforeEach(async ({ page, adminLoginPage }) => {
     await adminLoginPage.goto();
   });

+ 1 - 1
tests/e2e/specs/admin/users.spec.ts

@@ -7,7 +7,7 @@ const __filename = fileURLToPath(import.meta.url);
 const __dirname = dirname(__filename);
 const testUsers = JSON.parse(readFileSync(join(__dirname, '../../fixtures/test-users.json'), 'utf-8'));
 
-test.describe('用户管理 E2E 测试', () => {
+test.describe.serial('用户管理 E2E 测试', () => {
   test.beforeEach(async ({ adminLoginPage, userManagementPage }) => {
     // 以管理员身份登录后台
     await adminLoginPage.goto();