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
Cases
57
P0 / P1
16 / 34
Regression pack
18
PRD
04 Attendance
Phase
P1

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.json and runs/run-1/, and every result field is still not_run.
  • Cases inherit any open question or inconsistency in the PRDs they trace to.

1Summary

P0
16
P1
34
P2
7
P3
0
Typefunctionalui-uxedgenegativeregressionflowa11yperfsecurityi18n
Count36344011161

2Test cases

IDTitleTypePriorityPhasePreconditionsStepsExpected resultPRD traceData neededRun 1
TS-ATT-001Teacher today list on mobilefunctionalP0P1As U-TEACH at 390 px; SES-TODAY planned; SES-YEST unmarked.
  1. Open /teach/today.
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/todayFixtures belowNot run
TS-ATT-002Open the sheet: all rostered students default to Có mặtfunctionalP0P1As U-TEACH within 30 min before SES-TODAY start or after.
  1. Tap SES-TODAY.
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-01Fixtures belowNot run
TS-ATT-003Sheet cannot be opened more than 30 min before startnegativeP2P1As U-TEACH, 2 hours before a session.
  1. Tap the 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 beforeFixtures belowNot run
TS-ATT-004Mark exceptions and save in one requestfunctionalP0P1Sheet open.
  1. Tap Muộn on S1 → choose preset 10.
  2. Tap Vắng on S6.
  3. Type class note "Ôn unit 3".
  4. Tap Lưu điểm danh with Gửi thông báo PH ticked.
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-01Fixtures belowNot run
TS-ATT-005Late minutes presets and rangefunctionalP1P1Sheet open.
  1. Tap Muộn on a student; observe presets; enter 0; enter 121; enter 45.
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, thresholdFixtures belowNot run
TS-ATT-006Tap targets are 44 pxui-uxP1P1Sheet on 390 px.
  1. Measure the segmented control height and the save button.
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 §9Fixtures belowNot run
TS-ATT-007Save with all present is validfunctionalP1P1Sheet open, no changes.
  1. Tap Lưu điểm danh.
Saved; sheet counts present 11; today list chip "Đã điểm danh 11/11".04 §5 rule 2Fixtures belowNot run
TS-ATT-008Offline save is queued and syncedfunctionalP0P1Sheet open; devtools network offline.
  1. Mark S6 Vắng and save while offline.
  2. Go online.
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 offlineFixtures belowNot run
TS-ATT-009Offline queue with two saves: last wins by client_saved_atedgeP1P1Offline.
  1. Save with S6 Vắng; then save again with S6 Có phép; go online.
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 idempotentFixtures belowNot run
TS-ATT-010Version conflict between main and substituteedgeP0P1T2 assigned as substitute of SES-TODAY; both open the sheet.
  1. T2 saves.
  2. T1 saves with the stale version.
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 stateFixtures belowNot run
TS-ATT-011Loading skeleton and empty roster stateui-uxP1P1Class C4 session with 0 enrolled.
  1. Open its sheet on a throttled network.
Skeleton rows appear during load; then "Lớp chưa có học viên"; save button disabled.04 §4 statesFixtures belowNot run
TS-ATT-012Edit within 24 h without reason (teacher)functionalP1P1Sheet saved 1 hour ago by T1.
  1. As T1 tap Sửa, change S6 to Có mặt, save.
Saved without a reason prompt; record history shows from absent to present by T1.04 §5 rule 4Fixtures belowNot run
TS-ATT-013Teacher edit after 24 h is blockednegativeP0P1SES-PAST saved 7 days ago.
  1. As T1 open the sheet and try to change S6.
Controls read-only with note "Liên hệ giáo vụ để sửa"; PATCH /attendance/records/{id} returns 403.04 §5 rule 4Fixtures belowNot run
TS-ATT-014Teacher can mark only own sessionssecurityP0P1As U-TEACH2 (no classes).
  1. Open /teach/sessions/<SES-TODAY>/attendance directly.
  2. Call PUT on it.
