Skip to main content

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 ConditionWhen AvailableEffect
HasPurchaseOrderNoProject has PO.No filledShows "ข้ามได้" badge on "ส่งไปผู้รับเหมา" button

Visual Indicators

UI ElementThai LabelWhen Shown
Skip badge on command buttonข้ามได้Command is optional and can be executed
Skipped step indicatorข้ามStep was skipped
Return indicatorStep 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

StepActionExpected Result
1Create task from project with PO.NoTask created
2Open taskTask review page opens
3Verify workflow stepperShows "กรอกข้อมูลโครงการ" as current step
4Verify command buttons"ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible
5Verify skip badge"ส่งไปผู้รับเหมา" has "ข้ามได้" badge
6Hover over skip badgeTooltip 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

StepActionExpected Result
1Create task from project without PO.NoTask created
2Open taskTask review page opens
3Verify command buttons"ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible
4Verify no skip badge"ส่งไปผู้รับเหมา" has NO "ข้ามได้" badge

Result: ☐ Pass ☐ Fail


TC-PR-034: Skip badge styling verification

Precondition: Task with skip option available

StepActionExpected Result
1Open task with PO.NoSkip button visible
2Verify badge positionBadge at top-right corner of button
3Verify badge colorPurple background with white text
4Verify badge textShows "ข้ามได้"
5Verify tooltip on hoverShows 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

StepActionExpected Result
1Click "ส่งไปผู้รับเหมา"Assignee dialog opens
2Select Contractor userContractor supervisor selected
3Add note (optional)Note entered
4Click confirmCommand executed
5Verify state changeStepper shows "รับทราบระเบียบปฏิบัติงาน"
6Verify assigneeContractor is new assignee

Result: ☐ Pass ☐ Fail


TC-PR-036: Stepper shows skipped steps

Precondition: Task has skipped Purchasing steps (after TC-PR-035)

StepActionExpected Result
1Open taskStepper displayed
2Verify "กรอกข้อมูลจัดซื้อ" stepShows dashed border (optional step)
3Verify skip indicatorStep shows "ข้าม" badge
4Verify "รีวิวข้อมูลจัดซื้อ" stepAlso shows dashed border and "ข้าม" badge
5Verify current step"รับทราบระเบียบปฏิบัติงาน" is highlighted

Result: ☐ Pass ☐ Fail


TC-PR-037: Complete workflow after skip

Precondition: Task at FillInPreWorkProceduresForm after skip

StepActionExpected Result
1Login as ContractorLogged in
2Open taskForm displayed
3Fill pre-work procedures formData entered
4Click "รับทราบระเบียบปฏิบัติงาน"Submit to Work Owner
5Login as Work OwnerLogged in
6Open taskAt ReviewPreWorkProceduresForm
7Click "อนุมัติ"Approval dialog opens
8Confirm approvalTask approved
9Verify final stateShows "อนุมัติ" 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)

StepActionExpected Result
1Create task from project with empty PO.NoTask created
2Open taskTask review page opens
3Verify command buttons"ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible
4Verify 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)

StepActionExpected Result
1Create task from project with whitespace PO.NoTask created
2Open taskTask review page opens
3Verify command buttons"ส่งไปจัดซื้อ", "ส่งไปผู้รับเหมา", and "ยกเลิกงาน" visible
4Verify no skip badge"ส่งไปผู้รับเหมา" has NO "ข้ามได้" badge

Result: ☐ Pass ☐ Fail


TC-PR-040: Transaction log shows skip entry

Precondition: Task that used skip path

StepActionExpected Result
1Open task that used skipTask opens
2Click "ประวัติ" tabTransaction log displayed
3Verify skip entryEntry shows skip action
4Verify skip reasonShows "ข้าม - มี PO No. แล้ว" or similar
5Verify skipped statesNo entries for Purchasing states

Result: ☐ Pass ☐ Fail


Test Summary

CategoryTest CasesCount
Skip AvailabilityTC-PR-032 to TC-PR-0343
Execute SkipTC-PR-035 to TC-PR-0373
Edge CasesTC-PR-038 to TC-PR-0403
Total9

Test Execution Sign-off

RoleNameDateSignature
Tester
Reviewer

Notes

[Add any notes or observations during testing]