Project Settings - Frontend Manual Test Cases
Test Environment: http://localhost:4200 [or test server URL]
Tester: _______________
Date: _______________
Prerequisites
- Backend server running on
http://localhost:5000 - Frontend running on
http://localhost:4200 - Test accounts available (see Test Data section)
- Modern browser (Chrome recommended)
- At least one contractor exists in the system (for project creation)
Test Data
Test Users
| Role | Password | Access Level | |
|---|---|---|---|
| Admin (Tenant Administrator) | tn@thaiscada.com | Test1234* | Full access - can create/edit/delete all projects |
| Work Owner | safety-owner@outlook.com | Test1234* | Partial - can edit only own projects |
| Purchasing | safety-purchasing@outlook.com | Test1234* | Full access - can create/edit/delete all projects |
| Contractor | safety-contractor1-0@outlook.com | Test1234* | No access - 403 Forbidden |
Test Data for Creating/Editing Projects
| Field | Value |
|---|---|
| Project Name | โครงการทดสอบ E2E |
| PR No. (required) | PR-TEST-001 |
| PO No. | PO-TEST-001 |
| Description | รายละเอียดโครงการทดสอบ |
Navigation Path
Admin/Purchasing: กำหนดค่าโครงการ (Project Settings) → โครงการ (Projects)
URL: /tools/settings/project
Test Summary
| Category | Total | Dev | QA |
|---|---|---|---|
| 1. Navigation & Access | 4 | ||
| 2. View Project List | 3 | ||
| 3. Create Project | 4 | ||
| 4. Edit Project | 3 | ||
| 5. Delete Project | 3 | ||
| 6. Tab Navigation | 3 | ||
| Total | 20 |
1. Navigation & Access Tests
TC-PRJ-M001: Purchasing can access project settings
Precondition: User is logged in as Purchasing role (safety-purchasing@outlook.com)
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "กำหนดค่าโครงการ" menu in sidebar | Settings page opens | [ ] | [ ] |
| 2 | Locate "โครงการ" (Projects) menu item | Menu item visible | [ ] | [ ] |
| 3 | Click "โครงการ" (Projects) | Page loads | [ ] | [ ] |
| 4 | Verify URL | URL is /tools/settings/project | [ ] | [ ] |
| 5 | Verify page content | Project list table displayed | [ ] | [ ] |
| 6 | Verify "สร้าง" (Create) button visible | Button visible in toolbar | [ ] | [ ] |
[Screenshot: Project settings page with list and toolbar]
Notes: Purchasing has project-mgmt role with full access (create/edit/delete all projects)
TC-PRJ-M002: Admin can access project settings
Precondition: User is logged in as Tenant Administrator role
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as Admin: tn@thaiscada.com | Login successful | [ ] | [ ] |
| 2 | Navigate to กำหนดค่าโครงการ → โครงการ | Project settings page loads | [ ] | [ ] |
| 3 | Verify URL | URL is /tools/settings/project | [ ] | [ ] |
| 4 | Verify project list displayed | Table with projects visible | [ ] | [ ] |
| 5 | Verify "สร้าง" (Create) button visible | Button visible - Admin can create | [ ] | [ ] |
[Screenshot: Admin user project settings view]
Notes: Admin has full access via tenant administrator role
TC-PRJ-M003: Work Owner view (restricted access)
Precondition: User is logged in as Work Owner role
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as Work Owner: safety-owner@outlook.com | Login successful | [ ] | [ ] |
| 2 | Navigate to กำหนดค่าโครงการ → โครงการ | Project settings page loads | [ ] | [ ] |
| 3 | Verify "สร้าง" (Create) button | Button should be HIDDEN | [ ] | [ ] |
| 4 | Verify own projects have "กำหนดค่า" button | Can edit own projects | [ ] | [ ] |
| 5 | Verify other projects have "ดูข้อมูล" button | View-only for others' projects | [ ] | [ ] |
[Screenshot: Work Owner view - no create button, mixed edit/view buttons]
Notes: Work Owner can only edit projects where they are the workOwnerUserId
TC-PRJ-M004: Contractor cannot access project settings
Precondition: User is logged in as Contractor role
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as Contractor: safety-contractor1-0@outlook.com | Login successful, redirected to /tasks/my-tasks | [ ] | [ ] |
| 2 | Directly navigate to /tools/settings/project | Access denied or redirected | [ ] | [ ] |
| 3 | Verify error | Should show 403 or redirect away | [ ] | [ ] |
[Screenshot: Contractor access denied message]
Notes: Contractor role does NOT have project-mgmt permission (403 Forbidden from API)
2. View Project List Tests
TC-PRJ-M005: View project list with table columns
Precondition: Logged in as Purchasing, on Project Settings page
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to Project Settings page | Page loads with project list | [ ] | [ ] |
| 2 | Verify table headers | Columns: ชื่อโครงการ, เลขที่ใบขอซื้อ, เลขที่ใบสั่งซื้อ, ผู้รับเหมา, สถานะ, Actions | [ ] | [ ] |
| 3 | Verify project rows | Each row shows project data correctly | [ ] | [ ] |
| 4 | Verify row actions | "กำหนดค่า" button and menu (expand_more icon) | [ ] | [ ] |
[Screenshot: Project list table with headers]
Notes: _______________
TC-PRJ-M006: Empty state display
Precondition: No projects exist in the system
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to Project Settings page | Page loads | [ ] | [ ] |
| 2 | Verify empty state message | "ไม่พบข้อมูล" displayed in table | [ ] | [ ] |
| 3 | Verify "สร้าง" button still visible | Purchasing can still create new project | [ ] | [ ] |
[Screenshot: Empty project list]
Notes: _______________
TC-PRJ-M007: Search projects
Precondition: Multiple projects exist
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate search input in toolbar | Search input visible | [ ] | [ ] |
| 2 | Enter search keyword | Filter applied (if implemented) | [ ] | [ ] |
| 3 | Click "รีเฟรช" button | List refreshes | [ ] | [ ] |
[Screenshot: Search functionality]
Notes: Backend keyword search may not be fully implemented
3. Create Project Tests
TC-PRJ-M008: Create new project (happy path)
Precondition: Logged in as Purchasing, contractors exist in system
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "สร้าง" (Create) button | Form opens with 3 tabs | [ ] | [ ] |
| 2 | Verify default tab | "ข้อมูลการจัดซื้อ" tab active | [ ] | [ ] |
| 3 | Fill PR No.: PR-TEST-001 | Input accepts value | [ ] | [ ] |
| 4 | Fill PO No.: PO-TEST-001 | Input accepts value | [ ] | [ ] |
| 5 | Click "ข้อมูลโครงการ" tab | Tab switches | [ ] | [ ] |
| 6 | Fill project name: โครงการทดสอบ | Input accepts value | [ ] | [ ] |
| 7 | Click "ข้อมูลผู้รับเหมา" tab | Tab switches | [ ] | [ ] |
| 8 | Select contractor from dropdown | Contractor selected | [ ] | [ ] |
| 9 | Select coordinator (ผู้ประสานงาน) | User selected from dropdown | [ ] | [ ] |
| 10 | Select supervisor (ผู้ควบคุมงาน) | User selected from dropdown | [ ] | [ ] |
| 11 | Click "บันทึก" (Save) button | Snackbar shows "บันทึกสำเร็จ" | [ ] | [ ] |
| 12 | Verify project in list | New project appears in table | [ ] | [ ] |
[Screenshot: Create project form with all tabs]
Notes: Coordinator and Supervisor dropdowns populate based on selected contractor's users
TC-PRJ-M009: Required field validation (PR No.)
Precondition: Logged in as Purchasing, on create form
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "สร้าง" (Create) button | Form opens | [ ] | [ ] |
| 2 | Leave PR No. empty | Field shows red outline/error | [ ] | [ ] |
| 3 | Try to click "บันทึก" (Save) | Button disabled OR validation shown | [ ] | [ ] |
| 4 | Verify validation message | Required fields listed in warning banner | [ ] | [ ] |
[Screenshot: Validation error for required fields]
Notes: Warning banner shows: "กรุณากรอกข้อมูลที่จำเป็น" with list of missing fields
TC-PRJ-M010: Duplicate PR No. validation
Precondition: Project with PR No. "PR-TEST-001" already exists
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "สร้าง" (Create) button | Form opens | [ ] | [ ] |
| 2 | Fill PR No.: PR-TEST-001 (duplicate) | Input accepts value | [ ] | [ ] |
| 3 | Fill all other required fields | Form filled | [ ] | [ ] |
| 4 | Click "บันทึก" (Save) | API returns 400 error | [ ] | [ ] |
| 5 | Verify error message | Snackbar: "PR No. นี้ถูกใช้งานแล้วในโครงการอื่น" | [ ] | [ ] |
[Screenshot: Duplicate PR No. error message]
Notes: Backend validates PR No. uniqueness per tenant
TC-PRJ-M011: Cancel create operation
Precondition: On create form with data entered
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Fill some form fields | Data entered | [ ] | [ ] |
| 2 | Click "ยกเลิก" (Cancel) button | Returns to list | [ ] | [ ] |
| 3 | Verify list | No new project created | [ ] | [ ] |
[Screenshot: Cancel button]
Notes: _______________
4. Edit Project Tests
TC-PRJ-M012: Edit project from list (Purchasing)
Precondition: Project exists, logged in as Purchasing
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate project row | Row visible in table | [ ] | [ ] |
| 2 | Click "กำหนดค่า" (Edit) button | Form opens with existing data | [ ] | [ ] |
| 3 | Verify PR No. field has value | Existing PR No. displayed | [ ] | [ ] |
| 4 | Modify project name | Field accepts new value | [ ] | [ ] |
| 5 | Click "บันทึก" (Save) | Snackbar shows success | [ ] | [ ] |
| 6 | Verify changes in list | Updated data displayed | [ ] | [ ] |
[Screenshot: Edit project form with data]
Notes: _______________
TC-PRJ-M013: Work Owner edit own project
Precondition: Logged in as Work Owner, viewing own project
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate own project (where you are Work Owner) | "กำหนดค่า" button visible | [ ] | [ ] |
| 2 | Click "กำหนดค่า" | Form opens | [ ] | [ ] |
| 3 | Verify editable fields | Can edit project info fields | [ ] | [ ] |
| 4 | Modify a field and save | Changes saved successfully | [ ] | [ ] |
[Screenshot: Work Owner editing own project]
Notes: Work Owner can only edit projects where workOwnerUserId matches their user ID
TC-PRJ-M014: Work Owner view-only for others' projects
Precondition: Logged in as Work Owner, viewing another user's project
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate another user's project | "ดูข้อมูล" button visible (not "กำหนดค่า") | [ ] | [ ] |
| 2 | Click "ดูข้อมูล" (View) | Form opens in view mode | [ ] | [ ] |
| 3 | Verify fields are read-only | Cannot edit any fields | [ ] | [ ] |
[Screenshot: View-only mode for non-owner]
Notes: _______________
5. Delete Project Tests
TC-PRJ-M015: Delete project (no dependencies)
Precondition: Logged in as Purchasing, project exists with no linked tasks
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate project row | Row visible | [ ] | [ ] |
| 2 | Click menu button (expand_more icon) | Menu opens | [ ] | [ ] |
| 3 | Click "ลบ" (Delete) menu item | Confirmation dialog appears | [ ] | [ ] |
| 4 | Click "ตกลง" (Confirm) in dialog | Project deleted | [ ] | [ ] |
| 5 | Verify project removed from list | Row no longer visible | [ ] | [ ] |
| 6 | Verify success message | Snackbar shows "ลบสำเร็จ" | [ ] | [ ] |
[Screenshot: Delete confirmation dialog]
Notes: _______________
TC-PRJ-M016: Delete project with linked tasks (FK constraint)
Precondition: Logged in as Purchasing, project exists with linked workflow tasks
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate project with linked tasks | Row visible | [ ] | [ ] |
| 2 | Click menu → "ลบ" (Delete) | Confirmation dialog | [ ] | [ ] |
| 3 | Click "ตกลง" (Confirm) | Error occurs | [ ] | [ ] |
| 4 | Verify error message | Snackbar: "Project is currently in use" or similar | [ ] | [ ] |
| 5 | Verify project NOT deleted | Project still in list | [ ] | [ ] |
[Screenshot: FK constraint error]
Notes: Backend returns 400 Bad Request when project has linked tasks
TC-PRJ-M017: Cancel delete operation
Precondition: On delete confirmation dialog
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click menu → "ลบ" (Delete) | Confirmation dialog opens | [ ] | [ ] |
| 2 | Click "ยกเลิก" (Cancel) or close dialog | Dialog closes | [ ] | [ ] |
| 3 | Verify project still exists | Project remains in list | [ ] | [ ] |
[Screenshot: Delete dialog with cancel option]
Notes: _______________
6. Tab Navigation Tests
TC-PRJ-M018: Tab 1 - Purchasing Info (ข้อมูลการจัดซื้อ)
Precondition: On project form (create or edit)
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "ข้อมูลการจัดซื้อ" tab | Tab activates | [ ] | [ ] |
| 2 | Verify fields displayed | PR No., PO No., Duration, Date Range, Notes | [ ] | [ ] |
| 3 | Verify field labels | เลขที่ใบขอซื้อ (PR. No.), เลขที่ใบสั่งซื้อ (PO No.) | [ ] | [ ] |
[Screenshot: Purchasing Info tab]
Notes: PR No. is required field (marked with asterisk)
TC-PRJ-M019: Tab 2 - Project Info (ข้อมูลโครงการ)
Precondition: On project form
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "ข้อมูลโครงการ" tab | Tab activates | [ ] | [ ] |
| 2 | Verify fields displayed | Name, Description, Workspace Area, Work Owner, Safety Officer, Workspace Owner | [ ] | [ ] |
| 3 | Verify field labels | ชื่อโครงการ, รายละเอียด, พื้นที่ทำงาน, เจ้าของงาน, etc. | [ ] | [ ] |
[Screenshot: Project Info tab]
Notes: _______________
TC-PRJ-M020: Tab 3 - Contractor Info (ข้อมูลผู้รับเหมา)
Precondition: On project form
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "ข้อมูลผู้รับเหมา" tab | Tab activates | [ ] | [ ] |
| 2 | Verify fields displayed | Contractor, Coordinator, Supervisor, Email, Mobile | [ ] | [ ] |
| 3 | Select contractor from dropdown | Options from contractor list | [ ] | [ ] |
| 4 | Verify coordinator dropdown populates | Users linked to selected contractor | [ ] | [ ] |
| 5 | Verify supervisor dropdown populates | Users linked to selected contractor | [ ] | [ ] |
[Screenshot: Contractor Info tab with dropdowns]
Notes: Coordinator (ผู้ประสานงาน) and Supervisor (ผู้ควบคุมงาน) are required fields
Sign-Off
| Role | Name | Date | Signature |
|---|---|---|---|
| Developer | |||
| QA Engineer | |||
| Product Owner |
Labels verified against:
project-setting-list.component.ts(table headers, menu actions)project-setting-form-purchasing.component.ts(Purchasing tab fields)project-setting-form-general.component.ts(Project Info tab fields)project-setting-form-contractor.component.ts(Contractor tab fields)