Skip to main content

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

RoleEmailPasswordAccess Level
Admin (Tenant Administrator)tn@thaiscada.com [or your admin email]Test1234*Full access - can manage all user types
Purchasingsafety-purchasing@outlook.com [or your purchasing email]Test1234*Can only manage Contractor users
Work Ownersafety-owner@outlook.com [or your work owner email]Test1234*Can manage users similar to Admin
Contractorsafety-contractor1-0@outlook.com [or your contractor email]Test1234*No access to user management

Test Data for Creating Users

FieldValue
Test Emailtest-user@example.com [or your test email]
First Name (Thai)ทดสอบ [or your test name]
Last Name (Thai)ระบบ [or your test name]
Mobile0812345678 [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]
Address123 ถนนทดสอบ กรุงเทพฯ 10110 [or your address]

Admin/WorkOwner: กำหนดค่า (Settings) → ผู้ใช้งาน (Users) Purchasing: กำหนดค่า (Settings) → ผู้รับเหมา (Contractors) URL: /tools/settings/user

Test Summary

CategoryTotalDevQA
1. Navigation & Access4
2. View User List4
3. Create User (Admin)5
4. Create Contractor (Purchasing)4
5. Edit User4
6. Send Invitation3
7. Delete User3
Total27

1. Navigation & Access Tests

TC-USR-M001: Admin can access user management

Precondition: User is logged in as Tenant Administrator

StepActionExpected ResultDevQA
1Click "กำหนดค่า" (Settings) menu in headerSettings dropdown menu opens[ ][ ]
2Locate "ผู้ใช้งาน" (Users) menu itemMenu item visible[ ][ ]
3Click "ผู้ใช้งาน" (Users)Page loads[ ][ ]
4Verify URLURL is /tools/settings/user[ ][ ]
5Verify page contentUser management page with role tabs displayed[ ][ ]
6Verify role tabs visibleTabs: จัดซื้อ, เจ้าของงาน, เจ้าหน้าที่ความปลอดภัย, เจ้าของพื้นที่[ ][ ]

