Skip to main content

Digital Signature Verification - Test Cases

Test Date: January 17, 2026 Feature: Digital Signature Verification with Password Confirmation PR: #294 (merged) Environment: Development (localhost:5000 / localhost:4200) Tenant: thaiscada


Overview

This document covers manual testing for the Digital Signature Verification feature. The feature allows users to confirm their signatures on PTW (Permit to Work) forms using password verification.

Components Tested

ComponentLocation
VerifyPasswordEndpointbackend/SafetyApp.WebApi/Features/Auths/VerifyPasswordEndpoint.cs
SignatureGridComponentfrontend/src/app/shared/components/signature-grid/
SignatureFieldComponentfrontend/src/app/shared/components/signature-field/
SignatureApprovalDialogComponentfrontend/src/app/shared/components/dialogs/signature-approval-dialog/

At a Glance

MetricValue
Total Tests24
Backend Tests3
Frontend Tests15
Integration Tests6

Results Summary

CategoryTestsStatus
1. Backend - Password Verification3 Pending
2. Frontend - SignatureApprovalDialog7 Pending
3. Frontend - SignatureGridComponent5 Pending
4. Frontend - SignatureFieldComponent3 Pending
5. Integration - PTW Parts6 Pending

Prerequisites

  • Backend server running on http://localhost:5000
  • Frontend running on http://localhost:4200
  • Work Permit Request task in progress with PTW forms accessible
  • Test accounts available (see Test Data section)
  • Modern browser (Chrome recommended)

Test Data

RoleEmailPassword
Admintn@thaiscada.comTest1234*
Work Ownersafety-owner@outlook.comTest1234*
Safety Officersafety-supervisor@outlook.comTest1234*
Contractorsafety-contractor1-0@outlook.comTest1234*

1. Backend - Password Verification Endpoint

HTTP Test File: backend/tests/http/regression/signature-verification.http

TC-SIG-001: Verify password with correct credentials

Endpoint: POST /api/auths/verify-password

StepActionExpected ResultDevQA
1Login as Contractor to get access token200 OK, token received[ ][ ]
2Send POST with correct password and Bearer token200 OK[ ][ ]
3Verify response body{ "valid": true }[ ][ ]

Notes: _______________


TC-SIG-002: Verify password with incorrect credentials

Endpoint: POST /api/auths/verify-password

StepActionExpected ResultDevQA
1Login as Contractor to get access token200 OK, token received[ ][ ]
2Send POST with incorrect password401 Unauthorized[ ][ ]
3Verify error responseError message indicates invalid credentials[ ][ ]

Notes: _______________


TC-SIG-003: Verify password without authentication

Endpoint: POST /api/auths/verify-password

StepActionExpected ResultDevQA
1Send POST without Authorization header401 Unauthorized[ ][ ]
2Verify no access to endpointRequest rejected before password check[ ][ ]

Notes: _______________


2. Frontend - SignatureApprovalDialogComponent

Location: frontend/src/app/shared/components/dialogs/signature-approval-dialog/

Precondition: Navigate to Work Permit task → PTW Part 3 (Authorization) → Click unsigned signature field


TC-SIG-004: Dialog opens on signature click

StepActionExpected ResultDevQA
1Login as ContractorDashboard displayed[ ][ ]
2Navigate to Work Permit taskTask details page opens[ ][ ]
3Open PTW Part 3 (Authorization)Signature grid displayed[ ][ ]
4Click on unsigned "ผู้รับเหมา" (Contractor) signature fieldSignature approval dialog opens[ ][ ]

[Screenshot: Signature approval dialog]

Notes: _______________


TC-SIG-005: Dialog shows user info and field label

StepActionExpected ResultDevQA
1Open signature approval dialogDialog displayed[ ][ ]
2Verify field label shownShows "ผู้รับเหมา" (Contractor) or appropriate label[ ][ ]
3Verify current user infoShows user name and role[ ][ ]
4Verify timestampShows current date/time in Thai Buddhist format[ ][ ]

[Screenshot: Dialog with user info]

Notes: _______________


TC-SIG-006: Password field toggle visibility

StepActionExpected ResultDevQA
1Open signature approval dialogPassword field displayed (masked)[ ][ ]
2Click visibility toggle button (eye icon)Password becomes visible[ ][ ]
3Click toggle againPassword is masked again[ ][ ]

[Screenshot: Password visibility toggle]

