Training Enrollment - Prototype Test
Manual test cases for the Training Enrollment workflow.
Workflow Overview
fill-in-training-list → review-by-safety-officer → completed/rejected/cancelled
Backend Entry Point
| Component | File |
|---|---|
| Router | SafetyApp.Workflows/WorkflowService.cs |
| Handler | SafetyApp.Workflows/SimpleWorkflowService.cs |
| Definition | SafetyApp.WebApi/assets/data/simple-workflows/training-enrollment.json |
Flow: Task created → WorkflowService.ExecuteAsync() → routes by TaskTypeId → SimpleWorkflowService.ExecuteAsync() → initializes state from JSON definition
Test Case 1: Happy Path (Approve)
Objective: Verify the complete workflow from creation to approval.
Phase 1: Create Task (Contractor)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as contractor1 | Login successful |
| 2 | Click "+" button in toolbar | Task type dialog opens |
| 3 | Select "ส่งรายชื่อผู้อบรม" (Training Enrollment) | Task created, opens in review page |
| 4 | Verify initial state | State: fill-in-training-list, form editable |
| 5 | Verify toolbar buttons | Shows "ส่งรายชื่อผู้อบรม" and "ยกเลิก" |
Phase 2: Fill Training List (Contractor)
| Step | Action | Expected Result |
|---|---|---|
| 6 | Fill training enrollment form | Fields accept input |
| 7 | Add trainees to the list | Trainees added |
| 8 | Click "ส่งรายชื่อผู้อบรม" (Submit) | State changes to review-by-safety-officer |
| 9 | Verify form | Form becomes read-only (locked) |
Phase 3: Review and Approve (Safety Officer)
| Step | Action | Expected Result |
|---|---|---|
| 10 | Logout, login as safety | Login successful |
| 11 | Open task from "My Tasks" | Task opens |
| 12 | Verify toolbar options | Shows: "อนุมัติรายชื่อ", "ส่งกลับแก้ไข", "ปฏิเสธรายชื่อ" |
| 13 | Click "อนุมัติรายชื่อ" (Approve) | State changes to completed |
| 14 | Verify final state | Task is read-only, state shows "เสร็จสิ้น" |
Test Case 2: Request Change (Send Back)
Objective: Verify Safety Officer can send task back for revision.
| Step | Action | Expected Result |
|---|---|---|
| 1-9 | Complete phases 1-2 (reach review-by-safety-officer) | At review state |
| 10 | Login as safety | Login successful |
| 11 | Click "ส่งกลับแก้ไข" (Request Change) | Comment dialog opens |
| 12 | Enter comment and confirm | State returns to fill-in-training-list |
| 13 | Verify stepper | "กรอกรายชื่อผู้อบรม" step shows (2) badge |
| 14 | Login as contractor1 | Login successful |
| 15 | Make corrections, click "ส่งรายชื่อผู้อบรม" | State changes to review-by-safety-officer |
| 16 | Verify stepper | "จป. ตรวจสอบ" step shows (2) badge |
Test Case 3: Reject
Objective: Verify Safety Officer can reject the training list.
| Step | Action | Expected Result |
|---|---|---|
| 1-9 | Complete phases 1-2 (reach review-by-safety-officer) | At review state |
| 10 | Login as safety | Login successful |
| 11 | Click "ปฏิเสธรายชื่อ" (Reject) | Comment dialog opens |
| 12 | Enter reason and confirm | State changes to rejected |
| 13 | Verify final state | Task is read-only, state shows "ปฏิเสธ" |
Test Case 4: Cancel
Objective: Verify task can be cancelled from initial state.
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as contractor1 | Login successful |
| 2 | Create new Training Enrollment task | Task created |
| 3 | Click "ยกเลิก" (Cancel) | Confirmation dialog appears |
| 4 | Confirm cancellation | State changes to cancelled |
| 5 | Verify final state | Task is read-only |
UI Verification Checklist
| Component | Check | Expected |
|---|---|---|
| Workflow Tab | Title | Shows "ส่งรายชื่อผู้อบรม" |
| Workflow Tab | Stepper | Shows correct states |
| Workflow Tab | Visit Count | Shows "(N)" badge when state visited N > 1 times |
| Toolbar | State Label | Shows correct Thai text per state |
| Toolbar | Commands | Correct buttons per state |
| Form | Permissions | Correct lock/unlock per state |
State-Command Reference
| State | Thai Label | Commands Available |
|---|---|---|
fill-in-training-list | กรอกรายชื่อผู้อบรม | ส่งรายชื่อผู้อบรม, ยกเลิก |
review-by-safety-officer | จป. ตรวจสอบ | อนุมัติรายชื่อ, ส่งกลับแก้ไข, ปฏิเสธรายชื่อ |
completed | เสร็จสิ้น | (none - terminal) |
rejected | ปฏิเสธ | (none - terminal) |
cancelled | ยกเลิก | (none - terminal) |
Sign-off
| Role | Name | Date | Signature |
|---|---|---|---|
| Tester | |||
| Developer |