Skip to main content

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

ComponentFile
RouterSafetyApp.Workflows/WorkflowService.cs
HandlerSafetyApp.Workflows/SimpleWorkflowService.cs
DefinitionSafetyApp.WebApi/assets/data/simple-workflows/training-enrollment.json

Flow: Task created → WorkflowService.ExecuteAsync() → routes by TaskTypeIdSimpleWorkflowService.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)

StepActionExpected Result
1Login as contractor1Login successful
2Click "+" button in toolbarTask type dialog opens
3Select "ส่งรายชื่อผู้อบรม" (Training Enrollment)Task created, opens in review page
4Verify initial stateState: fill-in-training-list, form editable
5Verify toolbar buttonsShows "ส่งรายชื่อผู้อบรม" and "ยกเลิก"

Phase 2: Fill Training List (Contractor)

StepActionExpected Result
6Fill training enrollment formFields accept input
7Add trainees to the listTrainees added
8Click "ส่งรายชื่อผู้อบรม" (Submit)State changes to review-by-safety-officer
9Verify formForm becomes read-only (locked)

Phase 3: Review and Approve (Safety Officer)

StepActionExpected Result
10Logout, login as safetyLogin successful
11Open task from "My Tasks"Task opens
12Verify toolbar optionsShows: "อนุมัติรายชื่อ", "ส่งกลับแก้ไข", "ปฏิเสธรายชื่อ"
13Click "อนุมัติรายชื่อ" (Approve)State changes to completed
14Verify final stateTask is read-only, state shows "เสร็จสิ้น"

Test Case 2: Request Change (Send Back)

Objective: Verify Safety Officer can send task back for revision.

StepActionExpected Result
1-9Complete phases 1-2 (reach review-by-safety-officer)At review state
10Login as safetyLogin successful
11Click "ส่งกลับแก้ไข" (Request Change)Comment dialog opens
12Enter comment and confirmState returns to fill-in-training-list
13Verify stepper"กรอกรายชื่อผู้อบรม" step shows (2) badge
14Login as contractor1Login successful
15Make corrections, click "ส่งรายชื่อผู้อบรม"State changes to review-by-safety-officer
16Verify stepper"จป. ตรวจสอบ" step shows (2) badge

Test Case 3: Reject

Objective: Verify Safety Officer can reject the training list.

StepActionExpected Result
1-9Complete phases 1-2 (reach review-by-safety-officer)At review state
10Login as safetyLogin successful
11Click "ปฏิเสธรายชื่อ" (Reject)Comment dialog opens
12Enter reason and confirmState changes to rejected
13Verify final stateTask is read-only, state shows "ปฏิเสธ"

Test Case 4: Cancel

Objective: Verify task can be cancelled from initial state.

StepActionExpected Result
1Login as contractor1Login successful
2Create new Training Enrollment taskTask created
3Click "ยกเลิก" (Cancel)Confirmation dialog appears
4Confirm cancellationState changes to cancelled
5Verify final stateTask is read-only

UI Verification Checklist

ComponentCheckExpected
Workflow TabTitleShows "ส่งรายชื่อผู้อบรม"
Workflow TabStepperShows correct states
Workflow TabVisit CountShows "(N)" badge when state visited N > 1 times
ToolbarState LabelShows correct Thai text per state
ToolbarCommandsCorrect buttons per state
FormPermissionsCorrect lock/unlock per state

State-Command Reference

StateThai LabelCommands Available
fill-in-training-listกรอกรายชื่อผู้อบรมส่งรายชื่อผู้อบรม, ยกเลิก
review-by-safety-officerจป. ตรวจสอบอนุมัติรายชื่อ, ส่งกลับแก้ไข, ปฏิเสธรายชื่อ
completedเสร็จสิ้น(none - terminal)
rejectedปฏิเสธ(none - terminal)
cancelledยกเลิก(none - terminal)

Sign-off

RoleNameDateSignature
Tester
Developer