Skip to main content

Test Cases

Revision 2.0 (2026-01-25) - Comprehensive restructure with feature coverage mapping

For Testers

This is your starting point for testing Safety App. Each section lists what needs testing and links to detailed test cases where available. Features marked Needs Tests are priorities for creating new test documentation.

Coverage Summary

CategoryFeaturesDocumentedCoverage
Safety Workflows5360%
Task Operations6117%
Administration12758%
Document Forms900%
Platform4125%
Total361233%

RolePriority Test Areas
AdminUser Management, System Settings, All workflows
Safety OfficerAll workflows, Digital Signatures, Training Management
Work OwnerTask Review, Document Forms, Project Settings
PurchasingProject Registration, Contractor Management
ContractorMy Tasks, Tool List, JSA, Training Enrollment

1. Safety Workflows

Core business processes powered by Temporal.io with multi-step approvals.

WorkflowTest CoverageQuick Test
Project RegistrationFull SuiteCreate project → Approve through all states
Tool List PreparationBasicSubmit tool list → Work Owner approves
Training EnrollmentPrototypeEnroll worker → Attend → Complete
Work Permit RequestPrototypeCreate permit → All 4 parts → Close
JSA PreparationPrototypeCreate JSA → Submit → Approve

Test Case Index

Test IDWorkflowDescriptionStatus
TC-PR-001Project RegistrationCreate and submit project
TC-PR-002Project RegistrationApproval flow complete
TC-TL-001Tool ListSubmit and approve (Happy Path)
TC-TE-001Training EnrollmentEnroll and complete🚧 Needs Tests
TC-WP-001Work PermitFull permit lifecycle🚧 Needs Tests
TC-JSA-001JSA PreparationCreate and approve🚧 Needs Tests

2. Task Operations

How users interact with workflows through the task system.

FeatureTest CoverageQuick Test
My TasksNeeds TestsView inbox → Filter by status → Open task
All TasksNeeds TestsView all tasks → Pagination → Search
Digital SignaturesFull SuiteSign document → Verify password → Check persistence
Print & ExportNeeds TestsPrint preview → Download PDF → Download All ZIP
Auto SaveNeeds TestsEdit form → Wait 5s → Verify saved
Task ReviewNeeds TestsOpen task → View documents → Execute command

Test Case Index

Test IDFeatureDescriptionStatus
TC-SIG-001Digital SignaturesPassword verification and persistence
TC-TASK-001My TasksFilter by status, search, pagination🚧 Needs Tests
TC-TASK-002All TasksServer-side pagination and filtering🚧 Needs Tests
TC-SAVE-001Auto SaveDebounced save (5 seconds)🚧 Needs Tests
TC-SAVE-002Auto SaveImmediate save (signatures)🚧 Needs Tests
TC-PRINT-001Print & ExportPDF generation and download🚧 Needs Tests
TC-PRINT-002Print & ExportDownload All ZIP functionality🚧 Needs Tests

3. Administration (CRUD Settings)

Master data management and system configuration.

Backend API Tests

APITest FileEndpoints
Authenticationbackend-auth-api.mdLogin, Logout, Token refresh
Usersbackend-users-api.mdCRUD, Role assignment
Employersbackend-employers-api.mdCRUD operations
Contractorsbackend-contractors-api.mdCRUD, Worker management
Projectsbackend-projects-api.mdCRUD, Status transitions
Workflowbackend-workflow-api.mdCommand execution

Frontend UI Tests

FeatureTest FileCoverage
Authenticationfrontend-auth.mdLogin, Logout, Language switch
User Managementfrontend-user-management.mdList, Create, Edit, Delete
Employer Settingsfrontend-employer-settings.mdCompany configuration
Contractor Managementfrontend-contractor-management.mdContractor CRUD
Project Settingsfrontend-project-settings.mdProject CRUD
Workspace Areasfrontend-workspace-area-settings.mdArea CRUD
Training Enrollmentfrontend-training-enrollment.mdEnrollment workflow

Test Case Index

