Standard Workflow Path
Revision 1.1 (2026-01-15) - Added form validation test cases (TC-PR-041 to TC-PR-047)
This document contains test cases for the standard Project Registration workflow path:
Work Owner → Purchasing → Work Owner Review → Contractor → Final Review → Approval
Test Cases: TC-PR-001 to TC-PR-031, TC-PR-041 to TC-PR-047
1. Task Creation Tests
TC-PR-001: Work Owner creates project registration task
Precondition: Logged in as Work Owner, project exists with PR.No
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to Tasks menu | Task menu opens |
| 2 | Click "สร้างงานใหม่" | Create task dialog opens |
| 3 | Select "การลงทะเบียนโครงการ" | Task type selected |
| 4 | Search for project by PR.No | Project found and displayed |
| 5 | Select project | Project linked |
| 6 | Click "สร้าง" | Task created |
| 7 | Verify task appears in list | Task visible with "กรอกข้อมูลโครงการ" status |
Result: ☐ Pass ☐ Fail
TC-PR-002: Verify task details after creation
Precondition: Task just created from TC-PR-001
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click on created task | Task review page opens |
| 2 | Verify workflow stepper | Shows "กรอกข้อมูลโครงการ" as current step |
| 3 | Verify form tab | ProjectRegistrationForm displayed |
| 4 | Verify command buttons | "ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible |
| 5 | Verify assignee | Current user is assignee |
| 6 | Verify required field labels | Red asterisks (*) on ชื่อโครงการ, พื้นที่ทำงาน, เจ้าของงาน, etc. |
| 7 | Verify validation state | If required fields empty, command buttons (except ยกเลิกงาน) are DISABLED |
Result: ☐ Pass ☐ Fail
TC-PR-003: Non-Work Owner cannot create task
Precondition: Logged in as Purchasing
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to Create Task | Create task dialog opens |
| 2 | Verify "การลงทะเบียนโครงการ" | Either not visible or disabled |
Result: ☐ Pass ☐ Fail
2. Work Owner - Fill Project Info Tests
TC-PR-005: Fill project registration form
Precondition: Task at FillInProjectInfo state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Form displayed |
| 2 | Verify form is editable | Fields can be modified |
| 3 | Fill required fields: | |
| - ชื่อโครงการ (Project Name) | Data entered | |
| - พื้นที่ทำงาน (Workspace Area) | Selected from dropdown | |
| - เจ้าของงาน (Work Owner) | Selected from dropdown | |
| - เจ้าหน้าที่ความปลอดภัย (Safety Officer) | Selected from dropdown | |
| - เจ้าของพื้นที่ (Workspace Owner) | Selected from dropdown | |
| 4 | Verify validation passes | Validation banner disappears, command buttons enabled |
| 5 | Verify auto-save | Form saves automatically |
| 6 | Verify save indicator | Shows "บันทึกแล้ว" status |
Note: Alternatively, use "จำลองข้อมูล" button (dev mode) to auto-fill required fields.
Result: ☐ Pass ☐ Fail
TC-PR-006: Send to Purchasing
Precondition: Project info filled, all required fields completed (validation passed)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Verify "ส่งไปจัดซื้อ" button enabled | Button is clickable (not grayed out) |
| 2 | Click "ส่งไปจัดซื้อ" | Assignee dialog opens |
| 3 | Select Purchasing user | User selected |
| 4 | Add note (optional) | Note entered |
| 5 | Click confirm | Command executed |
| 6 | Verify state change | Stepper shows "กรอกข้อมูลจัดซื้อ" |
| 7 | Verify assignee changed | Purchasing user is new assignee |
Note: If button is disabled, ensure all required fields are filled first (see TC-PR-005).
Result: ☐ Pass ☐ Fail
TC-PR-007: Cancel workflow from FillInProjectInfo
Precondition: Task at FillInProjectInfo state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "ยกเลิกงาน" | Confirmation dialog opens |
| 2 | Confirm cancel | Command executed |
| 3 | Verify state | Task shows "ยกเลิก" status |
| 4 | Verify task closed | No more commands available |
Result: ☐ Pass ☐ Fail
TC-PR-008: Verify form locked after sending
Precondition: Task sent to Purchasing (now at FillInPurchasingInfo)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task as Work Owner | Task opens |
| 2 | Verify form is read-only | Cannot edit fields |
| 3 | Verify no commands | No action buttons visible (not assignee) |
Result: ☐ Pass ☐ Fail
3. Purchasing - Fill PO Info Tests
TC-PR-009: Purchasing receives task
Precondition: Logged in as Purchasing, task at FillInPurchasingInfo
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to task list | Task visible |
| 2 | Verify "รอดำเนินการ" filter | Task shows as pending |
| 3 | Click on task | Task review page opens |
| 4 | Verify current assignee | Shows Purchasing user |
Result: ☐ Pass ☐ Fail
TC-PR-010: Fill purchasing information
Precondition: Task open as Purchasing assignee
| Step | Action | Expected Result |
|---|---|---|
| 1 | Verify required field labels | Red asterisks on เลขที่ใบขอซื้อ (PR. No.), บริษัทผู้รับเหมา, ผู้ประสานงานหลัก |
| 2 | Verify PR No. search disabled | Search dropdown NOT available (manual entry only) |
| 3 | Verify "ส่งกลับ" button state | Button DISABLED until required fields filled |
| 4 | Fill required fields: | |
| - เลขที่ใบขอซื้อ (PR No.) | Field populated | |
| - บริษัทผู้รับเหมา (Contractor) | Selected from dropdown | |
| - ผู้ประสานงานหลัก (Supervisor) | Selected from dropdown | |
| 5 | Enter PO.No | Field populated |
| 6 | Enter PO duration | Field populated |
| 7 | Verify validation passes | "ส่งกลับ" button becomes ENABLED |
| 8 | Verify auto-save | Form saves automatically |
Note: Alternatively, use "จำลองข้อมูล" button (dev mode) to auto-fill PR No. and accounting fields.
Result: ☐ Pass ☐ Fail
TC-PR-011: Submit back to Work Owner
Precondition: PO info filled, all Purchasing required fields completed (validation passed)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Verify "ส่งกลับ" button enabled | Button is clickable (not grayed out) |
| 2 | Click "ส่งกลับ" | Confirmation appears |
| 3 | Confirm submit | Command executed |
| 4 | Verify state change | Stepper shows "รีวิวข้อมูลจัดซื้อ" |
| 5 | Verify assignee | Work Owner is new assignee |
Note: If button is disabled, ensure all required fields are filled first (see TC-PR-010).
Result: ☐ Pass ☐ Fail
TC-PR-012: Work Owner cannot edit during Purchasing state
Precondition: Task at FillInPurchasingInfo state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Work Owner | Logged in |
| 2 | Open task | Task opens |
| 3 | Verify form read-only | Cannot edit |
| 4 | Verify no commands | Not the assignee |
Result: ☐ Pass ☐ Fail
4. Work Owner - Review Purchasing Tests
TC-PR-013: Review purchasing information
Precondition: Task at ReviewPurchasingInfo state, Work Owner assignee
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Task opens with form |
| 2 | Verify PO data displayed | Purchasing info visible |
| 3 | Verify form editable | Can modify if needed |
| 4 | Verify commands | "ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", "ยกเลิกงาน" visible |
Result: ☐ Pass ☐ Fail
TC-PR-014: Send back to Purchasing for revision
Precondition: At ReviewPurchasingInfo state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "ส่งไปจัดซื้อ" | Assignee dialog opens |
| 2 | Select Purchasing user | User selected |
| 3 | Add revision note | Note entered |
| 4 | Confirm | Command executed |
| 5 | Verify state | Back to "กรอกข้อมูลจัดซื้อ" |
Result: ☐ Pass ☐ Fail
TC-PR-015: Send to Contractor
Precondition: At ReviewPurchasingInfo state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "ส่งไปผู้รับเหมา" | Assignee dialog opens |
| 2 | Select Contractor user | User selected (supervisor) |
| 3 | Confirm | Command executed |
| 4 | Verify state | Shows "รับทราบระเบียบปฏิบัติงาน" |
| 5 | Verify assignee | Contractor is assignee |
Result: ☐ Pass ☐ Fail
TC-PR-016: Verify transaction log shows history
Precondition: Task has been through multiple states
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Task opens |
| 2 | Click "ประวัติ" tab | Transaction log displayed |
| 3 | Verify entries | All state transitions listed |
| 4 | Verify timestamps | Each entry has date/time |
| 5 | Verify assigners | Shows who performed each action |
Result: ☐ Pass ☐ Fail
5. Contractor - Acknowledge Procedures Tests
TC-PR-017: Contractor receives task
Precondition: Logged in as Contractor, task at FillInPreWorkProceduresForm
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to task list | Task visible |
| 2 | Click on task | Task review page opens |
| 3 | Verify form tabs | Both Doc 1 and Doc 2 visible |
| 4 | Verify Doc 1 locked | ProjectRegistrationForm read-only |
| 5 | Verify Doc 2 editable | PreWorkProceduresForm can be edited |
Result: ☐ Pass ☐ Fail
TC-PR-018: Fill pre-work procedures form
Precondition: Task open as Contractor
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to Doc 2 tab | PreWorkProceduresForm displayed |
| 2 | Verify form editable | Fields can be modified |
| 3 | Fill acknowledgement fields | Data entered |
| 4 | Verify auto-save | Form saves automatically |
Result: ☐ Pass ☐ Fail
TC-PR-019: Submit acknowledgement
Precondition: Pre-work procedures form filled
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "รับทราบระเบียบปฏิบัติงาน" | Confirmation appears |
| 2 | Confirm submit | Command executed |
| 3 | Verify state | Shows "รีวิวเอกสารระเบียบปฏิบัติงาน" |
| 4 | Verify assignee | Work Owner is assignee |
Result: ☐ Pass ☐ Fail
TC-PR-020: Contractor cannot see other commands
Precondition: Task at FillInPreWorkProceduresForm
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task as Contractor | Task opens |
| 2 | Verify only "รับทราบระเบียบปฏิบัติงาน" visible | No cancel or routing options |
Result: ☐ Pass ☐ Fail
6. Work Owner - Final Review & Approve Tests
TC-PR-021: Review pre-work procedures
Precondition: Task at ReviewPreWorkProceduresForm state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task as Work Owner | Task opens |
| 2 | Verify Doc 1 locked | Cannot edit |
| 3 | Verify Doc 2 editable | Can make final edits |
| 4 | Verify commands | "อนุมัติ", "ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", "ยกเลิกงาน" |
Result: ☐ Pass ☐ Fail
TC-PR-022: Approve project registration
Precondition: At ReviewPreWorkProceduresForm state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "อนุมัติ" | Confirmation dialog opens |
| 2 | Confirm approval | Command executed |
| 3 | Verify state | Shows "อนุมัติ" then "เสร็จสิ้น" |
| 4 | Verify project status | Project status = Started (1) |
| 5 | Verify task closed | No more commands available |
Result: ☐ Pass ☐ Fail
TC-PR-023: Send back to Contractor for revision
Precondition: At ReviewPreWorkProceduresForm state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "ส่งไปผู้รับเหมา" | Assignee dialog opens |
| 2 | Select Contractor | User selected |
| 3 | Add revision note | Note entered |
| 4 | Confirm | Command executed |
| 5 | Verify state | Back to "รับทราบระเบียบปฏิบัติงาน" |
Result: ☐ Pass ☐ Fail
TC-PR-024: Verify all forms locked after approval
Precondition: Task approved
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open approved task | Task opens |
| 2 | Verify Doc 1 read-only | Cannot edit |
| 3 | Verify Doc 2 read-only | Cannot edit |
| 4 | Verify stepper | Shows "อนุมัติ" as final state |
Result: ☐ Pass ☐ Fail
7. Workflow Cancel Tests
TC-PR-025: Cancel from ReviewPurchasingInfo
Precondition: Task at ReviewPurchasingInfo state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "ยกเลิกงาน" | Confirmation dialog |
| 2 | Confirm cancel | Command executed |
| 3 | Verify state | Shows "ยกเลิก" |
| 4 | Verify project status | Project status = Canceled (3) |
Result: ☐ Pass ☐ Fail
TC-PR-026: Cancel from ReviewPreWorkProceduresForm
Precondition: Task at ReviewPreWorkProceduresForm state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "ยกเลิกงาน" | Confirmation dialog |
| 2 | Confirm cancel | Command executed |
| 3 | Verify state | Shows "ยกเลิก" |
Result: ☐ Pass ☐ Fail
TC-PR-027: Contractor cannot cancel workflow
Precondition: Task at FillInPreWorkProceduresForm
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task as Contractor | Task opens |
| 2 | Verify no cancel button | "ยกเลิกงาน" not visible |
Result: ☐ Pass ☐ Fail
8. Task History & Notes Tests
TC-PR-028: View complete transaction log
Precondition: Task with multiple state transitions
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Task opens |
| 2 | Click "ประวัติ" tab | Transaction log displayed |
| 3 | Verify columns | เหตุการณ์, วันที่/เวลา, ดำเนินการโดย, ผู้รับผิดชอบ, หมายเหตุ |
| 4 | Verify summary | Total, Extensions, Approvals counts |
Result: ☐ Pass ☐ Fail
TC-PR-029: Create task note
Precondition: Task open, user is assignee
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "บันทึก" tab | Notes section displayed |
| 2 | Enter note text | Text entered |
| 3 | Click save | Note saved |
| 4 | Verify note displayed | Note visible with timestamp |
Result: ☐ Pass ☐ Fail
TC-PR-030: Edit task note
Precondition: Note exists on task
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click edit on existing note | Note becomes editable |
| 2 | Modify text | Text changed |
| 3 | Save changes | Note updated |
| 4 | Verify updated text | New text displayed |
Result: ☐ Pass ☐ Fail
TC-PR-031: Delete task note
Precondition: Note exists on task
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click delete on note | Confirmation dialog |
| 2 | Confirm delete | Note removed |
| 3 | Verify note gone | Note no longer visible |
Result: ☐ Pass ☐ Fail
9. Form Validation Tests
Added: Revision 1.1 (2026-01-15)
TC-PR-041: Validation banner visible when fields missing
Precondition: Task at FillInProjectInfo state, Work Owner logged in, required fields NOT filled
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task with missing required fields | Task opens |
| 2 | Verify validation banner | Red/yellow banner visible at top of form |
| 3 | Verify error list | Shows missing field names (ชื่อโครงการ, พื้นที่ทำงาน, etc.) |
| 4 | Verify tester note | Blue info block with note: "หมายเหตุ: ฟิลด์ที่จำเป็นเหล่านี้เป็นตัวอย่างเบื้องต้น สามารถปรับเปลี่ยนได้ตามการยืนยัน" |
Result: ☐ Pass ☐ Fail
TC-PR-042: Command buttons disabled when form invalid
Precondition: Task at FillInProjectInfo state, required fields NOT filled
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Task opens |
| 2 | Verify "ส่งไปจัดซื้อ" button | Button is DISABLED (grayed out) |
| 3 | Verify "ส่งไปผู้รับเหมา" button | Button is DISABLED (grayed out) |
| 4 | Verify "ยกเลิกงาน" button | Button is ENABLED (cancel not affected) |
Result: ☐ Pass ☐ Fail
TC-PR-043: Command buttons enabled after filling required fields
Precondition: TC-PR-042 completed
| Step | Action | Expected Result |
|---|---|---|
| 1 | Fill all required fields (or use Simulate Data button) | Data entered |
| 2 | Verify validation banner | Banner disappears |
| 3 | Verify "ส่งไปจัดซื้อ" button | Button is ENABLED |
| 4 | Verify "ส่งไปผู้รับเหมา" button | Button is ENABLED |
Result: ☐ Pass ☐ Fail
TC-PR-044: Red asterisks on required field labels (Work Owner)
Precondition: Task at FillInProjectInfo state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Form displayed |
| 2 | Verify "ชื่อโครงการ" label | Has red asterisk (*) |
| 3 | Verify "พื้นที่ทำงาน" label | Has red asterisk (*) |
| 4 | Verify "เจ้าของงาน" label | Has red asterisk (*) |
| 5 | Verify "เจ้าหน้าที่ความปลอดภัย" label | Has red asterisk (*) |
| 6 | Verify "เจ้าของพื้นที่" label | Has red asterisk (*) |
| 7 | Verify "เลขที่ใบขอซื้อ (PR. No.)" label | NO asterisk (not required for WO role) |
Result: ☐ Pass ☐ Fail
TC-PR-045: Purchasing-specific validation rules
Precondition: Task at FillInPurchasingInfo state, Purchasing logged in
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Form displayed |
| 2 | Verify "เลขที่ใบขอซื้อ (PR. No.)" label | Has red asterisk (*) |
| 3 | Verify "บริษัทผู้รับเหมา" label | Has red asterisk (*) |
| 4 | Verify "ผู้ประสานงานหลัก" label | Has red asterisk (*) |
| 5 | Leave PR No. empty | "ส่งกลับ" button disabled |
| 6 | Verify validation banner | Shows PR No., Contractor, Supervisor in error list |
| 7 | Verify PR No. search | Search dropdown DISABLED for Purchasing (manual entry only) |
Result: ☐ Pass ☐ Fail
TC-PR-046: Cancel button NOT disabled when form invalid
Precondition: Task at any state with "ยกเลิกงาน" command visible
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task with missing required fields | Task opens |
| 2 | Verify "ยกเลิกงาน" button | Button is ENABLED |
| 3 | Click "ยกเลิกงาน" | Confirmation dialog opens |
Result: ☐ Pass ☐ Fail
TC-PR-047: Simulate Data button (Dev Mode Only)
Precondition: Dev mode enabled, task at editable state
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task as Work Owner | Task opens |
| 2 | Verify purple "จำลองข้อมูล" button visible | Button with auto_fix_high icon visible |
| 3 | Click "จำลองข้อมูล" button | Required fields are filled |
| 4 | Verify WO fields filled | ชื่อโครงการ, รายละเอียด filled |
| 5 | Verify validation passes | Validation banner disappears, buttons enabled |
| 6 | Open task as Purchasing | Task opens |
| 7 | Click "จำลองข้อมูล" button | Accounting fields filled |
| 8 | Verify Purchasing fields filled | เลขที่ใบขอซื้อ, เลขที่ใบสั่งซื้อ, ระยะเวลา, วันที่ filled |
Result: ☐ Pass ☐ Fail
Test Execution Sign-off
| Role | Name | Date | Signature |
|---|---|---|---|
| Tester | |||
| Reviewer |
Notes
[Add any notes or observations during testing]