Skip to main content

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 DocumentDescriptionTest Cases
Standard Workflow PathFull workflow: Work Owner → Purchasing → Contractor → ApprovalTC-PR-001 to TC-PR-003, TC-PR-005 to TC-PR-031, TC-PR-041 to TC-PR-047
Optional Path - Skip PurchasingSkip 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:

  1. Backend server running on http://localhost:5000
  2. Frontend running on http://localhost:4200
  3. 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

RoleEmailPasswordAccess Level
Admintn@thaiscada.comTest1234*View all tasks
Purchasingsafety-purchasing@outlook.comTest1234*FillInPurchasingInfo state
Work Ownersafety-owner@outlook.comTest1234*Create, review, approve
Contractorsafety-contractor1-0@outlook.comTest1234*Acknowledge procedures

Create Task

เครื่องมือ (Tools) → สร้างงานใหม่ (Create Task) → การลงทะเบียนโครงการ (Project Registration)

View Tasks

งาน (Tasks) → รายการงาน (Task List)

Review Task

Click on task row → Task review page opens

Auto-Navigation

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 KeyThai NameEnglish NameExpected Role
fill-in-project-infoกรอกข้อมูลโครงการFill in project informationWork Owner
fill-in-purchasing-infoกรอกข้อมูลจัดซื้อFill in purchasing informationPurchasing
review-purchasing-infoรีวิวข้อมูลจัดซื้อReview purchasing informationWork Owner
fill-in-pre-work-procedures-formรับทราบระเบียบปฏิบัติงานAcknowledge work proceduresContractor
review-pre-work-procedures-formรีวิวเอกสารระเบียบปฏิบัติงานReview work procedures docsWork Owner
approvedอนุมัติApproved(terminal)
canceledยกเลิกCanceled(terminal)

Command Labels

Command KeyThai LabelDescription
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:

CommandvalidationRequiredBehavior
ส่งไปจัดซื้อtrueDisabled when form invalid
ส่งไปผู้รับเหมาtrueDisabled when form invalid
ส่งกลับ (Purchasing)trueDisabled when form invalid
ยกเลิกงานfalseAlways enabled

Required Fields by Role

Work Owner (FillInProjectInfo, ReviewPurchasingInfo, ReviewPreWorkProceduresForm):

FieldThai LabelRed Asterisk
Project Nameชื่อโครงการ
Workspace Areaพื้นที่ทำงาน
Work Ownerเจ้าของงาน
Safety Officerเจ้าหน้าที่ความปลอดภัย
Workspace Ownerเจ้าของพื้นที่

Purchasing (FillInPurchasingInfo):

FieldThai LabelRed 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

ElementThai LabelDescription
Skip badgeข้ามได้Shown on optional commands
Skipped indicatorข้ามShown on skipped steps
Return indicatorShown 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)