Rather than asserting elements that depend on specific user/org state
(teachers assigned, multi-role permission, org selected), check for
prerequisites first and skip with a descriptive message when absent.
Changes:
- teacher-switching:134 — check .van-cell count, skip if student has no teachers
- teacher-switching:163 — skip if .van-icon-exchange not visible (no multi-role)
- course-package-store:186 — skip if .course-package-section not visible
(org not selected)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- test 134: wait for .van-cell to be visible (20s timeout) before counting
teacher list cells — API response may be delayed
- test 163: scroll to top + await .van-icon-exchange visibility (15s)
before clicking — icon may be out-of-viewport or slow to render
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Fix action sheet item selection to use nth() instead of hasText filter
(role names use "教师" not "老师" in action sheet, and hasText caused
multiple matches with "主管教师")
- Add waitFor for action sheet animation to fix visibility race condition
- Add test: teacherless student auto-redirect to /student/teacher-select
via API route interception
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add test: switching from teacher to student auto-selects teacher
- Add test: teacher selection doesn't loop back to org select
- Update existing tests to verify auto-select behavior
- Verify teacher name displayed (not "未选择老师") on profile
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
establishSession picks the first role (测试员), but the test needs
STUDENT role. Rewrote helper to click "学生" explicitly and wait for
SPA to settle before assertions.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
User has multiple roles, first grid item may not be STUDENT.
Add loginAsStudent helper to find and click the "学生" role.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Verify profile shows current teacher, teacher switching flow,
and my teachers list displays correctly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>