Complete implementation of the Goa Government e-Licensing platform with: Backend: - NestJS API with JWT authentication - PostgreSQL database with Knex ORM - Redis caching and session management - MinIO document storage - Hyperledger Besu blockchain integration - Multi-department workflow system - Comprehensive API tests (266/282 passing) Frontend: - Angular 21 with standalone components - Angular Material + TailwindCSS UI - Visual workflow builder - Document upload with progress tracking - Blockchain explorer integration - Role-based dashboards (Admin, Department, Citizen) - E2E tests with Playwright (37 tests) Infrastructure: - Docker Compose orchestration - Blockscout blockchain explorer - Development and production configurations
21 KiB
🧪 Goa-GEL End-to-End Testing Guide
Overview
This guide provides a complete end-to-end testing workflow for the Goa-GEL blockchain verification platform. Follow these steps to verify all features are working correctly.
🔧 Prerequisites
1. Environment Setup
# Terminal 1 - Backend
cd backend
npm install
npm run db:migrate
npm run db:seed # IMPORTANT: Seeds demo accounts with wallets
npm run start:dev
# Terminal 2 - Frontend
cd frontend
npm install
ng serve
# Terminal 3 - Blockchain (Optional for full workflow)
cd blockchain
npm install
# Configure local blockchain or testnet
2. Access URLs
- Frontend: http://localhost:4200
- Backend API: http://localhost:3000
- API Docs: http://localhost:3000/api
📋 Test Scenario: Complete License Approval Workflow
Step 1: Admin Login & Portal Access
Objective: Verify admin can log in and access the admin portal
- Navigate to http://localhost:4200/login
- Use demo credentials:
- Email:
admin@goa.gov.in - Password:
Admin@123 - Or click the "Admin" demo credential button to auto-fill
- Email:
- Click "Sign In"
Expected Results:
- ✅ Successful login with no errors
- ✅ Redirected to dashboard
- ✅ User menu shows "Admin" role
- ✅ Admin menu item visible in navigation
Step 2: Access Admin Portal
- Click on user menu (top right)
- Select "Admin" from dropdown
- Or navigate directly to http://localhost:4200/admin
Expected Results:
- ✅ Admin portal loads with 6 tabs:
- Dashboard
- Departments
- Users
- Transactions
- Events
- Logs
- ✅ Platform statistics cards display:
- Total Requests
- Departments
- Applicants
- Blockchain Transactions
Step 3: Verify Pre-Seeded Data
Navigate through each tab to verify seed data:
Dashboard Tab
- ✅ Platform stats show non-zero counts
- ✅ Stats cards have gradient backgrounds
- ✅ All numbers are clickable/informative
Departments Tab
- ✅ Shows pre-seeded departments:
- Fire Department (FIRE_DEPT)
- Tourism Department (TOURISM_DEPT)
- Municipality (MUNICIPALITY)
- ✅ Each department shows:
- Code
- Name
- Wallet Address (0x...)
- Status (Active)
- Action buttons
Users Tab
- ✅ Shows all 5 seeded users:
- Admin
- Fire Department Officer
- Tourism Department Officer
- Municipality Officer
- Test Citizen
- ✅ Each user shows:
- Name
- Role badge
- Wallet Address
Transactions Tab (May be empty initially)
- ✅ Table structure loads correctly
- ✅ Filters available (Status dropdown)
- ✅ Statistics cards present
- ✅ Empty state shows: "No transactions found"
Events Tab (May be empty initially)
- ✅ Table structure loads correctly
- ✅ Filters available (Event Type, Contract Address)
- ✅ Empty state shows: "No events found"
Logs Tab
- ✅ Application logs displayed
- ✅ Filters work: Level, Module, Search
- ✅ Color-coded log levels (INFO=blue, WARN=orange, ERROR=red)
- ✅ Export button available
Step 4: Onboard New Department
Objective: Test department onboarding with auto-wallet creation
- In Admin Portal, go to Departments tab
- Click "Onboard New Department" button
- Fill in the form:
Department Code: POLICE_DEPT Department Name: Police Department Description: Law enforcement and security clearances Contact Email: police@goa.gov.in Contact Phone: +91-832-2222222 - Click "Onboard Department"
Expected Results:
- ✅ Success notification appears
- ✅ Alert/dialog shows:
- ✅ Wallet Address (0x...)
- ✅ API Key (starts with "pd_")
- ✅ API Secret (long alphanumeric)
- ✅ Warning: "Save these credentials - shown only once"
- ✅ SAVE THESE CREDENTIALS for later use
- ✅ Department appears in departments list
- ✅ Status shows "Active"
Verification:
- Go to Users tab
- Verify no new user was created (department accounts are separate from users)
- Go back to Departments tab
- Find "Police Department" in the list
- Verify wallet address matches the one shown in alert
Step 5: Regenerate Department API Key
Objective: Test API key regeneration functionality
- In Departments tab, find "Police Department"
- Click "Regenerate Key" button
- Confirm the action
Expected Results:
- ✅ Success notification
- ✅ Alert shows new API credentials
- ✅ New API Key and Secret are different from original
- ✅ Wallet address remains the same
Step 6: Deactivate & Reactivate Department
Objective: Test department lifecycle management
- Find "Police Department"
- Click "Deactivate" button
- Confirm the action
Expected Results:
- ✅ Status changes to "Inactive"
- ✅ Status chip turns red/gray
- Click "Activate" button
- Confirm the action
Expected Results:
- ✅ Status changes to "Active"
- ✅ Status chip turns green
Step 7: Citizen Registration (Simulated)
Objective: Test citizen account creation and license request
Note: This step requires the citizen registration endpoints to be accessible. If not yet fully implemented, document the expected behavior.
- Log out from admin account
- Navigate to citizen registration page (if available)
- Or use API directly:
POST http://localhost:3000/auth/register
Content-Type: application/json
{
"email": "john.doe@example.com",
"password": "Citizen@123",
"name": "John Doe",
"role": "APPLICANT",
"phone": "+91-9876543210"
}
Expected Results:
- ✅ Account created successfully
- ✅ Wallet automatically generated
- ✅ Response includes:
- User ID
- Name
- Wallet Address
- Role: APPLICANT
Step 8: Create License Request
Objective: Test license request creation with document upload
- Log in as the new citizen:
john.doe@example.com/Citizen@123 - Navigate to "My Requests" or requests page
- Click "New Request" or "Create License Request"
- Fill in request form:
Request Type: RESORT_LICENSE Resort Name: Goa Beach Resort Location: Calangute, Goa Capacity: 100 guests ... (other required fields) - Upload required documents:
- Business Registration Certificate (PDF)
- Property Ownership Proof (PDF)
- Floor Plan (Image/PDF)
Expected Results:
- ✅ Request created with status "DRAFT"
- ✅ Documents uploaded successfully
- ✅ Each document shows:
- File name
- File size
- Upload timestamp
- File hash (generated)
- Version 1
Step 9: Submit License Request
Objective: Test request submission and NFT minting (blockchain operation)
- From request detail page, click "Submit Request"
- Confirm submission
Expected Results:
- ✅ Request status changes to "SUBMITTED"
- ✅ Blockchain transaction initiated
- ✅ Transaction hash appears in request details
- ✅ NFT Token ID assigned (if blockchain is active)
Verify in Admin Portal:
-
Log in as admin
-
Go to Transactions tab
-
Find the new transaction:
- ✅ Transaction hash present
- ✅ Status: PENDING → CONFIRMED
- ✅ Gas used displayed
- ✅ Linked to request ID
-
Go to Events tab
-
Find "LicenseRequested" event:
- ✅ Event type correct
- ✅ Contract address present
- ✅ Block number displayed
- ✅ Event parameters decoded
Step 10: Fire Department Review & Approval
Objective: Test department approval workflow with document verification
- Log out and log in as Fire Department:
- Email:
fire@goa.gov.in - Password:
Fire@123
- Email:
- Navigate to "Pending Approvals" or assigned requests
- Open the resort license request
- Review documents:
- ✅ All uploaded documents visible
- ✅ Document viewer shows:
- Thumbnails
- File hashes
- Version history (Version 1)
- No department reviews yet
- Click "Approve"
- Enter remarks: "Fire safety requirements met. All documents verified."
- Submit approval
Expected Results:
- ✅ Approval recorded with status "APPROVED"
- ✅ Blockchain transaction created for approval
- ✅ Approval timestamp recorded
- ✅ Remarks saved
Verify in Admin Portal (as admin):
- Transactions tab:
- ✅ New transaction for "ApprovalRecorded"
- ✅ Transaction linked to approval ID
- Events tab:
- ✅ "ApprovalRecorded" event present
- ✅ Department address in event data
- Request Documents (in admin or citizen view):
- ✅ Fire Department review shows "APPROVED"
- ✅ Reviewed by and timestamp visible
Step 11: Tourism Department Requests Changes
Objective: Test change request workflow and document versioning
- Log in as Tourism Department:
- Email:
tourism@goa.gov.in - Password:
Tourism@123
- Email:
- Open the same resort license request
- Review documents
- Click "Request Changes"
- Fill in change request:
Required Documents: Environmental Clearance Certificate Remarks: Additional environmental clearance required for beach resort operations. - Submit change request
Expected Results:
- ✅ Request status changes to "PENDING_RESUBMISSION"
- ✅ Change request recorded with timestamp
- ✅ Tourism review shows "CHANGES_REQUESTED"
- ✅ Fire Department approval status remains "APPROVED"
Step 12: Citizen Uploads New Document Version
Objective: Test document versioning and version history tracking
- Log in as citizen:
john.doe@example.com/Citizen@123 - Open the license request (now in "PENDING_RESUBMISSION" status)
- Click "Upload Additional Documents" or "Update Documents"
- Upload new document:
- Document Type: Environmental Clearance Certificate
- File: environmental_clearance.pdf
- Add change description: "Environmental clearance certificate from Goa Pollution Control Board"
- Submit
Expected Results:
- ✅ New document uploaded as Version 1
- ✅ Or existing document updated to Version 2
- ✅ Version history shows:
- Version 1: Original upload
- Version 2: Updated after change request (if applicable)
- Change description visible
- ✅ Document viewer in request details shows new version
- ✅ Version history table accessible via expansion panel
Step 13: Fire Approval Invalidated
Objective: Verify approval invalidation when documents change
Check Fire Department Approval Status:
- In request details (as admin or fire dept user)
- Find Fire Department approval
Expected Results:
- ✅ Fire approval shows "INVALIDATED" or "PENDING_REVALIDATION"
- ✅ Reason: "Document version changed"
- ✅ Original approval timestamp preserved
- ✅ Invalidation timestamp shown
Note: This may require backend logic to auto-invalidate approvals when documents are updated.
Step 14: Fire Department Re-Approves
Objective: Test re-approval after document changes
- Log in as Fire Department:
fire@goa.gov.in/Fire@123 - Open the resort license request (back in pending approvals)
- Review updated documents:
- ✅ Document viewer shows Version 2 (or new document)
- ✅ Version history shows all versions
- ✅ Change description visible
- Click "Approve"
- Enter remarks: "Reviewed updated documents. Fire safety still compliant."
- Submit approval
Expected Results:
- ✅ New approval recorded
- ✅ Status changes to "APPROVED" (again)
- ✅ New blockchain transaction created
- ✅ Approval timestamp updated
- ✅ Previous invalidated approval still in history
Step 15: Tourism Department Final Approval
Objective: Test final approval and license finalization
- Log in as Tourism Department:
tourism@goa.gov.in/Tourism@123 - Open the resort license request
- Review all documents including new environmental clearance
- Verify Fire Department approval is "APPROVED"
- Click "Approve"
- Enter remarks: "All tourism requirements met. Environmental clearance verified."
- Submit approval
Expected Results:
- ✅ Approval recorded successfully
- ✅ Request status changes to "APPROVED"
- ✅ All required department approvals complete
- ✅ NFT updated on blockchain (if applicable)
- ✅ Final approval timestamp recorded
Step 16: Verify Complete Approval Chain
Objective: Verify all approvals are visible in request details
- As citizen, open the approved license request
- Navigate to "Approvals" tab
Expected Results:
- ✅ Shows 2 approvals:
- Fire Department (Re-approved after invalidation)
- Status: APPROVED
- Remarks visible
- Timestamp present
- Tourism Department
- Status: APPROVED
- Remarks visible
- Timestamp present
- Fire Department (Re-approved after invalidation)
- ✅ Each approval shows department name, not just ID
- ✅ Approval timeline visible
Step 17: Verify Document History
Objective: Test complete document version tracking
- In the approved request, go to "Documents" tab
- Find each document
- Click to expand "Version History"
Expected Results:
- ✅ Environmental Clearance:
- Version 1: Initial upload after change request
- Uploaded by: John Doe
- Upload date visible
- File hash unique
- ✅ Other Documents:
- Version 1 only (if not changed)
- OR Version 1 & 2 if updated
- ✅ Each version has:
- Version number
- Upload timestamp
- Uploaded by (user name)
- File hash (first 8 chars)
- Download button
Step 18: Verify Department Reviews on Documents
Objective: Check department reviews are tracked per document
- In document viewer, check "Department Reviews" section
Expected Results:
- ✅ Each document shows reviews from:
- Fire Department: APPROVED (green chip)
- Tourism Department: APPROVED (green chip)
- ✅ Review includes:
- Department name
- Status (APPROVED/REJECTED/PENDING)
- Reviewed at timestamp
- Reviewed by (officer name)
- Comments (if any)
Step 19: Admin Dashboard Verification
Objective: Verify all data is visible in admin monitoring dashboards
As admin (admin@goa.gov.in), verify each dashboard:
Transactions Dashboard
- ✅ Shows all transactions:
- Initial request submission (LicenseRequested)
- Fire approval #1
- Tourism change request
- Fire approval #2 (after invalidation)
- Tourism final approval
- ✅ Each transaction shows:
- Transaction hash
- From/To addresses
- Status (CONFIRMED)
- Block number
- Gas used
- Linked to correct request/approval
- ✅ Statistics cards updated:
- Confirmed count increased
- Total transactions increased
Events Dashboard
- ✅ Shows all blockchain events:
- LicenseRequested
- ApprovalRecorded (x3: Fire, Tourism change, Fire re-approval, Tourism final)
- LicenseMinted (if applicable)
- LicenseUpdated (if NFT updated)
- ✅ Each event shows:
- Event type
- Contract address
- Block number
- Transaction hash
- Decoded parameters
- Timestamp
- ✅ Filters work correctly
- ✅ Event type chips color-coded
Logs Dashboard
- ✅ Shows application logs for all operations:
- User login events
- Request creation
- Document uploads
- Approval submissions
- Blockchain operations
- Errors (if any)
- ✅ Filters work:
- Level filter (INFO, WARN, ERROR)
- Module filter (AuthService, RequestService, etc.)
- Search functionality
- ✅ Error logs highlighted in red background
- ✅ Export to JSON works
Platform Stats
- ✅ Updated statistics:
- Total Requests: +1
- Request by Status: APPROVED: +1
- Total Documents: +5 (or however many uploaded)
- Total Blockchain Transactions: +5
- Applicants: +1 (new citizen)
- Departments: +1 (Police Department added)
Step 20: Document Download & Preview
Objective: Test document download and preview functionality
- As citizen, open approved license request
- Go to Documents tab
- For each document:
Test Download:
- Click "Download" button
- ✅ File downloads with correct filename
- ✅ File is intact and openable
Test Preview:
- Click "Preview" button or thumbnail
- ✅ Document opens in new tab/modal
- ✅ Content displays correctly
Test Hash Copy:
- Click copy icon next to file hash
- ✅ Hash copied to clipboard
- ✅ Confirmation message appears
🔍 Additional Verification Tests
Test User Management
- Admin Portal → Users Tab
- Verify new citizen appears:
- ✅ Email: john.doe@example.com
- ✅ Name: John Doe
- ✅ Role: APPLICANT
- ✅ Wallet Address: 0x...
- ✅ Last Login timestamp
Test Department Management
- Admin Portal → Departments Tab
- Click on "Police Department"
- Verify details:
- ✅ Code: POLICE_DEPT
- ✅ Name, Description, Contact info
- ✅ Wallet Address
- ✅ API Key (masked)
- ✅ Status: Active
- ✅ Created At timestamp
Test Request Filtering (if applicable)
- Create multiple requests with different statuses
- Test filtering by:
- Status (DRAFT, SUBMITTED, APPROVED, REJECTED)
- Date range
- Request type
Test Blockchain Explorer Links (if implemented)
- In request details with blockchain data
- Click "View on Explorer" links
- ✅ Opens blockchain explorer (Etherscan, etc.)
- ✅ Shows transaction details
- ✅ Shows NFT details
❌ Error Scenario Testing
Test Invalid Credentials
- Try logging in with wrong password
- ✅ Error message: "Invalid email or password"
- ✅ User stays on login page
Test Unauthorized Access
- Log in as citizen
- Try accessing
/admin
- ✅ Redirected to dashboard or shows "Unauthorized"
Test Duplicate Department Code
- As admin, try onboarding department with existing code
- ✅ Error message: "Department code already exists"
- ✅ Form not submitted
Test Missing Required Documents
- As citizen, try submitting request without required documents
- ✅ Error message: "Please upload all required documents"
- ✅ Submit button disabled
Test Approval by Unauthorized Department
- As Fire Department, try approving request not assigned to Fire
- ✅ Error or approval not allowed
📊 Performance Testing (Optional)
Load Testing
- Create 100+ license requests
- Verify:
- ✅ Pagination works smoothly
- ✅ Filters respond quickly
- ✅ No UI lag or freezing
Large Document Upload
- Upload document > 10MB
- Verify:
- ✅ Upload progress indicator
- ✅ Successful upload
- ✅ Hash generation works
✅ Test Completion Checklist
Core Functionality
- Admin login and portal access
- Department onboarding with wallet creation
- Citizen registration with wallet creation
- License request creation
- Document upload with hash generation
- Request submission with blockchain transaction
- Department approval workflow
- Change request submission
- Document versioning
- Approval invalidation on document change
- Re-approval after changes
- Final approval and license finalization
Admin Monitoring
- Platform statistics accurate
- Transaction tracking complete
- Event tracking functional
- Application logs viewer working
- User management displays all users
- Department management functional
Document Management
- Document viewer displays correctly
- Version history accessible
- Department reviews visible
- File hash displayed and copyable
- IPFS hash shown (if applicable)
- Download functionality works
- Preview functionality works
UI/UX
- Responsive design on mobile
- Loading spinners show during operations
- Error messages clear and helpful
- Success notifications appear
- Material Design consistent
- Color-coded status chips
- Pagination works on all lists
Security
- Passwords are hashed (bcrypt)
- Private keys encrypted (AES-256-CBC)
- JWT tokens expire correctly
- Unauthorized access blocked
- API endpoints protected
🐛 Known Issues & Limitations
Document any discovered issues here:
- Issue: [Description]
- Severity: High/Medium/Low
- Steps to Reproduce: [Steps]
- Expected: [Expected behavior]
- Actual: [Actual behavior]
- Fix Required: [Yes/No]
📝 Test Results Summary
Test Date: _____________
Tested By: _____________
Total Tests: 20 scenarios
Passed: ___ / 20
Failed: ___ / 20
Blocked: ___ / 20
Notes:
[Add any additional notes, observations, or recommendations here]
🚀 Next Steps After Testing
-
If All Tests Pass:
- Mark project as production-ready
- Deploy to staging environment
- Conduct UAT with actual users
-
If Tests Fail:
- Document failing tests
- Create bug tickets
- Prioritize fixes
- Retest after fixes
-
Performance Optimization:
- Profile slow API endpoints
- Optimize database queries
- Add caching where appropriate
- Consider pagination limits
-
Security Audit:
- Review all authentication flows
- Verify encryption implementation
- Check for SQL injection vulnerabilities
- Test CORS policies
📞 Support
For issues or questions during testing:
- Check backend logs:
backend/logs/ - Check browser console for frontend errors
- Review API documentation: http://localhost:3000/api
- Check database directly using SQL client
End of E2E Testing Guide