Skip to main content

Workspace Area 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 workspace area exists in the system

Test Data

Test Users

RoleEmailPasswordAccess Level
Admin (Tenant Administrator)tn@thaiscada.comTest1234*Full access - can manage workspace areas
Work Ownersafety-owner@outlook.comTest1234*Full access - has workspace-area-mgmt role
Purchasingsafety-purchasing@outlook.comTest1234*View + SetDefault only - has user-mgmt but NOT workspace-area-mgmt
Contractorsafety-contractor1-0@outlook.comTest1234*View only - can see list, cannot edit

Test Data for Creating/Editing Workspace Areas

FieldValue
Area CodeTEST-001
Area Name (Thai)พื้นที่ทดสอบ
Noteหมายเหตุทดสอบ

Admin/WorkOwner: กำหนดค่าโครงการ (Project Settings) → พื้นที่ทำงาน (Workspace Areas) URL: /tools/settings/workspace-area

Test Summary

CategoryTotalDevQA
1. Navigation & Access4
2. View Workspace Area List3
3. Create Workspace Area3
4. Edit Workspace Area4
5. Set/Unset Default3
6. Delete Workspace Area3
Total20

1. Navigation & Access Tests

TC-WA-M001: Work Owner can access workspace area settings

Precondition: User is logged in as Work Owner role (safety-owner@outlook.com)

StepActionExpected ResultDevQA
1Click "กำหนดค่าโครงการ" menu in sidebarSettings page opens[ ][ ]
2Locate "พื้นที่ทำงาน" (Workspace Areas) menu itemMenu item visible[ ][ ]
3Click "พื้นที่ทำงาน" (Workspace Areas)Page loads[ ][ ]
4Verify URLURL is /tools/settings/workspace-area[ ][ ]
5Verify page contentWorkspace area list table displayed[ ][ ]
6Verify "สร้าง" (Create) button visibleButton visible in toolbar[ ][ ]

[Screenshot: Workspace area settings page with list and toolbar]

Notes: Work Owner has workspace-area-mgmt role with full access (create/edit/delete)


TC-WA-M002: Admin can access workspace area settings

Precondition: User is logged in as Tenant Administrator role

StepActionExpected ResultDevQA
1Login as Admin: tn@thaiscada.comLogin successful[ ][ ]
2Navigate to กำหนดค่าโครงการ → พื้นที่ทำงานWorkspace area settings page loads[ ][ ]
3Verify URLURL is /tools/settings/workspace-area[ ][ ]
4Verify workspace area list displayedTable with workspace areas visible[ ][ ]
5Verify "สร้าง" (Create) button visibleButton visible - Admin can create[ ][ ]

[Screenshot: Admin workspace area settings view]

Notes: Admin has full access via tenant administrator role


TC-WA-M003: Contractor user can view but not edit

Precondition: User is logged in as Contractor role

StepActionExpected ResultDevQA
1Login as Contractor: safety-contractor1-0@outlook.comLogin successful, redirected to my-tasks[ ][ ]
2Navigate to กำหนดค่าโครงการ → พื้นที่ทำงานWorkspace area list page loads[ ][ ]
3Verify workspace area list visibleTable displays workspace areas (search uses realm-basic)[ ][ ]
4Check for "สร้าง" (Create) buttonCreate button should NOT be visible[ ][ ]
5Check for "กำหนดค่า" (Edit) buttonsEdit buttons should NOT be visible[ ][ ]

[Screenshot: Contractor user view - list only, no edit buttons]

Notes: Contractor users can view the list but cannot edit due to missing workspace-area-mgmt role


TC-WA-M004: Purchasing user can view and set default only

Precondition: User is logged in as Purchasing role

StepActionExpected ResultDevQA
1Login as Purchasing: safety-purchasing@outlook.comLogin successful[ ][ ]
2Navigate to กำหนดค่าโครงการ → พื้นที่ทำงานWorkspace area list page loads[ ][ ]
3Verify workspace area list visibleTable displays workspace areas[ ][ ]
4Check for "สร้าง" (Create) buttonCreate button should NOT be visible[ ][ ]
5Check for "กำหนดค่า" (Edit) buttonsEdit buttons should NOT be visible[ ][ ]
6Check options menuSet default option MAY be visible (has user-mgmt)[ ][ ]

