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
| Category | Features | Documented | Coverage |
|---|---|---|---|
| Safety Workflows | 5 | 3 | 60% |
| Task Operations | 6 | 1 | 17% |
| Administration | 12 | 7 | 58% |
| Document Forms | 9 | 0 | 0% |
| Platform | 4 | 1 | 25% |
| Total | 36 | 12 | 33% |
Quick Links by Role
| Role | Priority Test Areas |
|---|---|
| Admin | User Management, System Settings, All workflows |
| Safety Officer | All workflows, Digital Signatures, Training Management |
| Work Owner | Task Review, Document Forms, Project Settings |
| Purchasing | Project Registration, Contractor Management |
| Contractor | My Tasks, Tool List, JSA, Training Enrollment |
1. Safety Workflows
Core business processes powered by Temporal.io with multi-step approvals.
| Workflow | Test Coverage | Quick Test |
|---|---|---|
| Project Registration | Full Suite | Create project → Approve through all states |
| Tool List Preparation | Basic | Submit tool list → Work Owner approves |
| Training Enrollment | Prototype | Enroll worker → Attend → Complete |
| Work Permit Request | Prototype | Create permit → All 4 parts → Close |
| JSA Preparation | Prototype | Create JSA → Submit → Approve |
Test Case Index
| Test ID | Workflow | Description | Status |
|---|---|---|---|
| TC-PR-001 | Project Registration | Create and submit project | ✅ |
| TC-PR-002 | Project Registration | Approval flow complete | ✅ |
| TC-TL-001 | Tool List | Submit and approve (Happy Path) | ✅ |
| TC-TE-001 | Training Enrollment | Enroll and complete | 🚧 Needs Tests |
| TC-WP-001 | Work Permit | Full permit lifecycle | 🚧 Needs Tests |
| TC-JSA-001 | JSA Preparation | Create and approve | 🚧 Needs Tests |
2. Task Operations
How users interact with workflows through the task system.
| Feature | Test Coverage | Quick Test |
|---|---|---|
| My Tasks | Needs Tests | View inbox → Filter by status → Open task |
| All Tasks | Needs Tests | View all tasks → Pagination → Search |
| Digital Signatures | Full Suite | Sign document → Verify password → Check persistence |
| Print & Export | Needs Tests | Print preview → Download PDF → Download All ZIP |
| Auto Save | Needs Tests | Edit form → Wait 5s → Verify saved |
| Task Review | Needs Tests | Open task → View documents → Execute command |
Test Case Index
| Test ID | Feature | Description | Status |
|---|---|---|---|
| TC-SIG-001 | Digital Signatures | Password verification and persistence | ✅ |
| TC-TASK-001 | My Tasks | Filter by status, search, pagination | 🚧 Needs Tests |
| TC-TASK-002 | All Tasks | Server-side pagination and filtering | 🚧 Needs Tests |
| TC-SAVE-001 | Auto Save | Debounced save (5 seconds) | 🚧 Needs Tests |
| TC-SAVE-002 | Auto Save | Immediate save (signatures) | 🚧 Needs Tests |
| TC-PRINT-001 | Print & Export | PDF generation and download | 🚧 Needs Tests |
| TC-PRINT-002 | Print & Export | Download All ZIP functionality | 🚧 Needs Tests |
3. Administration (CRUD Settings)
Master data management and system configuration.
Backend API Tests
| API | Test File | Endpoints |
|---|---|---|
| Authentication | backend-auth-api.md | Login, Logout, Token refresh |
| Users | backend-users-api.md | CRUD, Role assignment |
| Employers | backend-employers-api.md | CRUD operations |
| Contractors | backend-contractors-api.md | CRUD, Worker management |
| Projects | backend-projects-api.md | CRUD, Status transitions |
| Workflow | backend-workflow-api.md | Command execution |
Frontend UI Tests
| Feature | Test File | Coverage |
|---|---|---|
| Authentication | frontend-auth.md | Login, Logout, Language switch |
| User Management | frontend-user-management.md | List, Create, Edit, Delete |
| Employer Settings | frontend-employer-settings.md | Company configuration |
| Contractor Management | frontend-contractor-management.md | Contractor CRUD |
| Project Settings | frontend-project-settings.md | Project CRUD |
| Workspace Areas | frontend-workspace-area-settings.md | Area CRUD |
| Training Enrollment | frontend-training-enrollment.md | Enrollment workflow |
Test Case Index
| Test ID | Feature | Description | Status |
|---|---|---|---|
| TC-USER-001 | User Management | Create user with role | ✅ |
| TC-USER-002 | User Management | Edit user permissions | ✅ |
| TC-CONT-001 | Contractor Management | Register new contractor | ✅ |
| TC-CONT-002 | Contractor Management | Add workers to contractor | ✅ |
| TC-PROJ-001 | Project Settings | Create project | ✅ |
| TC-PROJ-002 | Project Settings | Assign Work Owner | ✅ |
| TC-WORK-001 | Worker Registration | Create worker profile | 🚧 Needs Tests |
| TC-WORK-002 | Worker Registration | Training status tracking | 🚧 Needs Tests |
| TC-TRAIN-001 | Training Management | Create training schedule | 🚧 Needs Tests |
| TC-TRAIN-002 | Training Management | Record attendance | 🚧 Needs Tests |
| TC-JSA-TPL-001 | JSA Template | Create template | 🚧 Needs Tests |
| TC-WSA-001 | Workspace Area | CRUD operations | ✅ |
4. Document Forms (Permit-to-Work)
Form components for safety permits with role-based edit permissions.
| Form Type | Test Coverage | Key Sections |
|---|---|---|
| General Work Permit | 🚧 Needs Tests | Part 1-4, Signatures |
| Work at Height | 🚧 Needs Tests | Equipment checklist |
| Hot Work | 🚧 Needs Tests | Fire watch requirements |
| Confined Space | 🚧 Needs Tests | Entry/exit log |
| High Voltage | 🚧 Needs Tests | LOTO verification |
| Chemical Work | 🚧 Needs Tests | MSDS references |
| Radiation Work | 🚧 Needs Tests | Dosimeter readings |
| Excavation | 🚧 Needs Tests | Utility clearance |
Planned Test Cases
| Test ID | Form | Description | Priority |
|---|---|---|---|
| TC-PTW-GEN-001 | General Work Permit | Complete form lifecycle | High |
| TC-PTW-GEN-002 | General Work Permit | Role-based edit permissions | High |
| TC-PTW-HEIGHT-001 | Work at Height | Equipment checklist validation | Medium |
| TC-PTW-HOT-001 | Hot Work | Fire watch signature flow | Medium |
| TC-PTW-CONF-001 | Confined Space | Entry permit flow | Medium |
5. Platform & Infrastructure
Cross-cutting capabilities that support all features.
| Feature | Test Coverage | Quick Test |
|---|---|---|
| Authentication | frontend-auth.md | Login → Access protected route → Logout |
| Multi-Tenancy | Needs Tests | Login to different tenant → Verify data isolation |
| Role-Based Access | Needs Tests | Login as different roles → Verify menu/actions |
| Dashboard | Needs Tests | View metrics → Navigate to features |
| Notifications (Inbox) | Needs Tests | Receive notification → Mark as read |
| Notifications (Email) | Needs Tests | Trigger email → Check smtp.iotserver.in.th |
Test Case Index
| Test ID | Feature | Description | Status |
|---|---|---|---|
| TC-AUTH-001 | Authentication | Login with valid credentials | ✅ |
| TC-AUTH-002 | Authentication | Token refresh | ✅ |
| TC-AUTH-003 | Authentication | Logout clears session | ✅ |
| TC-RBAC-001 | Role-Based Access | Admin sees all menu items | 🚧 Needs Tests |
| TC-RBAC-002 | Role-Based Access | Contractor sees limited menu | 🚧 Needs Tests |
| TC-NOTIF-001 | Inbox Notifications | Notification appears | 🚧 Needs Tests |
| TC-NOTIF-002 | Inbox Notifications | Auto-read on view | 🚧 Needs Tests |
| TC-EMAIL-001 | Email Notifications | Email sent on approval | 🚧 Needs Tests |
6. E2E Test Suites
Automated end-to-end tests using Playwright.
| Suite | Location | Description |
|---|---|---|
| E2E Tests | frontend-e2e-tests.md | Overview of automated tests |
| Prototype Tests | prototype/index.md | Workflow prototype tests |
Test Accounts
Use these accounts for testing (thaiscada tenant):
| Role | Password | |
|---|---|---|
| Admin | tn@thaiscada.com | Test1234* |
| Safety Officer | safety-supervisor@outlook.com | Test1234* |
| Contractor | safety-contractor1-0@outlook.com | Test1234* |
| Purchasing | safety-purchasing@outlook.com | Test1234* |
| Work Owner | safety-owner@outlook.com | Test1234* |
| Workspace Owner | safety-workspace-owner@outlook.com | Test1234* |
How to Use This Documentation
For Manual Testing
- Find your feature in the sections above
- Check the Test Coverage column - if linked, follow the link
- If "Needs Tests" - use the Quick Test column as a starting point
- Report results using the status icons:
- ✅ Pass
- ❌ Fail (create GitHub issue)
- 🚧 Not yet tested
For Creating New Test Cases
- Copy an existing test case file as template
- Follow the format in
.claude/rules/testing.md(project guidelines) - Use English for test case titles
- Include exact Thai labels from source code
- Add
[Screenshot: description]placeholders
Status Legend
| Icon | Meaning |
|---|---|
| ✅ | Tests documented and passing |
| 🚧 Needs Tests | Feature exists but no test documentation |
| 🔍 In Review | Tests written, awaiting verification |
| ⌛ Pending | Test 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)