404 page; API 404/403; not visible in /teach/today.04 §8 attendance.mark own sessionsFixtures belowNot run
TS-ATT-015Substitute can markfunctionalP1P1T2 assigned as substitute of SES-TODAY.
  1. As U-TEACH2 open and save the sheet.
Allowed; sheet marked_by = T2.04 §5 rule 4 main or substituteFixtures belowNot run
TS-ATT-016Sheet in en localei18nP2P1en locale.
  1. Open the sheet.
Segments Present / Late / Absent / Excused; counters and buttons translated; date format dd/MM/yyyy retained.12 §8Fixtures belowNot run
TS-ATT-017Sheet on 1440 desktop route /attendance/sessions/:idfunctionalP1P1As U-ACAD-A.
  1. Open /attendance/sessions/<SES-TODAY>.
Same sheet in the desktop shell with the sidebar; identical behaviour; header counters live.04 §4 desktopFixtures belowNot run
TS-ATT-018Add an excuse in advance pre-marks Có phépfunctionalP0P1As U-ACAD-A on S1; next C1 session.
  1. Tab Điểm danh → + Thêm phép: session next C1, reason Ốm, reported by "Trần Thị Hoa", channel Zalo, offer make-up on.
  2. As U-TEACH open that session sheet.
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-02Fixtures belowNot run
TS-ATT-019Excuse by date range covers several sessionsfunctionalP1P1S1.
  1. Add excuse date range covering two C1 sessions.
Both sessions pre-marked Có phép; the excuse table shows one row with the range.ATT-02 date rangeFixtures belowNot run
TS-ATT-020Excuse form fields and validationnegativeP2P1Excuse form.
  1. Submit without reason; choose Khác without text; pick a past session.
Errors shown; past sessions not selectable (or a warning for retroactive excuse requiring attendance.edit_any).04 §4 excuse formFixtures belowNot run
TS-ATT-021Parent excuse request flows to desk and is applied on acceptflowP1P2G1 in the parent portal; U-ACAD-A.
  1. G1 submits Xin phép nghỉ for the next C1 session, reason Ốm.
  2. As U-ACAD-A open Điểm danh → Yêu cầu and accept.
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-02Fixtures belowNot run
TS-ATT-022Absent triggers ZNS within 2 minutes with the exact templatefunctionalP0P1ZALO stub; G1 consent; save sheet with S1 Vắng at 18:05.
  1. Save.
  2. Open the summary and the message log.
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-03Fixtures belowNot run
TS-ATT-023Late notifies with minutesfunctionalP1P1S1 Muộn 10.
  1. Save.
Message type attendance_late containing "muộn 10 phút".04 §2 late notifies yes with minutesFixtures belowNot run
TS-ATT-024Present does not notify by default; tenant setting enables itfunctionalP1P1Default policy.
  1. Save all present; check the log.
  2. Enable notify present in /settings/attendance; save another session.
First: no attendance_present messages. Second: attendance_present messages sent.04 §2 present optional default offFixtures belowNot run
TS-ATT-025Excused does not notifyfunctionalP1P1S1 Có phép.
  1. Save.
No attendance message for S1 (only the earlier excuse confirmation).04 §2 excused noFixtures belowNot run
TS-ATT-026Guardian without consent: skipped with reason and fallbackfunctionalP0P1S6 absent; G2 has no Zalo consent but has email.
  1. Save.
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 consentFixtures belowNot run
TS-ATT-027Zalo failure falls back to in-app then emailfunctionalP1P1Stub set to fail ZNS.
  1. Save with S1 absent.
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 retriesFixtures belowNot run
TS-ATT-028Quiet hours hold non-urgent, evening absence sends immediatelyedgeP1P1Clock stub at 21:45.
  1. Save a sheet with S1 Muộn (non-urgent) and S6 Vắng.