[Screenshot: Purchasing user view - list only, setDefault may be available]

Notes: Purchasing role does NOT have workspace-area-mgmt but HAS user-mgmt (can setDefault)


2. View Workspace Area List Tests

TC-WA-M005: View workspace area list with table columns

Precondition: Logged in as Work Owner, on Workspace Area Settings page

StepActionExpected ResultDevQA
1Navigate to Workspace Area Settings pagePage loads with workspace area list[ ][ ]
2Verify table headersColumns: รหัสพื้นที่ทำงาน, ชื่อพื้นที่ทำงาน, เจ้าของพื้นที่, เจ้าหน้าที่ความปลอดภัย, ค่าเริ่มต้น, Actions[ ][ ]
3Verify workspace area rowsEach row shows area code, name, owner, safety officer, default indicator[ ][ ]
4Verify row actionsEach row has "กำหนดค่า" button and options menu (expand_more icon)[ ][ ]

[Screenshot: Workspace area list table with headers]

Notes: _______________


TC-WA-M006: Empty state display

Precondition: No workspace areas exist in the system

StepActionExpected ResultDevQA
1Navigate to Workspace Area Settings pagePage loads[ ][ ]
2Verify empty state message"ไม่พบข้อมูล" displayed in table[ ][ ]
3Verify "สร้าง" button still visibleWork Owner can still create new workspace area[ ][ ]

[Screenshot: Empty workspace area list]

Notes: _______________


TC-WA-M007: Refresh workspace area list

Precondition: On Workspace Area Settings page

StepActionExpected ResultDevQA
1Locate "รีเฟรช" (Refresh) button in toolbarButton visible[ ][ ]
2Click "รีเฟรช" buttonList refreshes[ ][ ]
3Verify data reloadedWorkspace areas fetched from server[ ][ ]

[Screenshot: Refresh button]

Notes: _______________


3. Create Workspace Area Tests

TC-WA-M008: Create new workspace area (happy path)

Precondition: Logged in as Work Owner, on Workspace Area Settings page

StepActionExpected ResultDevQA
1Click "สร้าง" (Create) buttonForm opens[ ][ ]
2Fill รหัสพื้นที่ทำงาน (Area Code): TEST-001Input accepts value[ ][ ]
3Fill ชื่อพื้นที่ทำงาน (Area Name): พื้นที่ทดสอบInput accepts Thai characters[ ][ ]
4Fill รายละเอียด (Note): หมายเหตุทดสอบTextarea accepts value[ ][ ]
5(Optional) Select เจ้าของพื้นที่ (Workspace Owner)Dropdown shows user list[ ][ ]
6(Optional) Select เจ้าหน้าที่ความปลอดภัย (Safety Officer)Dropdown shows user list[ ][ ]
7Click "บันทึก" (Save) buttonSnackbar shows "บันทึกสำเร็จ"[ ][ ]
8Verify workspace area in listNew workspace area appears in table[ ][ ]

[Screenshot: Create workspace area form]

Notes: Area Code and Area Name are required fields


TC-WA-M009: Required field validation (Area Code)

Precondition: Logged in as Work Owner, on create form

StepActionExpected ResultDevQA
1Click "สร้าง" (Create) buttonForm opens[ ][ ]
2Leave รหัสพื้นที่ทำงาน (Area Code) emptyField shows red outline/error[ ][ ]
3Fill ชื่อพื้นที่ทำงาน (Area Name) onlyOther field filled[ ][ ]
4Try to click "บันทึก" (Save)Button disabled OR validation shown[ ][ ]

[Screenshot: Validation error for required fields]

Notes: Both Area Code and Area Name are required


TC-WA-M010: Duplicate Area Code validation

Precondition: Workspace area with code "TEST-001" already exists