Notes: _______________


TC-SIG-007: Correct password confirms signature

StepActionExpected ResultDevQA
1Open signature approval dialogDialog displayed[ ][ ]
2Enter correct password: Test1234*Password field accepts input[ ][ ]
3Check confirmation checkboxCheckbox is checked[ ][ ]
4Click "ลงนาม" (Sign) buttonLoading spinner appears[ ][ ]
5Wait for verificationDialog closes[ ][ ]
6Verify signature field updatedShows green border, verified icon, name + date[ ][ ]

[Screenshot: Signed signature field]

Notes: _______________


TC-SIG-008: Incorrect password shows error

StepActionExpected ResultDevQA
1Open signature approval dialogDialog displayed[ ][ ]
2Enter incorrect password: WrongPassword123Password field accepts input[ ][ ]
3Check confirmation checkboxCheckbox is checked[ ][ ]
4Click "ลงนาม" (Sign) buttonLoading spinner appears[ ][ ]
5Wait for verificationError message displayed[ ][ ]
6Verify can retryPassword field cleared, can enter again[ ][ ]
7Enter correct password and signSignature confirmed successfully[ ][ ]

[Screenshot: Error message on incorrect password]

Notes: _______________


TC-SIG-009: Cancel button closes dialog

StepActionExpected ResultDevQA
1Open signature approval dialogDialog displayed[ ][ ]
2Click "ยกเลิก" (Cancel) buttonDialog closes[ ][ ]
3Verify signature field unchangedStill shows unsigned state[ ][ ]

Notes: _______________


TC-SIG-010: Loading state during verification

StepActionExpected ResultDevQA
1Open signature approval dialogDialog displayed[ ][ ]
2Enter password and check checkboxReady to submit[ ][ ]
3Click "ลงนาม" (Sign) buttonLoading spinner appears on button[ ][ ]
4Verify button is disabled during loadingCannot click again while verifying[ ][ ]

[Screenshot: Loading state]

Notes: _______________


3. Frontend - SignatureGridComponent

Location: frontend/src/app/shared/components/signature-grid/

Precondition: Navigate to Work Permit task → PTW Part 3 (Authorization)


TC-SIG-011: Grid displays 4 signature slots

StepActionExpected ResultDevQA
1Navigate to PTW Part 3Signature grid displayed[ ][ ]
2Verify 4 slots visibleShows: ผู้รับเหมา, ผู้ควบคุมงาน, จป., เจ้าของพื้นที่[ ][ ]
3Verify labelsContractor, Supervisor, Safety Officer, Area Owner[ ][ ]

[Screenshot: 4-slot signature grid]

Notes: _______________


TC-SIG-012: Unsigned + Editable state

StepActionExpected ResultDevQA
1View unsigned signature slot (when form editable)Blue dashed border visible[ ][ ]
2Verify clickable indicatorDraw/edit icon displayed[ ][ ]
3Hover over slotCursor changes to pointer[ ][ ]
4Click slotApproval dialog opens[ ][ ]

[Screenshot: Unsigned editable signature slot]

Notes: _______________


TC-SIG-013: Unsigned + Readonly state