Late message status queued until 07:00; absent message sent immediately.04 §5 rule 6Fixtures belowNot run
TS-ATT-029Notification toggle off skips all messagesfunctionalP1P1Sheet.
  1. Untick Gửi thông báo PH and save with an absence.
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 toggleFixtures belowNot run
TS-ATT-030Per-student notes are never sent to guardianssecurityP1P1Sheet with a per-student note "Quậy" on S1.
  1. Save with S1 absent.
Message body contains no note text; the note is visible only to staff on the record.04 §10 notes staff-visible onlyFixtures belowNot run
TS-ATT-031Admin correction after the session day requires reason and writes auditfunctionalP0P1SES-PAST; as U-ACAD-A.
  1. Open the sheet; change S6 from Vắng to Có mặt; enter reason "GV nhầm"; save.
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-04Fixtures belowNot run
TS-ATT-032Correction reason is mandatory after the edit windownegativeP1P1SES-PAST.
  1. PATCH /attendance/records/{id} without reason.
HTTP 400 "reason required"; UI blocks save with an inline error.04 §7 reason required after windowFixtures belowNot run
TS-ATT-033Correction excused → present recalculates packagefunctionalP1P1S1 marked Có phép on SES-PAST (not consumed).
  1. Correct to Có mặt.
One session consumed; S1 balance 5 → 4; session_consumption row created.04 §5 package consumptionFixtures belowNot run
TS-ATT-034Correction present → excused reverses consumptionfunctionalP1P1S1 present on SES-PAST (consumed).
  1. Correct to Có phép.
Consumption reversed (reversed_at set); balance 4 → 5.05 §7 session_consumption reversed_atFixtures belowNot run
TS-ATT-035Unmarked tab lists sessions ended > 2 hfunctionalP0P1SES-YEST unmarked; as U-ACAD-A.
  1. Open /attendance tab Chưa điểm danh.
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-05Fixtures belowNot run
TS-ATT-036Nhắc GV sends in-app pushfunctionalP1P1Tab Chưa điểm danh.
  1. Click Nhắc GV on SES-YEST.
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-05Fixtures belowNot run
TS-ATT-037Điểm danh thay opens the sheet for the adminfunctionalP1P1Tab Chưa điểm danh.
  1. Click Điểm danh thay; save.
Sheet marked_by U-ACAD-A; session leaves the unmarked list.ATT-05Fixtures belowNot run
TS-ATT-03821:00 teacher reminder and 24 h manager digestfunctionalP2P1Clock stub.
  1. Advance to 21:00 with SES-TODAY unmarked.
  2. Advance 24 h.
T1 receives a reminder at 21:00; U-BM-A receives a digest listing sessions unmarked > 24 h.ATT-05Fixtures belowNot run
TS-ATT-039Attendance overview Hôm nay tablefunctionalP1P1As U-ACAD-A.
  1. Open /attendance tab Hôm nay.
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 overviewFixtures belowNot run
TS-ATT-040Two consecutive absences create a follow-up taskfunctionalP0P1S6 absent on the previous C1 session; thresholds default.
  1. Save SES-TODAY with S6 Vắng.
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-06Fixtures belowNot run
TS-ATT-041Three absences in 30 days trigger the monthly rulefunctionalP1P1S7 absent twice non-consecutively in the last 30 days.
  1. Save a third absence.
Task created with trigger monthly; not duplicated if a task is already open for S7.ATT-06Fixtures belowNot run
TS-ATT-042Trial and make-up rows at the bottom under KháchfunctionalP0P1SES-TODAY with a trial (L1 prospect) and a make-up (S2).
  1. Open the sheet.
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-07Fixtures belowNot run
TS-ATT-043Marking a trial present prompts the 3-option notefunctionalP1P1Trial row.
  1. Tap Có mặt on the trial; save.
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-07Fixtures belowNot run
TS-ATT-044Make-up attendance respects consumes_package flagfunctionalP1P1Make-up booking with consumes_package false.
  1. Mark the make-up student present; save.