StepActionExpected ResultDevQA
1Click "สร้าง" (Create) buttonForm opens[ ][ ]
2Fill รหัสพื้นที่ทำงาน: TEST-001 (duplicate)Input accepts value[ ][ ]
3Fill all other required fieldsForm filled[ ][ ]
4Click "บันทึก" (Save)API returns 400 error[ ][ ]
5Verify error messageSnackbar: "Area code already exists" or similar[ ][ ]

[Screenshot: Duplicate area code error message]

Notes: Backend validates Area Code uniqueness per tenant


4. Edit Workspace Area Tests

TC-WA-M011: Edit workspace area from list (Work Owner)

Precondition: Workspace area exists, logged in as Work Owner

StepActionExpected ResultDevQA
1Locate workspace area rowRow visible in table[ ][ ]
2Click "กำหนดค่า" (Edit) buttonForm opens with existing data[ ][ ]
3Verify รหัสพื้นที่ทำงาน field has valueExisting area code displayed[ ][ ]
4Modify ชื่อพื้นที่ทำงาน (Area Name)Field accepts new value[ ][ ]
5Click "บันทึก" (Save)Snackbar shows success[ ][ ]
6Verify changes in listUpdated data displayed[ ][ ]

[Screenshot: Edit workspace area form with data]

Notes: _______________


TC-WA-M012: Edit with Thai content

Precondition: Workspace area edit form is open

StepActionExpected ResultDevQA
1Modify ชื่อพื้นที่ทำงาน with Thai: พื้นที่โรงงาน A - อาคารผลิตThai characters accepted[ ][ ]
2Modify รายละเอียด with Thai: หมายเหตุ: พื้นที่นี้ต้องการการรักษาความปลอดภัยระดับสูงThai characters accepted[ ][ ]
3Click "บันทึก" (Save)Save triggered[ ][ ]
4Verify successSuccess snackbar appears[ ][ ]
5Verify Thai text savedThai content displayed correctly in list[ ][ ]

[Screenshot: Thai content in form]

Notes: _______________


TC-WA-M013: Assign Workspace Owner and Safety Officer

Precondition: Workspace area edit form is open

StepActionExpected ResultDevQA
1Click เจ้าของพื้นที่ (Workspace Owner) dropdownDropdown opens with user list[ ][ ]
2Select a userUser selected[ ][ ]
3Click เจ้าหน้าที่ความปลอดภัย (Safety Officer) dropdownDropdown opens with user list[ ][ ]
4Select a userUser selected[ ][ ]
5Click "บันทึก" (Save)Save triggered[ ][ ]
6Verify successSuccess snackbar appears[ ][ ]
7Verify in listOwner and Safety Officer names displayed in list[ ][ ]

[Screenshot: Workspace owner and safety officer dropdowns]

Notes: These fields are optional


TC-WA-M014: Cancel edit discards changes

Precondition: Workspace area edit form is open with changes made

StepActionExpected ResultDevQA
1Make changes to workspace area formValues modified[ ][ ]
2Click "ยกเลิก" (Cancel) button or navigate awayCancel action triggered[ ][ ]
3Navigate back to listWorkspace area list displayed[ ][ ]
4Click configure on same workspace areaEdit form opens[ ][ ]
5Verify original valuesChanges were NOT saved[ ][ ]

[Screenshot: Cancel button]

Notes: _______________


5. Set/Unset Default Tests

TC-WA-M015: Set workspace area as default

Precondition: On Workspace Area Settings page, workspace area is NOT currently default

StepActionExpected ResultDevQA
1Locate a non-default workspace area rowRow without default indicator[ ][ ]
2Click options menu (expand_more icon) on rowDropdown menu opens[ ][ ]
3Verify menu option"ตั้งเป็นค่าเริ่มต้น" (Set as Default) visible[ ][ ]
4Click "ตั้งเป็นค่าเริ่มต้น"Action triggered[ ][ ]
5Verify successSuccess snackbar appears[ ][ ]
6Verify default indicatorWorkspace area row now shows default indicator (checkmark)[ ][ ]

