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
| Component | Location |
|---|---|
| VerifyPasswordEndpoint | backend/SafetyApp.WebApi/Features/Auths/VerifyPasswordEndpoint.cs |
| SignatureGridComponent | frontend/src/app/shared/components/signature-grid/ |
| SignatureFieldComponent | frontend/src/app/shared/components/signature-field/ |
| SignatureApprovalDialogComponent | frontend/src/app/shared/components/dialogs/signature-approval-dialog/ |
At a Glance
| Metric | Value |
|---|---|
| Total Tests | 24 |
| Backend Tests | 3 |
| Frontend Tests | 15 |
| Integration Tests | 6 |
Results Summary
| Category | Tests | Status |
|---|---|---|
| 1. Backend - Password Verification | 3 | ⌛ Pending |
| 2. Frontend - SignatureApprovalDialog | 7 | ⌛ Pending |
| 3. Frontend - SignatureGridComponent | 5 | ⌛ Pending |
| 4. Frontend - SignatureFieldComponent | 3 | ⌛ Pending |
| 5. Integration - PTW Parts | 6 | ⌛ 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
| Role | Password | |
|---|---|---|
| Admin | tn@thaiscada.com | Test1234* |
| Work Owner | safety-owner@outlook.com | Test1234* |
| Safety Officer | safety-supervisor@outlook.com | Test1234* |
| Contractor | safety-contractor1-0@outlook.com | Test1234* |
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
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as Contractor to get access token | 200 OK, token received | [ ] | [ ] |
| 2 | Send POST with correct password and Bearer token | 200 OK | [ ] | [ ] |
| 3 | Verify response body | { "valid": true } | [ ] | [ ] |
Notes: _______________
TC-SIG-002: Verify password with incorrect credentials
Endpoint: POST /api/auths/verify-password
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as Contractor to get access token | 200 OK, token received | [ ] | [ ] |
| 2 | Send POST with incorrect password | 401 Unauthorized | [ ] | [ ] |
| 3 | Verify error response | Error message indicates invalid credentials | [ ] | [ ] |
Notes: _______________
TC-SIG-003: Verify password without authentication
Endpoint: POST /api/auths/verify-password
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Send POST without Authorization header | 401 Unauthorized | [ ] | [ ] |
| 2 | Verify no access to endpoint | Request 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
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as Contractor | Dashboard displayed | [ ] | [ ] |
| 2 | Navigate to Work Permit task | Task details page opens | [ ] | [ ] |
| 3 | Open PTW Part 3 (Authorization) | Signature grid displayed | [ ] | [ ] |
| 4 | Click on unsigned "ผู้รับเหมา" (Contractor) signature field | Signature approval dialog opens | [ ] | [ ] |
[Screenshot: Signature approval dialog]
Notes: _______________
TC-SIG-005: Dialog shows user info and field label
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open signature approval dialog | Dialog displayed | [ ] | [ ] |
| 2 | Verify field label shown | Shows "ผู้รับเหมา" (Contractor) or appropriate label | [ ] | [ ] |
| 3 | Verify current user info | Shows user name and role | [ ] | [ ] |
| 4 | Verify timestamp | Shows current date/time in Thai Buddhist format | [ ] | [ ] |
[Screenshot: Dialog with user info]
Notes: _______________
TC-SIG-006: Password field toggle visibility
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open signature approval dialog | Password field displayed (masked) | [ ] | [ ] |
| 2 | Click visibility toggle button (eye icon) | Password becomes visible | [ ] | [ ] |
| 3 | Click toggle again | Password is masked again | [ ] | [ ] |
[Screenshot: Password visibility toggle]
Notes: _______________
TC-SIG-007: Correct password confirms signature
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open signature approval dialog | Dialog displayed | [ ] | [ ] |
| 2 | Enter correct password: Test1234* | Password field accepts input | [ ] | [ ] |
| 3 | Check confirmation checkbox | Checkbox is checked | [ ] | [ ] |
| 4 | Click "ลงนาม" (Sign) button | Loading spinner appears | [ ] | [ ] |
| 5 | Wait for verification | Dialog closes | [ ] | [ ] |
| 6 | Verify signature field updated | Shows green border, verified icon, name + date | [ ] | [ ] |
[Screenshot: Signed signature field]
Notes: _______________
TC-SIG-008: Incorrect password shows error
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open signature approval dialog | Dialog displayed | [ ] | [ ] |
| 2 | Enter incorrect password: WrongPassword123 | Password field accepts input | [ ] | [ ] |
| 3 | Check confirmation checkbox | Checkbox is checked | [ ] | [ ] |
| 4 | Click "ลงนาม" (Sign) button | Loading spinner appears | [ ] | [ ] |
| 5 | Wait for verification | Error message displayed | [ ] | [ ] |
| 6 | Verify can retry | Password field cleared, can enter again | [ ] | [ ] |
| 7 | Enter correct password and sign | Signature confirmed successfully | [ ] | [ ] |
[Screenshot: Error message on incorrect password]
Notes: _______________
TC-SIG-009: Cancel button closes dialog
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open signature approval dialog | Dialog displayed | [ ] | [ ] |
| 2 | Click "ยกเลิก" (Cancel) button | Dialog closes | [ ] | [ ] |
| 3 | Verify signature field unchanged | Still shows unsigned state | [ ] | [ ] |
Notes: _______________
TC-SIG-010: Loading state during verification
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open signature approval dialog | Dialog displayed | [ ] | [ ] |
| 2 | Enter password and check checkbox | Ready to submit | [ ] | [ ] |
| 3 | Click "ลงนาม" (Sign) button | Loading spinner appears on button | [ ] | [ ] |
| 4 | Verify button is disabled during loading | Cannot 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
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to PTW Part 3 | Signature grid displayed | [ ] | [ ] |
| 2 | Verify 4 slots visible | Shows: ผู้รับเหมา, ผู้ควบคุมงาน, จป., เจ้าของพื้นที่ | [ ] | [ ] |
| 3 | Verify labels | Contractor, Supervisor, Safety Officer, Area Owner | [ ] | [ ] |
[Screenshot: 4-slot signature grid]
Notes: _______________
TC-SIG-012: Unsigned + Editable state
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | View unsigned signature slot (when form editable) | Blue dashed border visible | [ ] | [ ] |
| 2 | Verify clickable indicator | Draw/edit icon displayed | [ ] | [ ] |
| 3 | Hover over slot | Cursor changes to pointer | [ ] | [ ] |
| 4 | Click slot | Approval dialog opens | [ ] | [ ] |
[Screenshot: Unsigned editable signature slot]
Notes: _______________
TC-SIG-013: Unsigned + Readonly state
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as user without edit permission (or view completed form) | Form in readonly mode | [ ] | [ ] |
| 2 | View unsigned signature slot | Gray dashed border visible | [ ] | [ ] |
| 3 | Verify not clickable | No cursor change on hover | [ ] | [ ] |
| 4 | Click slot | Nothing happens (dialog doesn't open) | [ ] | [ ] |
[Screenshot: Unsigned readonly signature slot]
Notes: _______________
TC-SIG-014: Signed state display
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Complete a signature (TC-SIG-007) | Signature confirmed | [ ] | [ ] |
| 2 | View signed slot | Green solid border visible | [ ] | [ ] |
| 3 | Verify verified icon | Checkmark or verified icon displayed | [ ] | [ ] |
| 4 | Verify signer name | Shows signer's display name | [ ] | [ ] |
| 5 | Verify date | Shows signature date | [ ] | [ ] |
[Screenshot: Signed signature slot]
Notes: _______________
TC-SIG-015: Thai Buddhist date format
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Complete a signature | Signature with timestamp saved | [ ] | [ ] |
| 2 | View signed date on signature slot | Date in Thai Buddhist format | [ ] | [ ] |
| 3 | Verify format | Format: 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
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate single signature field | Field displayed | [ ] | [ ] |
| 2 | Verify label shown | Label text displayed above field | [ ] | [ ] |
| 3 | Verify unsigned state | Shows appropriate unsigned styling | [ ] | [ ] |
Notes: _______________
TC-SIG-017: Clickable when editable and unsigned
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | View unsigned signature field (form editable) | Field is interactive | [ ] | [ ] |
| 2 | Click on field | Approval dialog opens | [ ] | [ ] |
| 3 | Complete signature | Field updates to signed state | [ ] | [ ] |
Notes: _______________
TC-SIG-018: Displays signer info when signed
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Complete signature on field | Signature confirmed | [ ] | [ ] |
| 2 | Verify signer name displayed | Shows signer's display name | [ ] | [ ] |
| 3 | Verify date displayed | Shows 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
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to Work Permit task | Task details displayed | [ ] | [ ] |
| 2 | Open PTW Part 3 (Authorization) | Part 3 form opens | [ ] | [ ] |
| 3 | Scroll to signature section | Signature grid visible | [ ] | [ ] |
| 4 | Verify 4 signature slots | All 4 roles displayed | [ ] | [ ] |
[Screenshot: PTW Part 3 signature grid]
Notes: _______________
TC-SIG-020: PTW Part 4 displays signature grid
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to Work Permit task | Task details displayed | [ ] | [ ] |
| 2 | Open PTW Part 4 (Completion) | Part 4 form opens | [ ] | [ ] |
| 3 | Scroll to signature section | Signature grid visible | [ ] | [ ] |
| 4 | Verify signature slots | Appropriate roles displayed | [ ] | [ ] |
[Screenshot: PTW Part 4 signature grid]
Notes: _______________
TC-SIG-021: PTW Part 5 displays signature grid
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to Work Permit task | Task details displayed | [ ] | [ ] |
| 2 | Open PTW Part 5 (Extension) | Part 5 form opens | [ ] | [ ] |
| 3 | Scroll to signature section | Signature grid visible | [ ] | [ ] |
| 4 | Verify signature slots | Appropriate roles displayed | [ ] | [ ] |
[Screenshot: PTW Part 5 signature grid]
Notes: _______________
TC-SIG-022: Signature click opens approval dialog
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open any PTW part with editable signature | Signature grid displayed | [ ] | [ ] |
| 2 | Click on signature slot for current user's role | Approval dialog opens | [ ] | [ ] |
| 3 | Verify dialog pre-populates user info | Current user name and role shown | [ ] | [ ] |
Notes: _______________
TC-SIG-023: Signature updates after approval
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open approval dialog and enter correct password | Ready to sign | [ ] | [ ] |
| 2 | Click "ลงนาม" (Sign) button | Verification completes | [ ] | [ ] |
| 3 | Verify dialog closes | Returns to PTW form | [ ] | [ ] |
| 4 | Verify signature slot updated | Green border, name, date displayed | [ ] | [ ] |
| 5 | Verify slot is now read-only | Cannot click to modify | [ ] | [ ] |
[Screenshot: Updated signature after approval]
Notes: _______________
TC-SIG-024: Form auto-saves on signature
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open browser DevTools → Network tab | Network monitoring enabled | [ ] | [ ] |
| 2 | Complete a signature | Signature confirmed | [ ] | [ ] |
| 3 | Observe network activity | Auto-save API call triggered | [ ] | [ ] |
| 4 | Refresh page | Signature persists (not lost) | [ ] | [ ] |
[Screenshot: Network showing auto-save call]
Notes: _______________
Test Execution Notes
Tester Comments:
Issues Found:
| Issue ID | Test Case | Description | Severity |
|---|---|---|---|
Sign-off
| Role | Name | Date | Signature |
|---|---|---|---|
| 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:
- Start backend server:
cd backend && dotnet watch run --project SafetyApp.Api - Open HTTP file in VS Code or JetBrains IDE with REST Client
- Select "dev" environment
- Run tests in order (login first, then verification tests)
This test document was generated for the Digital Signature Verification feature (PR #294).