Test IDFeatureDescriptionStatus
TC-USER-001User ManagementCreate user with role
TC-USER-002User ManagementEdit user permissions
TC-CONT-001Contractor ManagementRegister new contractor
TC-CONT-002Contractor ManagementAdd workers to contractor
TC-PROJ-001Project SettingsCreate project
TC-PROJ-002Project SettingsAssign Work Owner
TC-WORK-001Worker RegistrationCreate worker profile🚧 Needs Tests
TC-WORK-002Worker RegistrationTraining status tracking🚧 Needs Tests
TC-TRAIN-001Training ManagementCreate training schedule🚧 Needs Tests
TC-TRAIN-002Training ManagementRecord attendance🚧 Needs Tests
TC-JSA-TPL-001JSA TemplateCreate template🚧 Needs Tests
TC-WSA-001Workspace AreaCRUD operations

4. Document Forms (Permit-to-Work)

Form components for safety permits with role-based edit permissions.

Form TypeTest CoverageKey Sections
General Work Permit🚧 Needs TestsPart 1-4, Signatures
Work at Height🚧 Needs TestsEquipment checklist
Hot Work🚧 Needs TestsFire watch requirements
Confined Space🚧 Needs TestsEntry/exit log
High Voltage🚧 Needs TestsLOTO verification
Chemical Work🚧 Needs TestsMSDS references
Radiation Work🚧 Needs TestsDosimeter readings
Excavation🚧 Needs TestsUtility clearance

Planned Test Cases

Test IDFormDescriptionPriority
TC-PTW-GEN-001General Work PermitComplete form lifecycleHigh
TC-PTW-GEN-002General Work PermitRole-based edit permissionsHigh
TC-PTW-HEIGHT-001Work at HeightEquipment checklist validationMedium
TC-PTW-HOT-001Hot WorkFire watch signature flowMedium
TC-PTW-CONF-001Confined SpaceEntry permit flowMedium

5. Platform & Infrastructure

Cross-cutting capabilities that support all features.

FeatureTest CoverageQuick Test
Authenticationfrontend-auth.mdLogin → Access protected route → Logout
Multi-TenancyNeeds TestsLogin to different tenant → Verify data isolation
Role-Based AccessNeeds TestsLogin as different roles → Verify menu/actions
DashboardNeeds TestsView metrics → Navigate to features
Notifications (Inbox)Needs TestsReceive notification → Mark as read
Notifications (Email)Needs TestsTrigger email → Check smtp.iotserver.in.th

Test Case Index

Test IDFeatureDescriptionStatus
TC-AUTH-001AuthenticationLogin with valid credentials
TC-AUTH-002AuthenticationToken refresh
TC-AUTH-003AuthenticationLogout clears session
TC-RBAC-001Role-Based AccessAdmin sees all menu items🚧 Needs Tests
TC-RBAC-002Role-Based AccessContractor sees limited menu🚧 Needs Tests
TC-NOTIF-001Inbox NotificationsNotification appears🚧 Needs Tests
TC-NOTIF-002Inbox NotificationsAuto-read on view🚧 Needs Tests
TC-EMAIL-001Email NotificationsEmail sent on approval🚧 Needs Tests

6. E2E Test Suites

Automated end-to-end tests using Playwright.

SuiteLocationDescription
E2E Testsfrontend-e2e-tests.mdOverview of automated tests
Prototype Testsprototype/index.mdWorkflow prototype tests

Test Accounts

Use these accounts for testing (thaiscada tenant):

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

How to Use This Documentation

For Manual Testing

  1. Find your feature in the sections above
  2. Check the Test Coverage column - if linked, follow the link
  3. If "Needs Tests" - use the Quick Test column as a starting point
  4. Report results using the status icons:
    • Pass
    • Fail (create GitHub issue)
    • 🚧 Not yet tested

For Creating New Test Cases

  1. Copy an existing test case file as template
  2. Follow the format in .claude/rules/testing.md (project guidelines)
  3. Use English for test case titles
  4. Include exact Thai labels from source code
  5. Add [Screenshot: description] placeholders

Status Legend

IconMeaning
Tests documented and passing
🚧 Needs TestsFeature exists but no test documentation
🔍 In ReviewTests written, awaiting verification
PendingTest execution pending

Recent Updates (2026-01-25)

  • Added comprehensive feature coverage mapping
  • Reorganized by feature category
  • Added Test ID system for tracking
  • Added quick test suggestions for features without documentation
  • Added role-based quick links
  • Updated Tool List test cases with new features (duplicate prevention, date/time picker, contractor email)