workPro Documentation
Getting Started
QUICK_TEST_GUIDE.md

Quick Test Guide - Edit and Change Password Modals

Before Testing

  1. Clear browser cache:

    • Chrome/Edge: Ctrl+Shift+Delete (Windows/Linux) or Cmd+Shift+Delete (Mac)
    • Firefox: Ctrl+Shift+Delete (Windows/Linux) or Cmd+Shift+Delete (Mac)
    • Or open in Private/Incognito window
  2. Make sure you're logged in as an Admin user

    • Admin users in database: userId 1, 2

Test 1: Edit User Modal

Steps:

  1. Go to users.php page
  2. Click the "Edit" button on any user row
  3. In the Edit User modal:
    • Verify the form pre-fills with current user data
    • Verify the Status dropdown shows the correct value (Active or Inactive)
    • Make a small change (e.g., change email to add a number)
  4. Click "Save Changes" button
  5. Expected:
    • Success message: "User updated successfully"
    • Modal closes automatically
    • DataTable reloads with updated data
    • NOT: "Error: Access denied"

Test 2: Change Password Modal

Steps:

  1. Go to users.php page
  2. Option A: Click the "Change Password" button on any user row
    • OR Option B: Click "Change Password" in the header dropdown menu (top-right)
  3. In the Change Password modal:
    • Enter a new password (must be 8+ characters)
    • Re-enter the same password in Confirm field
  4. Click "Change Password" button
  5. Expected:
    • Success message: "Password changed successfully"
    • Modal closes automatically
    • Form clears for next use
    • NOT: "Error: Access denied"

Test 3: Status Dropdown Functionality

Purpose: Verify status values pre-fill correctly (fix from previous session)

Steps:

  1. Click "Edit" on any "Active" user
  2. Verify Status dropdown shows "Active" as selected (not blank)
  3. Click "Edit" on any "Inactive" user
  4. Verify Status dropdown shows "Inactive" as selected (not blank)

Test 4: Cascade Filtering

Purpose: Verify Vendor → Project → DC filtering works

Steps:

  1. Click "Edit" on any user
  2. Select a different Vendor from the Vendor dropdown
  3. Expected: Project dropdown repopulates with projects for that vendor
  4. Select a different Project
  5. Expected: DC dropdown repopulates with DCs for that project

Debugging if Issues Occur

If you still see "Error: Access denied"

  • This means the current logged-in user is NOT an admin
  • Check their role: Must be 'admin' (lowercase)
  • Solution: Log in as a user with admin role
    • User ID 1 (Admin) or User ID 2 (Yagati Vasavya) are confirmed admins

If you see "Error: undefined" or other errors

  1. Open browser console: F12 → Console tab
  2. Look for error messages
  3. Check Network tab: Look at API response for actual error

If form doesn't pre-fill

  • Check browser console for JavaScript errors
  • Verify API response contains expected data (Network → users-view.php response)

If modal doesn't close after save

  • Success message appeared but modal still open?
  • This might be a Bootstrap modal issue
  • Try refreshing page (F5)

Success Checklist

  • [ ] Edit modal opens without errors
  • [ ] Status dropdown shows correct value
  • [ ] Save Changes works without "Access denied"
  • [ ] UserData updates in table
  • [ ] Change Password modal opens
  • [ ] Password change works without "Access denied"
  • [ ] Modal closes after successful save/change
  • [ ] No errors in browser console

What Was Fixed

This session fixed two issues:

  1. Status case mismatch: Database "Active" → Form "active" (FIXED in previous session)
  2. Session variable access: APIs using $_SESSION['user'] → Now use get_user_info() (FIXED THIS SESSION)

Both are now resolved and ready for testing.

workPro Documentation | v1.3
Login to Dashboard