Trường Số QA/04 Attendance
Trường Số · QA test suite · Phase 1 · 10/09/2026
04 · Attendance
Test cases for PRD 04. Every case names the fixture data it needs (see the dashboard fixtures table), numbered steps, and one observable expected result. Trace points to the user story or rule in the PRD.
Key facts, origin and limits
Drafted by an AI assistant in a single session on 10/09/2026 as part of the Trường Số QA suite, under the request quoted verbatim on the dashboard. A proposal for team review, not a sign-off.
Sources
- The Trường Số PRD set (Draft v1, 10/09/2026): user stories, screen tables, business rules and permission matrices, plus the Cloud theme reference.
Limits
- Phase 1 (authoring) only. Cases are executed in Phase 2 against the local build; results are recorded in
testcases.jsonandruns/run-1/, and every result field is stillnot_run. - Cases inherit any open question or inconsistency in the PRDs they trace to.
1Summary
P0
16
P1
34
P2
7
P3
0
| Type | functional | ui-ux | edge | negative | regression | flow | a11y | perf | security | i18n |
|---|---|---|---|---|---|---|---|---|---|---|
| Count | 36 | 3 | 4 | 4 | 0 | 1 | 1 | 1 | 6 | 1 |
2Test cases
| ID | Title | Type | Priority | Phase | Preconditions | Steps | Expected result | PRD trace | Data needed | Run 1 |
|---|---|---|---|---|---|---|---|---|---|---|
| TS-ATT-001 | Teacher today list on mobile | functional | P0 | P1 | As U-TEACH at 390 px; SES-TODAY planned; SES-YEST unmarked. |
| SES-YEST pinned on top in amber with chip "Chưa điểm danh"; SES-TODAY listed with time 18:00–19:30, "Movers 2A", P.201, roster count 11, chip Chưa điểm danh; bottom tab bar Hôm nay · Lịch tuần · Lớp của tôi · Tài khoản; no sidebar. | ATT §4 /teach/today | Fixtures below | Not run |
| TS-ATT-002 | Open the sheet: all rostered students default to Có mặt | functional | P0 | P1 | As U-TEACH within 30 min before SES-TODAY start or after. |
| Header "Movers 2A · T3 dd/MM · 18:00–19:30 · P.201" and counters "Có mặt 11 · Muộn 0 · Vắng 0 · Có phép 0"; every student row shows the four-segment control with Có mặt selected; S1 row shows "Cần lưu ý: dị ứng đậu phộng"; S6 row shows "Số dư: 2 buổi" flag; save button sticky at bottom. | ATT-01 | Fixtures below | Not run |
| TS-ATT-003 | Sheet cannot be opened more than 30 min before start | negative | P2 | P1 | As U-TEACH, 2 hours before a session. |
| Message "Mở phiếu từ 30 phút trước giờ học" and no editable controls (read-only roster allowed). | 04 §10 pre-mark from 30 min before | Fixtures below | Not run |
| TS-ATT-004 | Mark exceptions and save in one request | functional | P0 | P1 | Sheet open. |
| Exactly one PUT /v3/school/sessions/{id}/attendance with records[] (12 entries incl. trial if any), note, notify_guardians true; counters read "Có mặt 9 · Muộn 1 · Vắng 1 · Có phép 0" before save (11 enrolled); after save a summary sheet lists notification delivery per guardian and a "Sửa" button. | ATT-01 | Fixtures below | Not run |
| TS-ATT-005 | Late minutes presets and range | functional | P1 | P1 | Sheet open. |
| Presets 5/10/15/30; 0 and 121 rejected ("1–120"); 45 accepted and still Muộn (not converted to Vắng). | 04 §5 late 1–120, threshold | Fixtures below | Not run |
| TS-ATT-006 | Tap targets are 44 px | ui-ux | P1 | P1 | Sheet on 390 px. |
| Each segment ≥ 44 px tall; save button ≥ 44 px; rows do not wrap awkwardly for a 20-character name. | 04 §4 rows 44 px, 12 §9 | Fixtures below | Not run |
| TS-ATT-007 | Save with all present is valid | functional | P1 | P1 | Sheet open, no changes. |
| Saved; sheet counts present 11; today list chip "Đã điểm danh 11/11". | 04 §5 rule 2 | Fixtures below | Not run |
| TS-ATT-008 | Offline save is queued and synced | functional | P0 | P1 | Sheet open; devtools network offline. |
| Banner "Chưa đồng bộ" appears after the offline save; the today list marks the session as pending; on reconnect the PUT is sent automatically, banner disappears, summary shows delivery statuses. | ATT-01 offline | Fixtures below | Not run |
| TS-ATT-009 | Offline queue with two saves: last wins by client_saved_at | edge | P1 | P1 | Offline. |
| Final server record for S6 is Có phép; no duplicate sheets; idempotent by (session_id, client_saved_at). | 04 §10 offline queue, 04 §7 idempotent | Fixtures below | Not run |
| TS-ATT-010 | Version conflict between main and substitute | edge | P0 | P1 | T2 assigned as substitute of SES-TODAY; both open the sheet. |
| T1 receives 409 STALE_VERSION and the sheet shows "Buổi này đã được Nguyễn T2 điểm danh lúc HH:mm" with "Xem"; no overwrite. | 04 §10 two teachers, 04 §4 conflict state | Fixtures below | Not run |
| TS-ATT-011 | Loading skeleton and empty roster state | ui-ux | P1 | P1 | Class C4 session with 0 enrolled. |
| Skeleton rows appear during load; then "Lớp chưa có học viên"; save button disabled. | 04 §4 states | Fixtures below | Not run |
| TS-ATT-012 | Edit within 24 h without reason (teacher) | functional | P1 | P1 | Sheet saved 1 hour ago by T1. |
| Saved without a reason prompt; record history shows from absent to present by T1. | 04 §5 rule 4 | Fixtures below | Not run |
| TS-ATT-013 | Teacher edit after 24 h is blocked | negative | P0 | P1 | SES-PAST saved 7 days ago. |
| Controls read-only with note "Liên hệ giáo vụ để sửa"; PATCH /attendance/records/{id} returns 403. | 04 §5 rule 4 | Fixtures below | Not run |
| TS-ATT-014 | Teacher can mark only own sessions | security | P0 | P1 | As U-TEACH2 (no classes). |
| 404 page; API 404/403; not visible in /teach/today. | 04 §8 attendance.mark own sessions | Fixtures below | Not run |
| TS-ATT-015 | Substitute can mark | functional | P1 | P1 | T2 assigned as substitute of SES-TODAY. |
| Allowed; sheet marked_by = T2. | 04 §5 rule 4 main or substitute | Fixtures below | Not run |
| TS-ATT-016 | Sheet in en locale | i18n | P2 | P1 | en locale. |
| Segments Present / Late / Absent / Excused; counters and buttons translated; date format dd/MM/yyyy retained. | 12 §8 | Fixtures below | Not run |
| TS-ATT-017 | Sheet on 1440 desktop route /attendance/sessions/:id | functional | P1 | P1 | As U-ACAD-A. |
| Same sheet in the desktop shell with the sidebar; identical behaviour; header counters live. | 04 §4 desktop | Fixtures below | Not run |
| TS-ATT-018 | Add an excuse in advance pre-marks Có phép | functional | P0 | P1 | As U-ACAD-A on S1; next C1 session. |
| Excuse row saved; on the sheet S1 is preselected Có phép with an excuse icon; G1 receives a confirmation message (type per template) or push fallback; a make-up suggestion appears on S1 attendance tab. | ATT-02 | Fixtures below | Not run |
| TS-ATT-019 | Excuse by date range covers several sessions | functional | P1 | P1 | S1. |
| Both sessions pre-marked Có phép; the excuse table shows one row with the range. | ATT-02 date range | Fixtures below | Not run |
| TS-ATT-020 | Excuse form fields and validation | negative | P2 | P1 | Excuse form. |
| Errors shown; past sessions not selectable (or a warning for retroactive excuse requiring attendance.edit_any). | 04 §4 excuse form | Fixtures below | Not run |
| TS-ATT-021 | Parent excuse request flows to desk and is applied on accept | flow | P1 | P2 | G1 in the parent portal; U-ACAD-A. |
| Request appears in today plan and the Yêu cầu tab; on accept an excuse is created and the sheet pre-marks Có phép; G1 receives confirmation. | COM-08, ATT-02 | Fixtures below | Not run |
| TS-ATT-022 | Absent triggers ZNS within 2 minutes with the exact template | functional | P0 | P1 | ZALO stub; G1 consent; save sheet with S1 Vắng at 18:05. |
| Message to G1 channel Zalo ZNS type attendance_absent, body "Học viên Nguyễn An vắng buổi Movers 2A ngày dd/MM lúc 18:00. Vui lòng liên hệ Quận 1 <SĐT chi nhánh>."; status sent within 2 min; summary sheet shows the status per guardian. | ATT-03 | Fixtures below | Not run |
| TS-ATT-023 | Late notifies with minutes | functional | P1 | P1 | S1 Muộn 10. |
| Message type attendance_late containing "muộn 10 phút". | 04 §2 late notifies yes with minutes | Fixtures below | Not run |
| TS-ATT-024 | Present does not notify by default; tenant setting enables it | functional | P1 | P1 | Default policy. |
| First: no attendance_present messages. Second: attendance_present messages sent. | 04 §2 present optional default off | Fixtures below | Not run |
| TS-ATT-025 | Excused does not notify | functional | P1 | P1 | S1 Có phép. |
| No attendance message for S1 (only the earlier excuse confirmation). | 04 §2 excused no | Fixtures below | Not run |
| TS-ATT-026 | Guardian without consent: skipped with reason and fallback | functional | P0 | P1 | S6 absent; G2 has no Zalo consent but has email. |
| Log shows ZNS skipped "Chưa có kênh liên lạc" (or "Chưa đồng ý Zalo"), then in-app attempt (skipped, no app) then email sent to nam@test.vn; the desk follow-up list shows S6 with the reason. | ATT-03 fallback, 04 §10 guardian without consent | Fixtures below | Not run |
| TS-ATT-027 | Zalo failure falls back to in-app then email | functional | P1 | P1 | Stub set to fail ZNS. |
| Log: ZNS failed (3 attempts over 15 min in the stub timeline or immediately in test mode), then push, then email; final status visible on the session sheet. | ATT-03, COM-02 retries | Fixtures below | Not run |
| TS-ATT-028 | Quiet hours hold non-urgent, evening absence sends immediately | edge | P1 | P1 | Clock stub at 21:45. |
| Late message status queued until 07:00; absent message sent immediately. | 04 §5 rule 6 | Fixtures below | Not run |
| TS-ATT-029 | Notification toggle off skips all messages | functional | P1 | P1 | Sheet. |
| No messages created; log shows skipped "Giáo viên tắt thông báo" or none; the summary states "Không gửi thông báo". | 04 §4 notify toggle | Fixtures below | Not run |
| TS-ATT-030 | Per-student notes are never sent to guardians | security | P1 | P1 | Sheet with a per-student note "Quậy" on S1. |
| Message body contains no note text; the note is visible only to staff on the record. | 04 §10 notes staff-visible only | Fixtures below | Not run |
| TS-ATT-031 | Admin correction after the session day requires reason and writes audit | functional | P0 | P1 | SES-PAST; as U-ACAD-A. |
| PATCH with reason; attendance_record_history row from absent to present with actor and reason; audit log entry attendance.edit; S6 package balance recalculated (absent consumed under default policy → now present, still consumed; no change) and the optional "correction" message prompt appears. | ATT-04 | Fixtures below | Not run |
| TS-ATT-032 | Correction reason is mandatory after the edit window | negative | P1 | P1 | SES-PAST. |
| HTTP 400 "reason required"; UI blocks save with an inline error. | 04 §7 reason required after window | Fixtures below | Not run |
| TS-ATT-033 | Correction excused → present recalculates package | functional | P1 | P1 | S1 marked Có phép on SES-PAST (not consumed). |
| One session consumed; S1 balance 5 → 4; session_consumption row created. | 04 §5 package consumption | Fixtures below | Not run |
| TS-ATT-034 | Correction present → excused reverses consumption | functional | P1 | P1 | S1 present on SES-PAST (consumed). |
| Consumption reversed (reversed_at set); balance 4 → 5. | 05 §7 session_consumption reversed_at | Fixtures below | Not run |
| TS-ATT-035 | Unmarked tab lists sessions ended > 2 h | functional | P0 | P1 | SES-YEST unmarked; as U-ACAD-A. |
| SES-YEST listed under T1 with actions Nhắc GV and Điểm danh thay; a session that ended 1 hour ago is not listed. | ATT-05 | Fixtures below | Not run |
| TS-ATT-036 | Nhắc GV sends in-app push | functional | P1 | P1 | Tab Chưa điểm danh. |
| POST remind-teacher; T1 sees a bell notification "Chưa điểm danh: Movers 2A hôm qua"; button shows "Đã nhắc HH:mm". | ATT-05 | Fixtures below | Not run |
| TS-ATT-037 | Điểm danh thay opens the sheet for the admin | functional | P1 | P1 | Tab Chưa điểm danh. |
| Sheet marked_by U-ACAD-A; session leaves the unmarked list. | ATT-05 | Fixtures below | Not run |
| TS-ATT-038 | 21:00 teacher reminder and 24 h manager digest | functional | P2 | P1 | Clock stub. |
| T1 receives a reminder at 21:00; U-BM-A receives a digest listing sessions unmarked > 24 h. | ATT-05 | Fixtures below | Not run |
| TS-ATT-039 | Attendance overview Hôm nay table | functional | P1 | P1 | As U-ACAD-A. |
| Columns time, class, room, teacher, roster, marked, present/late/absent/excused counts, notifications sent; action Mở phiếu; filters branch, teacher, class; tabs Hôm nay · Chưa điểm danh · Theo lớp · Theo học viên · Báo cáo. | 04 §4 overview | Fixtures below | Not run |
| TS-ATT-040 | Two consecutive absences create a follow-up task | functional | P0 | P1 | S6 absent on the previous C1 session; thresholds default. |
| Task "Liên hệ phụ huynh: Phan Giang vắng 2 buổi" created for the branch care owner; appears in the today plan; /students tab "Cần quan tâm" includes S6. | ATT-06 | Fixtures below | Not run |
| TS-ATT-041 | Three absences in 30 days trigger the monthly rule | functional | P1 | P1 | S7 absent twice non-consecutively in the last 30 days. |
| Task created with trigger monthly; not duplicated if a task is already open for S7. | ATT-06 | Fixtures below | Not run |
| TS-ATT-042 | Trial and make-up rows at the bottom under Khách | functional | P0 | P1 | SES-TODAY with a trial (L1 prospect) and a make-up (S2). |
| Section "Khách" after the enrolled list; trial row with chip Học thử and only [Có mặt][Vắng]; make-up row with chip Học bù; each with a note field. | ATT-07 | Fixtures below | Not run |
| TS-ATT-043 | Marking a trial present prompts the 3-option note | functional | P1 | P1 | Trial row. |
| Prompt with exactly Phù hợp / Cần lớp thấp hơn / Cần lớp cao hơn; choice stored as teacher_note and sent to the consultant. | ATT-07 | Fixtures below | Not run |
| TS-ATT-044 | Make-up attendance respects consumes_package flag | functional | P1 | P1 | Make-up booking with consumes_package false. |
| Booking status attended; no session consumed; with flag true one session consumed. | ATT-07, CLS-08 | Fixtures below | Not run |
| TS-ATT-045 | Attendance report by class | functional | P1 | P1 | As U-BM-A, date range last 30 days. |
| Rows per class with marked, present, late, absent, excused, rate = (present+late)/(present+late+absent); late-minutes distribution chart; absences by reason; unmarked sessions by teacher; export xlsx button. | ATT-08 | Fixtures below | Not run |
| TS-ATT-046 | Attendance rate formula check | functional | P0 | P1 | C1 SES-PAST: 10 present, 1 late, 1 absent. |
| Rate 11/12 = 91.7% (displayed "91,7%" in vi, "91.7%" in en). | 04 §5 rule 7 | Fixtures below | Not run |
| TS-ATT-047 | Student list sortable by absences | functional | P2 | P1 | Report tab Theo học viên. |
| S6/S7 on top; counts match their records. | ATT-08 | Fixtures below | Not run |
| TS-ATT-048 | Report export xlsx | functional | P1 | P1 | Report. |
| File downloads (format=xlsx); rows equal the on-screen rows; totals row present. | ATT-08, attendance.export | Fixtures below | Not run |
| TS-ATT-049 | Teacher report scope own classes | security | P1 | P1 | As U-TEACH. |
| Only C1 and C3 appear; branch filter limited. | 04 §8 attendance.report own classes | Fixtures below | Not run |
| TS-ATT-050 | Absent consumes per tenant setting | functional | P0 | P1 | S1 balance 5; policy absent_consumes on. |
| First: balance 4. Second: balance unchanged. | 04 §5 rule 5, FIN-07 | Fixtures below | Not run |
| TS-ATT-051 | Delete sheet requires attendance.delete_sheet and is audited | security | P1 | P1 | SES-PAST. |
| U-ACAD-A: 403 and no UI action. U-BM-A: confirmation dialog, sheet deleted, consumptions reversed, audit entry attendance.delete_sheet. | 04 §8 | Fixtures below | Not run |
| TS-ATT-052 | Attendance policy editable by owner only | security | P1 | P1 | /settings/attendance. |
| U-BM-A read-only or hidden; owner change persisted in school-config attendance_policy block. | 04 §8 attendance.policy | Fixtures below | Not run |
| TS-ATT-053 | Students enrolled after the date are not retro-added | edge | P1 | P1 | Enroll S3 into C1 today. |
| S3 absent from that sheet; present on SES-TODAY. | 04 §5 rule 1 | Fixtures below | Not run |
| TS-ATT-054 | Save performance for a 30-student roster | perf | P2 | P1 | Class with 30 students. |
| p95 ≤ 300 ms in the stub; UI optimistic (summary appears immediately, reverts on failure with a retry). | 12 §2 attendance | Fixtures below | Not run |
| TS-ATT-055 | Chips carry text and icon, never colour alone | a11y | P1 | P1 | Sheet and reports. |
| Every status chip has visible text (Có mặt / Muộn / Vắng / Có phép) and an icon; distinguishable in grayscale. | 04 §2 colours, 12 §9 | Fixtures below | Not run |
| TS-ATT-056 | Colour tokens for status chips | ui-ux | P2 | P1 | Sheet. |
| ok #16A34A on #DCFCE7; late #D97706 on #FEF3C7; abs #DC2626 on #FEE2E2; exc #2563EB on #DBEAFE. | 04 §2 | Fixtures below | Not run |
| TS-ATT-057 | Parent sees own child attendance only | security | P1 | P2 | G1 portal. |
| S1 ok; S7 404. | 04 §8 parent own children | Fixtures below | Not run |
Trường Số (truongso.net) · FLYER internal