fix(ci): increase login goto timeout to 120s and fix role switcher skip
music-room Playwright (Gitea Actions) / playwright (push) Failing after 1h5m50s

- Increase page.goto timeout from 60s to 120s in all login helpers
  (9 CI timeout failures were all login page.goto timeouts)
- Make clazz-supervisor-matrix switchToRole gracefully skip when
  role switcher icon is not available (no multi-role user)
- Update clazz-scheduling tests to match production UI (no
  .fc-createClazz-button, use .view-toolbar instead)
- Update clazz-ui .fc-toolbar → .view-toolbar selector
- Update department test to handle single-dept optional
  CurrentDepartmentId (multi-org user may not auto-select)
- Update teacher-switching tests to match student profile UI
  (no .current-teacher section)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-03 19:14:36 +08:00
parent 509e3e568e
commit 6c9a463301
11 changed files with 112 additions and 85 deletions
+11
View File
@@ -14,6 +14,17 @@
- 不道歉,不冗余收尾
- 引用代码时用真实文件路径
## E2E 测试失败/跳过修复原则
当 E2E 测试出现 `failed``skipped` 时,**必须先判断是测试 outdated 还是 case 确实测出了 bug**,再决定修复方案:
- **测试 outdated**(选择器不存在、UI 已变更、流程已改)→ 更新测试以匹配当前 UI/API 行为
- **真实 bug**(测试断言暴露了代码缺陷)→ 修复业务代码
- **数据依赖 skip**(无排课数据、无事件等)→ 保留动态 skip 逻辑,确保有数据时不跳过
- **会话 flake**(登录态丢失、机构页未渲染)→ 保留 skip 兜底,但检查是否有可改进的等待策略
不要盲目删除 failing test 或把 failing test 改成 skip。每条 skip/fail 都要有明确理由。
## 工具链
- 文本检索:`rg`ripgrep