[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

StepActionExpected ResultDevQA
1Login as Purchasing: safety-purchasing@outlook.comLogin successful, redirected to my-tasks[ ][ ]
2Navigate to กำหนดค่า → ผู้รับเหมาUser management page loads[ ][ ]
3Verify URLURL is /tools/settings/user[ ][ ]
4Verify NO role tabs visibleRole tabs (จัดซื้อ, เจ้าของงาน, etc.) should NOT be visible[ ][ ]
5Verify contractor list displayedSingle table showing contractor users only[ ][ ]
6Verify 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

StepActionExpected ResultDevQA
1Login as Contractor: safety-contractor1-0@outlook.comLogin successful, redirected to my-tasks[ ][ ]
2Look for "กำหนดค่า" (Settings) menuSettings menu may be visible[ ][ ]
3Look for "ผู้ใช้งาน" or "ผู้รับเหมา" menu itemsMenu items should NOT be visible[ ][ ]
4Try direct URL: /tools/settings/userAccess denied or redirected[ ][ ]
5Verify access blockedEither: 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

StepActionExpected ResultDevQA
1Login as Work Owner: safety-owner@outlook.comLogin successful[ ][ ]
2Navigate to กำหนดค่า → ผู้ใช้งานUser management page loads[ ][ ]
3Verify role tabs visibleTabs visible similar to Admin view[ ][ ]
4Verify create functionalityCan 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

StepActionExpected ResultDevQA
1Navigate to User Management pagePage loads with role tabs[ ][ ]
2Verify default tabFirst tab (จัดซื้อ - Purchasing) is active[ ][ ]
3Verify table headersColumns: Email, ชื่อ (Name), สถานะ (Status), ค่าเริ่มต้น (Default)[ ][ ]
4Verify row actionsEach row has "กำหนดค่า" (Edit) button and options menu (expand icon)[ ][ ]
5Verify user countNumber 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

StepActionExpected ResultDevQA
1Click "เจ้าของงาน" (Work Owner) tabTab becomes active[ ][ ]
2Verify table content changesShows Work Owner users[ ][ ]
3Click "เจ้าหน้าที่ความปลอดภัย" (Safety Officer) tabTab becomes active[ ][ ]
4Verify table content changesShows Safety Officer users[ ][ ]
5Click "เจ้าของพื้นที่" (Workspace Owner) tabTab becomes active[ ][ ]
6Verify table content changesShows 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

StepActionExpected ResultDevQA
1Locate search fieldSearch input visible in toolbar[ ][ ]
2Enter email keyword (e.g., "safety")Search accepts input[ ][ ]
3Press Enter or waitTable filters to matching users[ ][ ]
4Verify filtered resultsOnly users with "safety" in email shown[ ][ ]
5Clear search fieldAll 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

StepActionExpected ResultDevQA
1Navigate to User Management pagePage loads[ ][ ]
2Verify no role tabsOnly single contractor table shown[ ][ ]
3Verify contractor listShows contractor users with company info[ ][ ]
4Verify table headersMay 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

StepActionExpected ResultDevQA
1Locate "สร้าง" (Create) button in toolbarButton visible[ ][ ]
2Click "สร้าง" buttonDropdown menu opens[ ][ ]
3Verify menu optionsOptions: จัดซื้อ, เจ้าของงาน, เจ้าหน้าที่ความปลอดภัย, เจ้าของพื้นที่[ ][ ]
4Click outside menuMenu 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

StepActionExpected ResultDevQA
1Click "เจ้าของพื้นที่" (WorkspaceOwner) optionForm opens[ ][ ]
2Wait for form to loadUser creation form displayed[ ][ ]
3Enter Email: test-user@example.comEmail field accepts input[ ][ ]
4Enter Mobile: 0812345678Mobile field accepts input[ ][ ]
5Enter First Name: ทดสอบFirst name field accepts Thai input[ ][ ]
6Enter Last Name: ระบบLast name field accepts Thai input[ ][ ]
7Enter Responsibility Areas: พื้นที่ทดสอบArea field accepts input[ ][ ]
8Click "บันทึก" (Save) buttonSave triggered[ ][ ]
9Wait for save to completeSuccess snackbar appears[ ][ ]
10Verify user in listNew 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

StepActionExpected ResultDevQA
1Click "เจ้าหน้าที่ความปลอดภัย" (SafetyOfficer) optionForm opens[ ][ ]
2Fill required fields (email, mobile, name)Fields accept input[ ][ ]
3Click "บันทึก" (Save) buttonSave triggered[ ][ ]
4Wait for save to completeSuccess snackbar appears[ ][ ]
5Navigate to SafetyOfficer tabUser appears in list[ ][ ]

[Screenshot: SafetyOfficer creation form]

Notes: _______________


TC-USR-M012: Validate required fields

Precondition: On user creation form

StepActionExpected ResultDevQA
1Leave all fields emptyFields are empty[ ][ ]
2Click "บันทึก" (Save) buttonForm validation triggers[ ][ ]
3Verify email errorEmail field shows required error[ ][ ]
4Verify mobile errorMobile field may show required error[ ][ ]
5Enter only emailSome required fields still empty[ ][ ]
6Click "บันทึก" againRemaining validation errors shown[ ][ ]

[Screenshot: Validation errors on empty form]

Notes: _______________


TC-USR-M013: Duplicate email validation

Precondition: User with email already exists in system

StepActionExpected ResultDevQA
1Open create user formForm displayed[ ][ ]
2Enter existing email: tn@thaiscada.com [or known existing email]Email field accepts input[ ][ ]
3Fill other required fieldsFields filled[ ][ ]
4Click "บันทึก" (Save)Save attempted[ ][ ]
5Verify error messageError indicates email already exists[ ][ ]
6Verify form remains openCan 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

StepActionExpected ResultDevQA
1Locate "สร้าง" (Create) buttonButton visible in toolbar[ ][ ]
2Click "สร้าง" buttonForm opens DIRECTLY (no dropdown menu)[ ][ ]
3Verify contractor formCompany 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)

StepActionExpected ResultDevQA
1Verify section header"ข้อมูลบริษัทผู้รับเหมา" (Contractor Company Info) visible[ ][ ]
2Enter Company Name (Thai): บริษัท ทดสอบ จำกัดThai text accepted[ ][ ]
3Enter Company Name (English): Test Company Ltd.English text accepted[ ][ ]
4Enter Address: 123 ถนนทดสอบ กรุงเทพฯ 10110Address field accepts input[ ][ ]
5Enter Website (optional): https://test.comWebsite field accepts input[ ][ ]

[Screenshot: Company info section filled]

Notes: _______________


TC-USR-M016: Fill contact person information

Precondition: Company info filled, on same form

StepActionExpected ResultDevQA
1Verify section header"ผู้ประสานงานหลัก" (Main Contact Person) visible[ ][ ]
2Enter First Name: ทดสอบFirst name field accepts Thai[ ][ ]
3Enter Last Name: ผู้รับเหมาLast name field accepts Thai[ ][ ]
4Enter Email: test-contractor@example.comEmail field accepts input[ ][ ]
5Enter Mobile: 0898765432Mobile field accepts input[ ][ ]

