Optional Path - Skip Purchasing
Revision 1.0 (2026-01-14) - Complete optional path test cases
This document contains test cases for the Optional Path feature that allows Work Owner to skip the Purchasing review step when the project already has a PO Number.
Work Owner → [Skip Purchasing] → Contractor → Final Review → Approval
Test Cases: TC-PR-032 to TC-PR-040
Feature Overview
The Optional Command feature enables skipping workflow steps based on conditions:
| Skip Condition | When Available | Effect |
|---|---|---|
HasPurchaseOrderNo | Project has PO.No filled | Shows "ข้ามได้" badge on "ส่งไปผู้รับเหมา" button |
Visual Indicators
| UI Element | Thai Label | When Shown |
|---|---|---|
| Skip badge on command button | ข้ามได้ | Command is optional and can be executed |
| Skipped step indicator | ข้าม | Step was skipped |
| Return indicator | ↩ | Step is a potential return target |
1. Skip Availability Tests
TC-PR-032: Skip option appears when project has PO No.
Precondition: Project exists with PO.No filled, logged in as Work Owner
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create task from project with PO.No | Task created |
| 2 | Open task | Task review page opens |
| 3 | Verify workflow stepper | Shows "กรอกข้อมูลโครงการ" as current step |
| 4 | Verify command buttons | "ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible |
| 5 | Verify skip badge | "ส่งไปผู้รับเหมา" has "ข้ามได้" badge |
| 6 | Hover over skip badge | Tooltip shows skip reason (e.g., "ข้าม - มี PO No. แล้ว") |
Result: ☐ Pass ☐ Fail
TC-PR-033: Skip badge hidden when no PO No.
Precondition: Project exists WITHOUT PO.No, logged in as Work Owner
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create task from project without PO.No | Task created |
| 2 | Open task | Task review page opens |
| 3 | Verify command buttons | "ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible |
| 4 | Verify no skip badge | "ส่งไปผู้รับเหมา" has NO "ข้ามได้" badge |
Result: ☐ Pass ☐ Fail
TC-PR-034: Skip badge styling verification
Precondition: Task with skip option available
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task with PO.No | Skip button visible |
| 2 | Verify badge position | Badge at top-right corner of button |
| 3 | Verify badge color | Purple background with white text |
| 4 | Verify badge text | Shows "ข้ามได้" |
| 5 | Verify tooltip on hover | Shows skip reason |
Result: ☐ Pass ☐ Fail
2. Execute Skip Tests
TC-PR-035: Execute skip to Contractor directly
Precondition: Task at FillInProjectInfo with skip option available
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "ส่งไปผู้รับเหมา" | Assignee dialog opens |
| 2 | Select Contractor user | Contractor supervisor selected |
| 3 | Add note (optional) | Note entered |
| 4 | Click confirm | Command executed |
| 5 | Verify state change | Stepper shows "รับทราบระเบียบปฏิบัติงาน" |
| 6 | Verify assignee | Contractor is new assignee |
Result: ☐ Pass ☐ Fail
TC-PR-036: Stepper shows skipped steps
Precondition: Task has skipped Purchasing steps (after TC-PR-035)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task | Stepper displayed |
| 2 | Verify "กรอกข้อมูลจัดซื้อ" step | Shows dashed border (optional step) |
| 3 | Verify skip indicator | Step shows "ข้าม" badge |
| 4 | Verify "รีวิวข้อมูลจัดซื้อ" step | Also shows dashed border and "ข้าม" badge |
| 5 | Verify current step | "รับทราบระเบียบปฏิบัติงาน" is highlighted |
Result: ☐ Pass ☐ Fail
TC-PR-037: Complete workflow after skip
Precondition: Task at FillInPreWorkProceduresForm after skip
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Contractor | Logged in |
| 2 | Open task | Form displayed |
| 3 | Fill pre-work procedures form | Data entered |
| 4 | Click "รับทราบระเบียบปฏิบัติงาน" | Submit to Work Owner |
| 5 | Login as Work Owner | Logged in |
| 6 | Open task | At ReviewPreWorkProceduresForm |
| 7 | Click "อนุมัติ" | Approval dialog opens |
| 8 | Confirm approval | Task approved |
| 9 | Verify final state | Shows "อนุมัติ" then "เสร็จสิ้น" |
Result: ☐ Pass ☐ Fail
3. Edge Case Tests
TC-PR-038: Empty PO No. string does not trigger skip badge
Precondition: Project with PO.No = "" (empty string)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create task from project with empty PO.No | Task created |
| 2 | Open task | Task review page opens |
| 3 | Verify command buttons | "ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible |
| 4 | Verify no skip badge | "ส่งไปผู้รับเหมา" has NO "ข้ามได้" badge |
Result: ☐ Pass ☐ Fail
TC-PR-039: Whitespace-only PO No. does not trigger skip badge
Precondition: Project with PO.No = " " (whitespace only)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create task from project with whitespace PO.No | Task created |
| 2 | Open task | Task review page opens |
| 3 | Verify command buttons | "ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible |
| 4 | Verify no skip badge | "ส่งไปผู้รับเหมา" has NO "ข้ามได้" badge |
Result: ☐ Pass ☐ Fail
TC-PR-040: Transaction log shows skip entry
Precondition: Task that used skip path
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open task that used skip | Task opens |
| 2 | Click "ประวัติ" tab | Transaction log displayed |
| 3 | Verify skip entry | Entry shows skip action |
| 4 | Verify skip reason | Shows "ข้าม - มี PO No. แล้ว" or similar |
| 5 | Verify skipped states | No entries for Purchasing states |
Result: ☐ Pass ☐ Fail
Test Summary
| Category | Test Cases | Count |
|---|---|---|
| Skip Availability | TC-PR-032 to TC-PR-034 | 3 |
| Execute Skip | TC-PR-035 to TC-PR-037 | 3 |
| Edge Cases | TC-PR-038 to TC-PR-040 | 3 |
| Total | 9 |
Test Execution Sign-off
| Role | Name | Date | Signature |
|---|---|---|---|
| Tester | |||
| Reviewer |
Notes
[Add any notes or observations during testing]