StepActionExpected ResultDevQA
1Login as user without edit permission (or view completed form)Form in readonly mode[ ][ ]
2View unsigned signature slotGray dashed border visible[ ][ ]
3Verify not clickableNo cursor change on hover[ ][ ]
4Click slotNothing happens (dialog doesn't open)[ ][ ]

[Screenshot: Unsigned readonly signature slot]

Notes: _______________


TC-SIG-014: Signed state display

StepActionExpected ResultDevQA
1Complete a signature (TC-SIG-007)Signature confirmed[ ][ ]
2View signed slotGreen solid border visible[ ][ ]
3Verify verified iconCheckmark or verified icon displayed[ ][ ]
4Verify signer nameShows signer's display name[ ][ ]
5Verify dateShows signature date[ ][ ]

[Screenshot: Signed signature slot]

Notes: _______________


TC-SIG-015: Thai Buddhist date format

StepActionExpected ResultDevQA
1Complete a signatureSignature with timestamp saved[ ][ ]
2View signed date on signature slotDate in Thai Buddhist format[ ][ ]
3Verify formatFormat: d MMMM yyyy (e.g., "17 มกราคม 2569")[ ][ ]

[Screenshot: Thai date format]

Notes: _______________


4. Frontend - SignatureFieldComponent

Location: frontend/src/app/shared/components/signature-field/

Precondition: Navigate to a form with single signature fields (if available)


TC-SIG-016: Shows label and state

StepActionExpected ResultDevQA
1Locate single signature fieldField displayed[ ][ ]
2Verify label shownLabel text displayed above field[ ][ ]
3Verify unsigned stateShows appropriate unsigned styling[ ][ ]

Notes: _______________


TC-SIG-017: Clickable when editable and unsigned

StepActionExpected ResultDevQA
1View unsigned signature field (form editable)Field is interactive[ ][ ]
2Click on fieldApproval dialog opens[ ][ ]
3Complete signatureField updates to signed state[ ][ ]

Notes: _______________


TC-SIG-018: Displays signer info when signed

StepActionExpected ResultDevQA
1Complete signature on fieldSignature confirmed[ ][ ]
2Verify signer name displayedShows signer's display name[ ][ ]
3Verify date displayedShows signature date in Thai format[ ][ ]

Notes: _______________


5. Integration - PTW Parts

Precondition: Work Permit Request task in appropriate workflow state


TC-SIG-019: PTW Part 3 displays signature grid

StepActionExpected ResultDevQA
1Navigate to Work Permit taskTask details displayed[ ][ ]
2Open PTW Part 3 (Authorization)Part 3 form opens[ ][ ]
3Scroll to signature sectionSignature grid visible[ ][ ]
4Verify 4 signature slotsAll 4 roles displayed[ ][ ]

[Screenshot: PTW Part 3 signature grid]

Notes: _______________


TC-SIG-020: PTW Part 4 displays signature grid

StepActionExpected ResultDevQA
1Navigate to Work Permit taskTask details displayed[ ][ ]
2Open PTW Part 4 (Completion)Part 4 form opens[ ][ ]
3Scroll to signature sectionSignature grid visible[ ][ ]
4Verify signature slotsAppropriate roles displayed[ ][ ]

[Screenshot: PTW Part 4 signature grid]

Notes: _______________


TC-SIG-021: PTW Part 5 displays signature grid

StepActionExpected ResultDevQA
1Navigate to Work Permit taskTask details displayed[ ][ ]
2Open PTW Part 5 (Extension)Part 5 form opens[ ][ ]
3Scroll to signature sectionSignature grid visible[ ][ ]
4Verify signature slotsAppropriate roles displayed[ ][ ]

[Screenshot: PTW Part 5 signature grid]

Notes: _______________


TC-SIG-022: Signature click opens approval dialog

StepActionExpected ResultDevQA
1Open any PTW part with editable signatureSignature grid displayed[ ][ ]
2Click on signature slot for current user's roleApproval dialog opens[ ][ ]
3Verify dialog pre-populates user infoCurrent user name and role shown[ ][ ]

Notes: _______________


TC-SIG-023: Signature updates after approval

StepActionExpected ResultDevQA
1Open approval dialog and enter correct passwordReady to sign[ ][ ]
2Click "ลงนาม" (Sign) buttonVerification completes[ ][ ]
3Verify dialog closesReturns to PTW form[ ][ ]
4Verify signature slot updatedGreen border, name, date displayed[ ][ ]
5Verify slot is now read-onlyCannot click to modify[ ][ ]

[Screenshot: Updated signature after approval]

Notes: _______________


TC-SIG-024: Form auto-saves on signature

StepActionExpected ResultDevQA
1Open browser DevTools → Network tabNetwork monitoring enabled[ ][ ]
2Complete a signatureSignature confirmed[ ][ ]
3Observe network activityAuto-save API call triggered[ ][ ]
4Refresh pageSignature persists (not lost)[ ][ ]

[Screenshot: Network showing auto-save call]

Notes: _______________


Test Execution Notes

Tester Comments:




Issues Found:

Issue IDTest CaseDescriptionSeverity

Sign-off

RoleNameDateSignature
Developer
QA Tester
Reviewer

HTTP Test File Reference

Backend tests can be run using the HTTP test file:

Location: backend/tests/http/regression/signature-verification.http

How to Run:

  1. Start backend server: cd backend && dotnet watch run --project SafetyApp.Api
  2. Open HTTP file in VS Code or JetBrains IDE with REST Client
  3. Select "dev" environment
  4. Run tests in order (login first, then verification tests)

This test document was generated for the Digital Signature Verification feature (PR #294).