[Screenshot: Options menu with "ตั้งเป็นค่าเริ่มต้น"] [Screenshot: Workspace area with default indicator]

Notes: Only one workspace area can be default at a time


TC-WA-M016: Unset default (toggle off)

Precondition: Workspace area is currently set as default

StepActionExpected ResultDevQA
1Locate the default workspace area rowRow with default indicator visible[ ][ ]
2Click options menu on default workspace areaDropdown menu opens[ ][ ]
3Verify menu option changed"ยกเลิกเป็นค่าเริ่มต้น" (Unset Default) visible[ ][ ]
4Click "ยกเลิกเป็นค่าเริ่มต้น"Action triggered[ ][ ]
5Verify successSuccess snackbar appears[ ][ ]
6Verify default indicator removedWorkspace area no longer shows default indicator[ ][ ]

[Screenshot: Options menu with "ยกเลิกเป็นค่าเริ่มต้น"] [Screenshot: Default indicator removed]

Notes: Setting the same workspace area as default twice toggles it off (API behavior)


TC-WA-M017: Purchasing can set default (has user-mgmt)

Precondition: Logged in as Purchasing role

StepActionExpected ResultDevQA
1Login as Purchasing: safety-purchasing@outlook.comLogin successful[ ][ ]
2Navigate to Workspace Area SettingsList displayed[ ][ ]
3Click options menu on a workspace areaDropdown menu opens[ ][ ]
4Verify set default option visible"ตั้งเป็นค่าเริ่มต้น" option available[ ][ ]
5Click set defaultAction triggered[ ][ ]
6Verify successSuccess snackbar appears (200 OK)[ ][ ]

[Screenshot: Purchasing user can set default]

Notes: Purchasing has user-mgmt role which allows setDefault operation


6. Delete Workspace Area Tests

TC-WA-M018: Delete workspace area (no dependencies)

Precondition: Workspace area exists with no linked projects

StepActionExpected ResultDevQA
1Locate workspace area rowRow visible[ ][ ]
2Click options menu (expand_more icon)Dropdown menu opens[ ][ ]
3Click "ลบ" (Delete) menu itemConfirmation dialog appears[ ][ ]
4Click "ตกลง" (Confirm) in dialogWorkspace area deleted[ ][ ]
5Verify workspace area removed from listRow no longer visible[ ][ ]
6Verify success messageSnackbar shows "ลบสำเร็จ"[ ][ ]

[Screenshot: Delete confirmation dialog]

Notes: _______________


TC-WA-M019: Cancel delete keeps workspace area

Precondition: Delete confirmation dialog is showing

StepActionExpected ResultDevQA
1Click "ยกเลิก" (Cancel) buttonDialog closes[ ][ ]
2Verify returned to listWorkspace area list displayed[ ][ ]
3Verify workspace area still in listWorkspace area was NOT deleted[ ][ ]

[Screenshot: Workspace area still in list after cancel]

Notes: _______________


TC-WA-M020: FK constraint prevents delete (workspace area in use)

Precondition: Workspace area is linked to projects

StepActionExpected ResultDevQA
1Find a workspace area linked to projectsWorkspace area with project dependencies[ ][ ]
2Click options → DeleteDelete triggered[ ][ ]
3Click "ตกลง" to confirmDelete attempted[ ][ ]
4Wait for responseServer processes request[ ][ ]
5Verify error snackbarError message: "Workspace area is currently in use"[ ][ ]
6Verify workspace area still in listWorkspace area was NOT deleted due to FK constraint[ ][ ]

[Screenshot: Delete failed error snackbar]

Notes: Workspace areas linked to projects cannot be deleted. This is expected behavior - the FK constraint protects data integrity.


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

Labels verified against:

  • workspace-area-setting-list.component.ts (table headers, menu actions)
  • workspace-area-setting-form-general.component.ts (form field labels)
  • workspace-area-setting-list-toolbar.component.ts (toolbar buttons)