Project Registration - Test Cases
Revision 1.1 (2026-01-15) - Added form validation test cases and role-based required fields
Overview
This section contains comprehensive manual test cases for the Project Registration Workflow feature. The tests cover all workflow paths including the standard path and the optional skip path.
Feature Documentation: Project Registration
Workflow Documentation: Project Registration Workflow
Test Summary
| Test Document | Description | Test Cases |
|---|---|---|
| Standard Workflow Path | Full workflow: Work Owner → Purchasing → Contractor → Approval | TC-PR-001 to TC-PR-003, TC-PR-005 to TC-PR-031, TC-PR-041 to TC-PR-047 |
| Optional Path - Skip Purchasing | Skip Purchasing when project has PO No. | TC-PR-032 to TC-PR-040 |
Total Test Cases: 46 (TC-PR-004 removed - Project Registration does not require project selection)
Prerequisites
Before running these tests, ensure:
- Backend server running on
http://localhost:5000 - Frontend running on
http://localhost:4200 - Test data available:
- At least one project exists with PR.No assigned
- At least one project with PO.No filled (for skip path tests)
- At least one contractor configured with coordinator/supervisor
Test Accounts
| Role | Password | Access Level | |
|---|---|---|---|
| Admin | tn@thaiscada.com | Test1234* | View all tasks |
| Purchasing | safety-purchasing@outlook.com | Test1234* | FillInPurchasingInfo state |
| Work Owner | safety-owner@outlook.com | Test1234* | Create, review, approve |
| Contractor | safety-contractor1-0@outlook.com | Test1234* | Acknowledge procedures |
Navigation Paths
Create Task
เครื่องมือ (Tools) → สร้างงานใหม่ (Create Task) → การลงทะเบียนโครงการ (Project Registration)
View Tasks
งาน (Tasks) → รายการงาน (Task List)
Review Task
Click on task row → Task review page opens
When opening a task, the UI auto-navigates to the default document for your role (e.g., WorkOwner sees ProjectRegistrationForm, Contractor sees PreWorkProceduresForm). Click the back arrow (←) to see the full document list.
Workflow States
| State Key | Thai Name | English Name | Expected Role |
|---|---|---|---|
fill-in-project-info | กรอกข้อมูลโครงการ | Fill in project information | Work Owner |
fill-in-purchasing-info | กรอกข้อมูลจัดซื้อ | Fill in purchasing information | Purchasing |
review-purchasing-info | รีวิวข้อมูลจัดซื้อ | Review purchasing information | Work Owner |
fill-in-pre-work-procedures-form | รับทราบระเบียบปฏิบัติงาน | Acknowledge work procedures | Contractor |
review-pre-work-procedures-form | รีวิวเอกสารระเบียบปฏิบัติงาน | Review work procedures docs | Work Owner |
approved | อนุมัติ | Approved | (terminal) |
canceled | ยกเลิก | Canceled | (terminal) |
Command Labels
| Command Key | Thai Label | Description |
|---|---|---|
approve | อนุมัติ | Approve project registration |
cancel | ยกเลิกงาน | Cancel workflow |
request-purchasing-info | ส่งไปจัดซื้อ | Send to Purchasing |
submit-purchasing-info | ส่งกลับ | Submit back to Work Owner |
request-pre-work-procedures-form | ส่งไปผู้รับเหมา | Send to Contractor |
submit-pre-work-procedures-form | รับทราบระเบียบปฏิบัติงาน | Submit acknowledgement |
Form Validation
Added: Revision 1.1 (2026-01-15)
Commands with validationRequired = true are DISABLED when form validation fails. Buttons appear grayed out until all required fields are filled.
Validation Behavior:
| Command | validationRequired | Behavior |
|---|---|---|
| ส่งไปจัดซื้อ | true | Disabled when form invalid |
| ส่งไปผู้รับเหมา | true | Disabled when form invalid |
| ส่งกลับ (Purchasing) | true | Disabled when form invalid |
| ยกเลิกงาน | false | Always enabled |
Required Fields by Role
Work Owner (FillInProjectInfo, ReviewPurchasingInfo, ReviewPreWorkProceduresForm):
| Field | Thai Label | Red Asterisk |
|---|---|---|
| Project Name | ชื่อโครงการ | ✅ |
| Workspace Area | พื้นที่ทำงาน | ✅ |
| Work Owner | เจ้าของงาน | ✅ |
| Safety Officer | เจ้าหน้าที่ความปลอดภัย | ✅ |
| Workspace Owner | เจ้าของพื้นที่ | ✅ |
Purchasing (FillInPurchasingInfo):
| Field | Thai Label | Red Asterisk |
|---|---|---|
| All WO fields | (as above) | ✅ |
| PR No. | เลขที่ใบขอซื้อ (PR. No.) | ✅ |
| Contractor | บริษัทผู้รับเหมา | ✅ |
| Contractor Supervisor | ผู้ประสานงานหลัก | ✅ |
Validation Warning Banner
When required fields are missing, a validation warning banner appears:
- Red/yellow banner at top of form
- Error list shows missing field names
- Blue info note (tester note): "หมายเหตุ: ฟิลด์ที่จำเป็นเหล่านี้เป็นตัวอย่างเบื้องต้น สามารถปรับเปลี่ยนได้ตามการยืนยัน"
Simulate Data Button (Dev Mode Only)
A purple "จำลองข้อมูล" button appears in dev mode to fill required fields:
- Icon:
auto_fix_high - Work Owner: Fills Project Name + Description
- Purchasing: Fills PR No., PO No., Duration, Start/End Dates
PR No. Behavior for Purchasing
- PR No. search dropdown is DISABLED for Purchasing role
- Purchasing can only manually type PR No.
- Work Owner can search existing projects by PR No.
Optional Command Labels
| Element | Thai Label | Description |
|---|---|---|
| Skip badge | ข้ามได้ | Shown on optional commands |
| Skipped indicator | ข้าม | Shown on skipped steps |
| Return indicator | ↩ | Shown on return target |
Labels Verified Against
review-task-toolbar.component.ts(command buttons, formValid input)review-task-stepper.component.ts(step indicators)project-registration-state-metadata.config.ts(state names)workflow-visualization.config.ts(optional path config)project-registration-form.component.ts(form validation, required fields)review-task.service.ts(documentFormValid signal)