User Management - 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)
Test Data
Test Users
| Role | Password | Access Level | |
|---|---|---|---|
| Admin (Tenant Administrator) | tn@thaiscada.com [or your admin email] | Test1234* | Full access - can manage all user types |
| Purchasing | safety-purchasing@outlook.com [or your purchasing email] | Test1234* | Can only manage Contractor users |
| Work Owner | safety-owner@outlook.com [or your work owner email] | Test1234* | Can manage users similar to Admin |
| Contractor | safety-contractor1-0@outlook.com [or your contractor email] | Test1234* | No access to user management |
Test Data for Creating Users
| Field | Value |
|---|---|
| Test Email | test-user@example.com [or your test email] |
| First Name (Thai) | ทดสอบ [or your test name] |
| Last Name (Thai) | ระบบ [or your test name] |
| Mobile | 0812345678 [or your test phone] |
| Responsibility Areas | พื้นที่ทดสอบ [or your test area] |
| Company Name (Thai) | บริษัท ทดสอบ จำกัด [or your company name] |
| Company Name (English) | Test Company Ltd. [or your company name] |
| Address | 123 ถนนทดสอบ กรุงเทพฯ 10110 [or your address] |
Navigation Path
Admin/WorkOwner: กำหนดค่า (Settings) → ผู้ใช้งาน (Users)
Purchasing: กำหนดค่า (Settings) → ผู้รับเหมา (Contractors)
URL: /tools/settings/user
Test Summary
| Category | Total | Dev | QA |
|---|---|---|---|
| 1. Navigation & Access | 4 | ||
| 2. View User List | 4 | ||
| 3. Create User (Admin) | 5 | ||
| 4. Create Contractor (Purchasing) | 4 | ||
| 5. Edit User | 4 | ||
| 6. Send Invitation | 3 | ||
| 7. Delete User | 3 | ||
| Total | 27 |
1. Navigation & Access Tests
TC-USR-M001: Admin can access user management
Precondition: User is logged in as Tenant Administrator
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "กำหนดค่า" (Settings) menu in header | Settings dropdown menu opens | [ ] | [ ] |
| 2 | Locate "ผู้ใช้งาน" (Users) menu item | Menu item visible | [ ] | [ ] |
| 3 | Click "ผู้ใช้งาน" (Users) | Page loads | [ ] | [ ] |
| 4 | Verify URL | URL is /tools/settings/user | [ ] | [ ] |
| 5 | Verify page content | User management page with role tabs displayed | [ ] | [ ] |
| 6 | Verify role tabs visible | Tabs: จัดซื้อ, เจ้าของงาน, เจ้าหน้าที่ความปลอดภัย, เจ้าของพื้นที่ | [ ] | [ ] |
[Screenshot: กำหนดค่า menu with ผู้ใช้งาน option] [Screenshot: User Management page with role tabs]
Notes: _______________
TC-USR-M002: Purchasing can access user management (contractor only)
Precondition: User is logged in as Purchasing role
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Login as Purchasing: safety-purchasing@outlook.com | Login successful, redirected to my-tasks | [ ] | [ ] |
| 2 | Navigate to กำหนดค่า → ผู้รับเหมา | User management page loads | [ ] | [ ] |
| 3 | Verify URL | URL is /tools/settings/user | [ ] | [ ] |
| 4 | Verify NO role tabs visible | Role tabs (จัดซื้อ, เจ้าของงาน, etc.) should NOT be visible | [ ] | [ ] |
| 5 | Verify contractor list displayed | Single table showing contractor users only | [ ] | [ ] |
| 6 | Verify create button | "สร้าง" button visible (creates contractor directly) | [ ] | [ ] |
[Screenshot: Purchasing view - no role tabs, contractor list only]
Notes: Purchasing role can only see and manage contractor users
TC-USR-M003: Contractor cannot access user management
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 my-tasks | [ ] | [ ] |
| 2 | Look for "กำหนดค่า" (Settings) menu | Settings menu may be visible | [ ] | [ ] |
| 3 | Look for "ผู้ใช้งาน" or "ผู้รับเหมา" menu items | Menu items should NOT be visible | [ ] | [ ] |
| 4 | Try direct URL: /tools/settings/user | Access denied or redirected | [ ] | [ ] |
| 5 | Verify access blocked | Either: error message, redirect away, or empty page | [ ] | [ ] |
[Screenshot: Contractor menu without Users option] [Screenshot: Access denied when navigating directly]
Notes: _______________
TC-USR-M004: Work Owner can access user management
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 กำหนดค่า → ผู้ใช้งาน | User management page loads | [ ] | [ ] |
| 3 | Verify role tabs visible | Tabs visible similar to Admin view | [ ] | [ ] |
| 4 | Verify create functionality | Can create users | [ ] | [ ] |
[Screenshot: Work Owner user management view]
Notes: Work Owner has similar access to Admin for user management
2. View User List Tests
TC-USR-M005: View user list with role tabs (Admin view)
Precondition: Logged in as Admin, on User Management page
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to User Management page | Page loads with role tabs | [ ] | [ ] |
| 2 | Verify default tab | First tab (จัดซื้อ - Purchasing) is active | [ ] | [ ] |
| 3 | Verify table headers | Columns: Email, ชื่อ (Name), สถานะ (Status), ค่าเริ่มต้น (Default) | [ ] | [ ] |
| 4 | Verify row actions | Each row has "กำหนดค่า" (Edit) button and options menu (expand icon) | [ ] | [ ] |
| 5 | Verify user count | Number of users displayed matches tab content | [ ] | [ ] |
[Screenshot: User list table with headers]
Notes: _______________
TC-USR-M006: Switch between role tabs
Precondition: On User Management page as Admin
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "เจ้าของงาน" (Work Owner) tab | Tab becomes active | [ ] | [ ] |
| 2 | Verify table content changes | Shows Work Owner users | [ ] | [ ] |
| 3 | Click "เจ้าหน้าที่ความปลอดภัย" (Safety Officer) tab | Tab becomes active | [ ] | [ ] |
| 4 | Verify table content changes | Shows Safety Officer users | [ ] | [ ] |
| 5 | Click "เจ้าของพื้นที่" (Workspace Owner) tab | Tab becomes active | [ ] | [ ] |
| 6 | Verify table content changes | Shows Workspace Owner users | [ ] | [ ] |
[Screenshot: Different role tab selected]
Notes: Each tab shows users with that specific role
TC-USR-M007: Search users by keyword
Precondition: On User Management page with users in list
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate search field | Search input visible in toolbar | [ ] | [ ] |
| 2 | Enter email keyword (e.g., "safety") | Search accepts input | [ ] | [ ] |
| 3 | Press Enter or wait | Table filters to matching users | [ ] | [ ] |
| 4 | Verify filtered results | Only users with "safety" in email shown | [ ] | [ ] |
| 5 | Clear search field | All users shown again | [ ] | [ ] |
[Screenshot: Search field with keyword] [Screenshot: Filtered search results]
Notes: _______________
TC-USR-M008: View contractor list (Purchasing view - no tabs)
Precondition: Logged in as Purchasing role
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Navigate to User Management page | Page loads | [ ] | [ ] |
| 2 | Verify no role tabs | Only single contractor table shown | [ ] | [ ] |
| 3 | Verify contractor list | Shows contractor users with company info | [ ] | [ ] |
| 4 | Verify table headers | May include: company name, contact person, email | [ ] | [ ] |
[Screenshot: Purchasing view with contractor list]
Notes: Purchasing sees simplified view with only contractor management
3. Create User Tests (Admin)
TC-USR-M009: Open create menu and see role options
Precondition: Logged in as Admin, on User Management page
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate "สร้าง" (Create) button in toolbar | Button visible | [ ] | [ ] |
| 2 | Click "สร้าง" button | Dropdown menu opens | [ ] | [ ] |
| 3 | Verify menu options | Options: จัดซื้อ, เจ้าของงาน, เจ้าหน้าที่ความปลอดภัย, เจ้าของพื้นที่ | [ ] | [ ] |
| 4 | Click outside menu | Menu closes | [ ] | [ ] |
[Screenshot: Create dropdown with role options]
Notes: Admin can create Purchasing, WorkOwner, SafetyOfficer, WorkspaceOwner users (NOT Contractor)
TC-USR-M010: Create WorkspaceOwner user
Precondition: Create menu is open
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "เจ้าของพื้นที่" (WorkspaceOwner) option | Form opens | [ ] | [ ] |
| 2 | Wait for form to load | User creation form displayed | [ ] | [ ] |
| 3 | Enter Email: test-user@example.com | Email field accepts input | [ ] | [ ] |
| 4 | Enter Mobile: 0812345678 | Mobile field accepts input | [ ] | [ ] |
| 5 | Enter First Name: ทดสอบ | First name field accepts Thai input | [ ] | [ ] |
| 6 | Enter Last Name: ระบบ | Last name field accepts Thai input | [ ] | [ ] |
| 7 | Enter Responsibility Areas: พื้นที่ทดสอบ | Area field accepts input | [ ] | [ ] |
| 8 | Click "บันทึก" (Save) button | Save triggered | [ ] | [ ] |
| 9 | Wait for save to complete | Success snackbar appears | [ ] | [ ] |
| 10 | Verify user in list | New user appears in WorkspaceOwner tab | [ ] | [ ] |
[Screenshot: WorkspaceOwner creation form] [Screenshot: Success snackbar after creation]
Notes: _______________
TC-USR-M011: Create SafetyOfficer user
Precondition: Create menu is open
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "เจ้าหน้าที่ความปลอดภัย" (SafetyOfficer) option | Form opens | [ ] | [ ] |
| 2 | Fill required fields (email, mobile, name) | Fields accept input | [ ] | [ ] |
| 3 | Click "บันทึก" (Save) button | Save triggered | [ ] | [ ] |
| 4 | Wait for save to complete | Success snackbar appears | [ ] | [ ] |
| 5 | Navigate to SafetyOfficer tab | User appears in list | [ ] | [ ] |
[Screenshot: SafetyOfficer creation form]
Notes: _______________
TC-USR-M012: Validate required fields
Precondition: On user creation form
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Leave all fields empty | Fields are empty | [ ] | [ ] |
| 2 | Click "บันทึก" (Save) button | Form validation triggers | [ ] | [ ] |
| 3 | Verify email error | Email field shows required error | [ ] | [ ] |
| 4 | Verify mobile error | Mobile field may show required error | [ ] | [ ] |
| 5 | Enter only email | Some required fields still empty | [ ] | [ ] |
| 6 | Click "บันทึก" again | Remaining validation errors shown | [ ] | [ ] |
[Screenshot: Validation errors on empty form]
Notes: _______________
TC-USR-M013: Duplicate email validation
Precondition: User with email already exists in system
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Open create user form | Form displayed | [ ] | [ ] |
| 2 | Enter existing email: tn@thaiscada.com [or known existing email] | Email field accepts input | [ ] | [ ] |
| 3 | Fill other required fields | Fields filled | [ ] | [ ] |
| 4 | Click "บันทึก" (Save) | Save attempted | [ ] | [ ] |
| 5 | Verify error message | Error indicates email already exists | [ ] | [ ] |
| 6 | Verify form remains open | Can correct the email | [ ] | [ ] |
[Screenshot: Duplicate email error]
Notes: _______________
4. Create Contractor Tests (Purchasing)
TC-USR-M014: Purchasing sees direct create button (no dropdown)
Precondition: Logged in as Purchasing role, on User Management page
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate "สร้าง" (Create) button | Button visible in toolbar | [ ] | [ ] |
| 2 | Click "สร้าง" button | Form opens DIRECTLY (no dropdown menu) | [ ] | [ ] |
| 3 | Verify contractor form | Company info section visible | [ ] | [ ] |
[Screenshot: Purchasing create button leading directly to form]
Notes: Unlike Admin, Purchasing clicks create and goes directly to contractor form
TC-USR-M015: Fill company information
Precondition: On contractor creation form (as Purchasing)
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Verify section header | "ข้อมูลบริษัทผู้รับเหมา" (Contractor Company Info) visible | [ ] | [ ] |
| 2 | Enter Company Name (Thai): บริษัท ทดสอบ จำกัด | Thai text accepted | [ ] | [ ] |
| 3 | Enter Company Name (English): Test Company Ltd. | English text accepted | [ ] | [ ] |
| 4 | Enter Address: 123 ถนนทดสอบ กรุงเทพฯ 10110 | Address field accepts input | [ ] | [ ] |
| 5 | Enter Website (optional): https://test.com | Website field accepts input | [ ] | [ ] |
[Screenshot: Company info section filled]
Notes: _______________
TC-USR-M016: Fill contact person information
Precondition: Company info filled, on same form
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Verify section header | "ผู้ประสานงานหลัก" (Main Contact Person) visible | [ ] | [ ] |
| 2 | Enter First Name: ทดสอบ | First name field accepts Thai | [ ] | [ ] |
| 3 | Enter Last Name: ผู้รับเหมา | Last name field accepts Thai | [ ] | [ ] |
| 4 | Enter Email: test-contractor@example.com | Email field accepts input | [ ] | [ ] |
| 5 | Enter Mobile: 0898765432 | Mobile field accepts input | [ ] | [ ] |
[Screenshot: Contact person section filled]
Notes: _______________
TC-USR-M017: Save contractor successfully
Precondition: All contractor form fields filled
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Verify all required fields filled | Company name (Thai/English), address, contact info | [ ] | [ ] |
| 2 | Click "บันทึก" (Save) button | Save triggered | [ ] | [ ] |
| 3 | Wait for save to complete | Loading indicator, then success | [ ] | [ ] |
| 4 | Verify success snackbar | "บันทึกสำเร็จ" or similar message | [ ] | [ ] |
| 5 | Verify contractor in list | New contractor appears in table | [ ] | [ ] |
[Screenshot: Save button clicked] [Screenshot: Success snackbar] [Screenshot: New contractor in list]
Notes: _______________
5. Edit User Tests
TC-USR-M018: Click edit button to open edit form
Precondition: On User Management page with users in list
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate a user row in the table | User row visible with email | [ ] | [ ] |
| 2 | Click "กำหนดค่า" (Edit) button on the row | Edit form opens | [ ] | [ ] |
| 3 | Verify form loaded | Form displays user's current information | [ ] | [ ] |
| 4 | Verify fields populated | Email, name, mobile show existing values | [ ] | [ ] |
[Screenshot: User row with กำหนดค่า button] [Screenshot: Edit form with populated data]
Notes: _______________
TC-USR-M019: Edit user information
Precondition: User edit form is open
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Note current mobile number | Record existing value | [ ] | [ ] |
| 2 | Clear mobile field | Field is empty | [ ] | [ ] |
| 3 | Enter new mobile: 0899999999 | New number entered | [ ] | [ ] |
| 4 | Note current first name | Record existing value | [ ] | [ ] |
| 5 | Modify first name | Name updated | [ ] | [ ] |
| 6 | Verify changes in form | Form shows new values | [ ] | [ ] |
[Screenshot: Form with edited values]
Notes: _______________
TC-USR-M020: Save changes successfully
Precondition: User information has been edited
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "บันทึก" (Save) button | Save triggered | [ ] | [ ] |
| 2 | Wait for save to complete | Progress indicator, then success | [ ] | [ ] |
| 3 | Verify success snackbar | "บันทึกสำเร็จ" or similar message | [ ] | [ ] |
| 4 | Navigate back to user list | List displayed | [ ] | [ ] |
| 5 | Find edited user | User row visible | [ ] | [ ] |
| 6 | Verify changes persisted | Updated info shown in table | [ ] | [ ] |
[Screenshot: Success snackbar after save] [Screenshot: Updated user in list]
Notes: _______________
TC-USR-M021: Cancel edit discards changes
Precondition: User edit form is open with changes made
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Make changes to user form | Values modified | [ ] | [ ] |
| 2 | Click "ยกเลิก" (Cancel) button or navigate away | Cancel action triggered | [ ] | [ ] |
| 3 | If confirmation dialog appears, confirm | Dialog accepted | [ ] | [ ] |
| 4 | Verify returned to list | User list displayed | [ ] | [ ] |
| 5 | Click same user again | Edit form opens | [ ] | [ ] |
| 6 | Verify original values | Changes were NOT saved | [ ] | [ ] |
[Screenshot: Cancel button or back navigation]
Notes: _______________
6. Send Invitation Tests
TC-USR-M022: Open options menu on user row
Precondition: On User Management page with users in list
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Locate a user row | User row visible | [ ] | [ ] |
| 2 | Find options button (three dots or expand icon) | Button at end of row | [ ] | [ ] |
| 3 | Click options button | Dropdown menu opens | [ ] | [ ] |
| 4 | Verify menu options | Options: ส่งอีเมล์เทียบเชิญ (Send Invitation), ตั้งเป็นค่าเริ่มต้น/ยกเลิกเป็นค่าเริ่มต้น (Set/Unset Default), ลบ (Delete) | [ ] | [ ] |
[Screenshot: Options menu open with actions]
Notes: _______________
TC-USR-M023: Click send invitation
Precondition: Options menu is open for a user
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "ส่งอีเมล์เทียบเชิญ" (Send Invitation Email) | Action triggered | [ ] | [ ] |
| 2 | Verify confirmation dialog appears | Dialog with confirm/cancel buttons | [ ] | [ ] |
| 3 | Verify dialog text | Message asking to confirm sending invitation | [ ] | [ ] |
[Screenshot: Invitation confirmation dialog]
Notes: _______________
TC-USR-M024: Confirm and verify success dialog
Precondition: Invitation confirmation dialog is showing
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "ตกลง" (OK) button in dialog | Invitation sent | [ ] | [ ] |
| 2 | Wait for email to be sent | Loading indicator | [ ] | [ ] |
| 3 | Verify success dialog appears | Dialog confirms email was sent | [ ] | [ ] |
| 4 | Click "ตกลง" (OK) to close success dialog | Dialog closes | [ ] | [ ] |
| 5 | Verify returned to user list | List displayed normally | [ ] | [ ] |
[Screenshot: Success dialog after sending invitation]
Notes: Check recipient's email inbox to verify email was actually received (optional verification)
7. Delete User Tests
TC-USR-M025: Click delete from options menu
Precondition: Options menu is open for a user
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "ลบ" (Delete) option | Action triggered | [ ] | [ ] |
| 2 | Verify confirmation dialog appears | Dialog asking to confirm deletion | [ ] | [ ] |
| 3 | Verify dialog shows user info | May show email or name of user to delete | [ ] | [ ] |
[Screenshot: Delete confirmation dialog]
Notes: _______________
TC-USR-M026: Confirm delete dialog
Precondition: Delete confirmation dialog is showing
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Click "ตกลง" (OK) button to confirm | Delete action triggered | [ ] | [ ] |
| 2 | Wait for delete to complete | Loading indicator | [ ] | [ ] |
| 3 | If successful, verify snackbar | "ลบสำเร็จ" or success message | [ ] | [ ] |
| 4 | Verify user removed from list | User no longer in table | [ ] | [ ] |
[Screenshot: Success snackbar after delete] [Screenshot: User list without deleted user]
Notes: _______________
TC-USR-M027: Handle FK constraint error (invited users)
Precondition: User has been invited (has Keycloak association)
| Step | Action | Expected Result | Dev | QA |
|---|---|---|---|---|
| 1 | Find a user who has been invited | User with invitation sent | [ ] | [ ] |
| 2 | Click options → Delete | Delete action triggered | [ ] | [ ] |
| 3 | Click "ตกลง" to confirm | Delete attempted | [ ] | [ ] |
| 4 | Wait for response | Server processes request | [ ] | [ ] |
| 5 | Verify error snackbar | "Delete failed" or error message appears | [ ] | [ ] |
| 6 | Verify user still in list | User was NOT deleted due to FK constraint | [ ] | [ ] |
[Screenshot: Delete failed error snackbar]
Notes: Users who have been invited cannot be deleted due to foreign key constraint with Keycloak. This is expected behavior.
Test Execution Notes
Tester Comments:
Issues Found:
| Issue ID | Test Case | Description | Severity |
|---|---|---|---|
Environment Details:
| Item | Value |
|---|---|
| Browser | |
| Browser Version | |
| OS | |
| Screen Resolution | |
| Backend URL | |
| Frontend URL |
Sign-off:
| Role | Name | Date | Signature |
|---|---|---|---|
| Tester | |||
| Reviewer |