Testing Guide: Owner/Admin Role
Pre-Test Setup
Test Environment
- Backend running on:
http://localhost:8080 - Frontend running on:
http://localhost:5173orhttp://localhost:3000 - Database: PostgreSQL with test data
Required Test Users
You need users with Owner/Admin role in your LDAP/database:
Option 1: Use Existing LDAP Users
- Check your LDAP server for users with owner/admin roles
- Default test users (if seeded): alice.johnson, bob.smith, etc.
Option 2: Create Test Users
- Access admin panel or database
- Create user with role = "owner" or "administrator"
Test Flow 1: Navigation & Visibility
Step 1: Login as Owner/Admin User
- Go to
http://localhost:5173/login - Enter credentials for an Owner/Admin user
- Click "Login"
- You should be redirected to
/dashboard
Step 2: Check Navigation Items
-
Look at the left sidebar (on desktop) or hamburger menu (mobile)
-
Verify these items are visible:
- ✅ Dashboard
- ✅ Projects
- ✅ Builds
- ✅ Images
- ✅ Tenants (only for Owner/Admin)
- ✅ Profile
- ✅ Settings
-
Verify these items are NOT visible (unless you're also a system admin):
- ❌ Admin Dashboard
-
Check header:
- Should see current role displayed next to context switcher
- Format: "Owner" or "Administrator"
✅ Expected Result
Navigation should match Owner/Admin permissions. If you see unexpected items or missing items, check role assignment.
Test Flow 2: Project Management & Member Management
Step 1: Navigate to Projects
- Click Projects in sidebar
- You should see a list of projects
- There should be a "+ New Project" button in top right
Step 2: View Project Details
- Click on any project name to open details
- You should see two tabs:
- Overview (project info, repository URL, branch)
- Members (NEW - member management)
Step 3: Edit Project Details
- On Overview tab, click Edit button
- Change any field:
- Project name
- Description
- Repository URL
- Branch
- Click Save
- Verify changes are saved and page refreshes
Step 4: Switch to Members Tab
- Click Members tab
- You should see:
- "+ Add Member" button
- Table of current project members
- Columns: User ID, Email, Role, Actions
- Each row has "Edit Role" and "Remove" buttons
✅ Expected Result
Project details and member list load correctly. Edit functionality works.
Test Flow 3: Add Project Member (Core Feature)
Step 1: Open Add Member Modal
- Click "+ Add Member" button
- Modal should open with:
- Search field for users
- "Add" button (disabled until user selected)
- "Cancel" button
Step 2: Search for User
- Type a user's name in the search field
- Dropdown should appear with matching users
- Example: type "alice" → should show "alice.johnson"
Step 3: Add Member
- Click on a user from dropdown
- User should be selected and shown
- Click "Add" button
- Modal should close
- Verify:
- Success toast appears
- New member appears in table
- Member has no role assigned initially
✅ Expected Result
Member added successfully. Member appears in list immediately.
If it fails:
- Check backend is running:
curl http://localhost:8080/health - Check API endpoint:
GET /api/v1/projects/{projectId}/members - Check browser console for errors (F12)
Test Flow 4: Edit Member Role
Step 1: Open Edit Role Modal
- In Members table, find a member you just added
- Click "Edit Role" button in that row
- Modal should open with:
- Dropdown showing available roles
- "Save" and "Cancel" buttons
Step 2: Select New Role
- Click role dropdown
- You should see options:
- Owner
- Administrator
- Developer
- Operator
- Viewer
- (empty/None)
- Select "Developer"
Step 3: Save Role Change
- Click "Save" button
- Modal should close
- Verify:
- Success toast appears
- Member row now shows "Developer" role
- Change is persisted (refresh page to confirm)
✅ Expected Result
Role is updated in table and persisted to backend.
If it fails:
- Check API endpoint:
PATCH /api/v1/projects/{projectId}/members/{userId} - Verify role exists in backend database
- Check audit logs for errors
Test Flow 5: Remove Member
Step 1: Open Remove Confirmation
- In Members table, click "Remove" button for a member
- Confirmation dialog should appear asking:
- "Are you sure you want to remove this member?"
- With "Remove" and "Cancel" buttons
Step 2: Confirm Removal
- Click "Remove" button
- Dialog should close
- Verify:
- Success toast appears
- Member disappears from table
- If you refresh page, member is still gone
✅ Expected Result
Member is removed successfully and audit logged.
If it fails:
- Check API endpoint:
DELETE /api/v1/projects/{projectId}/members/{userId} - Check backend logs for errors
- Verify user permissions
Test Flow 6: Tenant Management (Owner/Admin Only)
Step 1: Navigate to Tenants
- Click Tenants in sidebar
- You should see list of all tenants in a table
- Columns: Name, Slug, Status, Quota (builds, storage), Created Date, Actions
Step 2: View Tenant Details
- Click "View" action button for a tenant
- Tenant detail page should load (future feature)
Step 3: Create New Tenant (Future)
- Click "+ New Tenant" button
- Form should open (future feature)
Step 4: Delete Tenant
- Click "Delete" action button for a tenant
- Confirmation dialog should appear
- Confirm deletion
- Tenant should be removed from list
✅ Expected Result
Tenant list loads. Delete functionality works.
Test Flow 7: Build Management
Step 1: Navigate to Builds
- Click Builds in sidebar
- You should see list of all builds (or empty state if none)
Step 2: Create Build
- Click "+ New Build" or navigate to
/builds/new - Build form should appear
- Complete the form with:
- Select project
- Enter build name
- Configure build settings
- Click "Create Build"
Step 3: View Build Details
- Click on a build in the list
- Build detail page should show:
- Build status (running, completed, failed, etc.)
- Build logs
- Build duration
- Created time
✅ Expected Result
Build creation and viewing works correctly.
Test Flow 8: Role-Based Access Control
Step 1: Switch Tenant Role
- Use the Context Switcher in header
- Switch to a tenant where you have Viewer role (or less)
- Verify Tenants nav item disappears
- Verify Builds nav item disappears (if Viewer role)
- Header should show "Viewer" role instead of "Owner"
Step 2: Try Accessing Protected Routes
- Try to access
/tenantsdirectly via URL - Should be redirected to
/dashboard
Step 3: Switch Back to Owner Role
- Use Context Switcher
- Switch back to Owner/Admin tenant
- Verify Tenants and Builds nav items reappear
✅ Expected Result
Navigation and routing properly respect role-based access.
Test Flow 9: Member Management Error Cases
Test: Adding Duplicate Member
- Try to add same user to project twice
- Should get error: "User already a member of this project"
- Member should not be duplicated in list
Test: Removing Non-existent Member
- Try to remove member that's already removed
- Should get error or be handled gracefully
Test: Invalid Role Assignment
- Try to assign a role that doesn't exist
- Should get error: "Invalid role"
✅ Expected Result
All error cases handled gracefully with user feedback.
Test Flow 10: Empty States
Test: Empty Project List
- Create new tenant with no projects
- Go to Projects page
- Should see empty state:
- Icon: 📁
- Message: "No projects yet"
- Button: "Create Project"
Test: Empty Member List
- Create new project with no members
- Open project → Members tab
- Should show empty members list
- Should be able to add member
Test: Empty Tenant List
- (This shouldn't happen in production, but test for robustness)
- Should see empty state with "Create Tenant" button
✅ Expected Result
All empty states display correctly and guide user action.
Test Flow 11: Dark Mode
Test: Enable Dark Mode
- Click theme toggle button (☀️/🌙) in header
- Page should switch to dark theme
- Verify all pages work in dark mode:
- Projects page
- Project detail
- Members UI
- Tenants page
- Verify colors are legible
✅ Expected Result
Dark mode works throughout application.
Test Flow 12: Responsive Design
Test: Desktop View (1920px width)
- All navigation items visible in sidebar
- Table displays properly
- Buttons are accessible
Test: Tablet View (768px width)
- Menu collapses to hamburger
- Tables are scrollable if needed
- Modals resize properly
Test: Mobile View (375px width)
- Full responsive layout
- Touch-friendly buttons
- Readable text
✅ Expected Result
Application works on all screen sizes.
Troubleshooting
Issue: "Permission Denied" on Tenants page
Solution:
- Check user role in database:
SELECT * FROM users WHERE email='user@example.com'; - Verify user has RBAC role = "Owner" or "Administrator"
- Check role assignment:
SELECT * FROM user_roles WHERE user_id='...' AND tenant_id='...';
Issue: Members not loading
Solution:
- Check backend logs:
tail -f logs/backend.log - Verify project exists
- Check API endpoint returns data:
curl -H "Authorization: Bearer $TOKEN" -H "X-Tenant-ID: <tenant-uuid>" http://localhost:8080/api/v1/projects/{projectId}/members
Issue: Add member modal shows no users
Solution:
- Verify users exist in database
- Check permissions on user endpoint
- Verify current user has
canManageMemberspermission
Issue: Dark mode not working
Solution:
- Check localStorage:
localStorage.getItem('theme') - Verify theme toggle button is visible
- Check browser dev tools for CSS class issues
Success Criteria
All Tests Should Pass ✅
- Can see Owner/Admin-specific nav items
- Can view and edit projects
- Can add members to projects
- Can edit member roles
- Can remove members
- Can view tenant list
- Member changes are persisted
- Role-based navigation works
- Empty states display correctly
- Dark mode works
- Responsive on all devices
- Error messages are helpful
Commands to Verify Everything is Working
# Check backend is running
curl http://localhost:8080/health
# Check frontend is running
curl http://localhost:5173
# Check specific API endpoints
curl -H "Authorization: Bearer $TOKEN" \
-H "X-Tenant-ID: <tenant-uuid>" \
http://localhost:8080/api/v1/projects
# Check database connection
psql -U postgres -d image_factory_dev -c "SELECT COUNT(*) FROM users;"
Notes for Test Execution
- Create Fresh Test User: Preferably create a new test account for clean testing
- Clear Browser Cache: Ctrl+Shift+Delete to clear cache before testing
- Watch Network Tab: Check network requests in Dev Tools (F12) for API calls
- Monitor Backend Logs: Keep backend logs open:
tail -f logs/backend.log - Check Audit Logs: All member operations should be logged
- Test Concurrency: If possible, have multiple users testing simultaneously to catch race conditions