Booking status attended; no session consumed; with flag true one session consumed.ATT-07, CLS-08Fixtures belowNot run
TS-ATT-045Attendance report by classfunctionalP1P1As U-BM-A, date range last 30 days.
  1. Open /attendance tab Báo cáo, group by class.
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-08Fixtures belowNot run
TS-ATT-046Attendance rate formula checkfunctionalP0P1C1 SES-PAST: 10 present, 1 late, 1 absent.
  1. Read the rate for C1 on that day in the report.
Rate 11/12 = 91.7% (displayed "91,7%" in vi, "91.7%" in en).04 §5 rule 7Fixtures belowNot run
TS-ATT-047Student list sortable by absencesfunctionalP2P1Report tab Theo học viên.
  1. Sort by absences desc.
S6/S7 on top; counts match their records.ATT-08Fixtures belowNot run
TS-ATT-048Report export xlsxfunctionalP1P1Report.
  1. Click Xuất Excel.
File downloads (format=xlsx); rows equal the on-screen rows; totals row present.ATT-08, attendance.exportFixtures belowNot run
TS-ATT-049Teacher report scope own classessecurityP1P1As U-TEACH.
  1. Open the report.
Only C1 and C3 appear; branch filter limited.04 §8 attendance.report own classesFixtures belowNot run
TS-ATT-050Absent consumes per tenant settingfunctionalP0P1S1 balance 5; policy absent_consumes on.
  1. Save S1 Vắng; check balance.
  2. Turn the setting off; save another absence.
First: balance 4. Second: balance unchanged.04 §5 rule 5, FIN-07Fixtures belowNot run
TS-ATT-051Delete sheet requires attendance.delete_sheet and is auditedsecurityP1P1SES-PAST.
  1. As U-ACAD-A call DELETE /sessions/{id}/attendance.
  2. As U-BM-A delete from the UI.
U-ACAD-A: 403 and no UI action. U-BM-A: confirmation dialog, sheet deleted, consumptions reversed, audit entry attendance.delete_sheet.04 §8Fixtures belowNot run
TS-ATT-052Attendance policy editable by owner onlysecurityP1P1/settings/attendance.
  1. As U-BM-A open the page.
  2. As U-OWNER change late_threshold to 30 and save.
U-BM-A read-only or hidden; owner change persisted in school-config attendance_policy block.04 §8 attendance.policyFixtures belowNot run
TS-ATT-053Students enrolled after the date are not retro-addededgeP1P1Enroll S3 into C1 today.
  1. Open SES-PAST sheet.
S3 absent from that sheet; present on SES-TODAY.04 §5 rule 1Fixtures belowNot run
TS-ATT-054Save performance for a 30-student rosterperfP2P1Class with 30 students.
  1. Save the sheet; measure the PUT.
p95 ≤ 300 ms in the stub; UI optimistic (summary appears immediately, reverts on failure with a retry).12 §2 attendanceFixtures belowNot run
TS-ATT-055Chips carry text and icon, never colour alonea11yP1P1Sheet and reports.
  1. Inspect chips; view in grayscale (devtools emulate).
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 §9Fixtures belowNot run
TS-ATT-056Colour tokens for status chipsui-uxP2P1Sheet.
  1. Inspect computed colours.
ok #16A34A on #DCFCE7; late #D97706 on #FEF3C7; abs #DC2626 on #FEE2E2; exc #2563EB on #DBEAFE.04 §2Fixtures belowNot run
TS-ATT-057Parent sees own child attendance onlysecurityP1P2G1 portal.
  1. GET /v3/parent/learner/{S1}/attendance and for S7.
S1 ok; S7 404.04 §8 parent own childrenFixtures belowNot run

Trường Số (truongso.net) · FLYER internal