[Screenshot: Contact person section filled]

Notes: _______________


TC-USR-M017: Save contractor successfully

Precondition: All contractor form fields filled

StepActionExpected ResultDevQA
1Verify all required fields filledCompany name (Thai/English), address, contact info[ ][ ]
2Click "บันทึก" (Save) buttonSave triggered[ ][ ]
3Wait for save to completeLoading indicator, then success[ ][ ]
4Verify success snackbar"บันทึกสำเร็จ" or similar message[ ][ ]
5Verify contractor in listNew 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

StepActionExpected ResultDevQA
1Locate a user row in the tableUser row visible with email[ ][ ]
2Click "กำหนดค่า" (Edit) button on the rowEdit form opens[ ][ ]
3Verify form loadedForm displays user's current information[ ][ ]
4Verify fields populatedEmail, 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

StepActionExpected ResultDevQA
1Note current mobile numberRecord existing value[ ][ ]
2Clear mobile fieldField is empty[ ][ ]
3Enter new mobile: 0899999999New number entered[ ][ ]
4Note current first nameRecord existing value[ ][ ]
5Modify first nameName updated[ ][ ]
6Verify changes in formForm shows new values[ ][ ]

[Screenshot: Form with edited values]

Notes: _______________


TC-USR-M020: Save changes successfully

Precondition: User information has been edited

StepActionExpected ResultDevQA
1Click "บันทึก" (Save) buttonSave triggered[ ][ ]
2Wait for save to completeProgress indicator, then success[ ][ ]
3Verify success snackbar"บันทึกสำเร็จ" or similar message[ ][ ]
4Navigate back to user listList displayed[ ][ ]
5Find edited userUser row visible[ ][ ]
6Verify changes persistedUpdated 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

StepActionExpected ResultDevQA
1Make changes to user formValues modified[ ][ ]
2Click "ยกเลิก" (Cancel) button or navigate awayCancel action triggered[ ][ ]
3If confirmation dialog appears, confirmDialog accepted[ ][ ]
4Verify returned to listUser list displayed[ ][ ]
5Click same user againEdit form opens[ ][ ]
6Verify original valuesChanges 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

StepActionExpected ResultDevQA
1Locate a user rowUser row visible[ ][ ]
2Find options button (three dots or expand icon)Button at end of row[ ][ ]
3Click options buttonDropdown menu opens[ ][ ]
4Verify menu optionsOptions: ส่งอีเมล์เทียบเชิญ (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

StepActionExpected ResultDevQA
1Click "ส่งอีเมล์เทียบเชิญ" (Send Invitation Email)Action triggered[ ][ ]
2Verify confirmation dialog appearsDialog with confirm/cancel buttons[ ][ ]
3Verify dialog textMessage asking to confirm sending invitation[ ][ ]

[Screenshot: Invitation confirmation dialog]

Notes: _______________


TC-USR-M024: Confirm and verify success dialog

Precondition: Invitation confirmation dialog is showing

StepActionExpected ResultDevQA
1Click "ตกลง" (OK) button in dialogInvitation sent[ ][ ]
2Wait for email to be sentLoading indicator[ ][ ]
3Verify success dialog appearsDialog confirms email was sent[ ][ ]
4Click "ตกลง" (OK) to close success dialogDialog closes[ ][ ]
5Verify returned to user listList 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

StepActionExpected ResultDevQA
1Click "ลบ" (Delete) optionAction triggered[ ][ ]
2Verify confirmation dialog appearsDialog asking to confirm deletion[ ][ ]
3Verify dialog shows user infoMay 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

StepActionExpected ResultDevQA
1Click "ตกลง" (OK) button to confirmDelete action triggered[ ][ ]
2Wait for delete to completeLoading indicator[ ][ ]
3If successful, verify snackbar"ลบสำเร็จ" or success message[ ][ ]
4Verify user removed from listUser 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)

StepActionExpected ResultDevQA
1Find a user who has been invitedUser with invitation sent[ ][ ]
2Click options → DeleteDelete action triggered[ ][ ]
3Click "ตกลง" to confirmDelete attempted[ ][ ]
4Wait for responseServer processes request[ ][ ]
5Verify error snackbar"Delete failed" or error message appears[ ][ ]
6Verify user still in listUser 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 IDTest CaseDescriptionSeverity

Environment Details:

ItemValue
Browser
Browser Version
OS
Screen Resolution
Backend URL
Frontend URL

Sign-off:

RoleNameDateSignature
Tester
Reviewer