# 📱 **Customer Dashboard App - Mobile Testing Guide**

## 🎯 **Testing Overview**

Ini adalah panduan lengkap untuk testing **Customer Dashboard Mobile App** - aplikasi Android native yang dibangun dengan Flutter untuk manajemen akun pelanggan ISP.

---

## 📋 **Pre-Testing Setup**

### **1. Install APK ke Android Device**

```bash
# APK Location
customer_dashboard_app/build/app/outputs/flutter-apk/app-release.apk (22MB)

# Installation Steps:
1. Transfer APK file ke Android device via USB/email
2. Enable "Install from Unknown Sources" di Android Settings
3. Tap APK file dan install
4. App icon akan muncul: "Customer Dashboard"
```

### **2. Backend API Requirements**

```php
# Laravel API harus running:
php artisan serve --host=0.0.0.0 --port=8000

# Endpoints yang digunakan:
- POST /api/mobile/customer/login
- GET /api/mobile/customer/dashboard  
- GET /api/mobile/customer/invoices
- GET /api/mobile/customer/profile
```

### **3. Test Data Setup**

```sql
-- Test Customer Account:
Email: test@customer.com
Password: password
Nomer Layanan: 202506160001

-- Verify in database:
SELECT * FROM customerakun WHERE email = 'test@customer.com';
SELECT * FROM pelanggan WHERE nomer_layanan = '202506160001';
```

---

## 🧪 **Testing Scenarios**

### **🔐 Scenario 1: Authentication Testing**

#### **Login Screen Tests**

**Test 1.1: Valid Login**
```
Input:
- Email: test@customer.com  
- Password: password

Expected Result:
✅ Success login
✅ Navigate to Dashboard
✅ Token saved
✅ Welcome message displayed
```

**Test 1.2: Invalid Credentials**
```
Input:
- Email: wrong@email.com
- Password: wrongpass

Expected Result:
❌ Error message: "Email atau password salah"
❌ Stay on login screen
❌ Form cleared
```

**Test 1.3: Validation Tests**
```
Empty Email:
❌ "Email harus diisi"

Invalid Email Format:
❌ "Format email tidak valid"

Empty Password:
❌ "Password harus diisi"

Password < 6 characters:
❌ "Password minimal 6 karakter"
```

**Test 1.4: UI/UX Tests**
```
✅ Password toggle show/hide works
✅ Loading spinner during login
✅ Responsive design on different screen sizes
✅ Keyboard handling (auto close on submit)
✅ Touch targets >= 44px
```

---

### **📊 Scenario 2: Dashboard Functionality**

#### **Dashboard Components Test**

**Test 2.1: Header Section**
```
Expected Display:
✅ "Halo, [Customer Name]!" greeting
✅ Notification bell with unread count badge
✅ Profile avatar/initial
✅ Beautiful gradient background
```

**Test 2.2: Statistics Cards**
```
Stats Cards Should Show:
✅ Total Invoice: [Number] tagihan
✅ Belum Bayar: Rp [Amount] 
✅ Sudah Bayar: Rp [Amount]
✅ Total Tagihan: Rp [Amount]

Data Validation:
✅ Numbers formatted with thousand separators
✅ Currency symbols display correctly
✅ Color coding for status (red for unpaid)
```

**Test 2.3: Connection Status Widget**
```
Connection Info:
✅ Status: Aktif/Tidak Aktif/Suspended
✅ Speed: "100 Mbps" atau sesuai paket
✅ Usage: "250 GB / 500 GB" dengan progress bar
✅ Visual status indicators (green/red/yellow)
```

**Test 2.4: Quick Actions**
```
Action Buttons:
✅ "Lihat Tagihan" → Navigate to Invoice tab
✅ "Bayar Sekarang" → Navigate to Invoice tab
✅ "Cek Koneksi" → Navigate to Connection tab
✅ Smooth transitions between tabs
```

---

### **🧾 Scenario 3: Invoice Management**

#### **Invoice List Tests**

**Test 3.1: Invoice Display**
```
Invoice List Should Show:
✅ Invoice items dengan status badges
✅ Amount formatting: "Rp 1.500.000"
✅ Due date: "Jatuh tempo: 25 Jan 2025"
✅ Status colors: Red (overdue), Yellow (pending), Green (paid)
```

**Test 3.2: Invoice Detail**
```
Tap any invoice:
✅ Opens detailed view
✅ Complete invoice information
✅ Payment status explanation
✅ Action buttons visible
✅ Back navigation works
```

**Test 3.3: Payment Flow**
```
From Invoice Detail:
✅ Tap "Bayar Sekarang"
✅ Payment methods bottom sheet appears
✅ Multiple payment options displayed
✅ Select payment method
✅ Redirect to payment gateway (simulation)
```

**Test 3.4: Invoice Actions**
```
Action Tests:
✅ Share invoice functionality
✅ Download PDF (if implemented)
✅ Copy invoice details
✅ Payment history view
```

---

### **📡 Scenario 4: Connection Monitoring**

#### **Connection Status Tests**

**Test 4.1: Status Display**
```
Connection Widget:
✅ Real-time status indicator
✅ Speed information display
✅ Usage statistics with progress bars
✅ Visual status indicators match data
```

**Test 4.2: Speed Test Section**
```
Speed Test Features:
✅ Download speed: "95.6 Mbps"
✅ Upload speed: "45.2 Mbps"
✅ "Jalankan Speed Test" button
✅ Progress indicators during test
✅ Results formatting and display
```

**Test 4.3: Usage Statistics**
```
Usage Display:
✅ Monthly usage with percentage
✅ Daily usage tracking
✅ Hourly real-time data
✅ Color coding for usage levels
✅ Threshold warnings (90%+ usage)
```

**Test 4.4: Troubleshooting Actions**
```
Action Buttons:
✅ "Test Koneksi" functionality
✅ "Reset Modem" instruction
✅ "Hubungi Support" contact options
✅ FAQ atau help documentation
```

---

### **🔔 Scenario 5: Notifications**

#### **Notification Tests**

**Test 5.1: Notification Bell**
```
Bell Icon Tests:
✅ Unread count badge displays correctly
✅ Tap opens notification screen
✅ Badge updates when notifications read
✅ Empty state when no notifications
```

**Test 5.2: Notification Types**
```
Notification Categories:
✅ Payment notifications (bills, payments)
✅ Maintenance alerts
✅ Promotional offers
✅ System status updates
✅ Account notifications
```

**Test 5.3: Notification Interactions**
```
Interaction Tests:
✅ Tap notification for detail view
✅ Mark as read functionality
✅ Delete notification option
✅ Action buttons within notifications
✅ Time stamps display correctly
```

**Test 5.4: Notification Content**
```
Content Display:
✅ "Tagihan Baru - Jatuh tempo 25 Januari 2025"
✅ "Maintenance Terjadwal - 15 Januari 02:00-05:00"
✅ "Promo Spesial - Upgrade gratis 3 bulan"
✅ Rich text formatting
✅ Proper truncation for long messages
```

---

### **👤 Scenario 6: Profile Management**

#### **Profile Tests**

**Test 6.1: Profile Display**
```
Profile Information:
✅ Customer avatar/initial
✅ Full name display
✅ Email address
✅ Contact information
✅ Account status indicator
```

**Test 6.2: Account Details**
```
Account Info:
✅ Nomor Layanan display
✅ Customer address
✅ Phone number
✅ Registration date
✅ Subscription status
```

**Test 6.3: Profile Actions**
```
Action Tests:
✅ Edit profile functionality
✅ Update contact information
✅ Change password option
✅ Account settings access
✅ Logout confirmation dialog
```

**Test 6.4: Logout Flow**
```
Logout Tests:
✅ Logout confirmation dialog
✅ Token cleared from storage
✅ Navigate back to login screen
✅ Previous session data cleared
✅ Re-login required for access
```

---

## 🎯 **Performance Testing**

### **Load Time Tests**
```
Performance Benchmarks:
✅ App launch: < 3 seconds
✅ Login response: < 2 seconds
✅ Dashboard load: < 1.5 seconds
✅ Tab switching: < 0.5 seconds
✅ Image loading: < 2 seconds
```

### **Memory Usage**
```
Memory Benchmarks:
✅ RAM usage: < 100MB
✅ No memory leaks detected
✅ Smooth scrolling performance
✅ No lag during navigation
✅ Background processing efficient
```

### **Network Tests**
```
Connectivity Tests:
✅ Works on WiFi
✅ Works on mobile data (3G/4G/5G)
✅ Handles network interruptions
✅ Retry mechanism for failed requests
✅ Offline mode graceful handling
```

---

## 📱 **Device Compatibility**

### **Android Versions**
```
✅ Android 8.0+ (API 26+)
✅ Android 9.0 (API 28)
✅ Android 10.0 (API 29)
✅ Android 11.0 (API 30)
✅ Android 12.0+ (API 31+)
```

### **Screen Sizes**
```
✅ Small screens (< 5 inches)
✅ Medium screens (5-6 inches)
✅ Large screens (6+ inches)
✅ Tablet landscape mode
✅ Different aspect ratios
```

### **Hardware Tests**
```
✅ Touch response accuracy
✅ Hardware back button
✅ Volume button handling
✅ Notification panel integration
✅ Recent apps switching
```

---

## 🔍 **Security Testing**

### **Data Security**
```
Security Checks:
✅ Token encryption
✅ Secure API communication (HTTPS)
✅ Local data encryption
✅ No sensitive data in logs
✅ Session timeout handling
```

### **Authentication Security**
```
Auth Security:
✅ Password input masking
✅ Failed login attempt limits
✅ Token expiration handling
✅ Secure logout process
✅ Biometric login (if supported)
```

---

## 🐛 **Bug Testing Checklist**

### **Common Issues to Check**
```
UI/UX Issues:
❌ Text overflow on small screens
❌ Button alignment problems
❌ Image loading failures
❌ Color contrast issues
❌ Font rendering problems

Functional Issues:
❌ API timeout errors
❌ JSON parsing failures
❌ Navigation stack problems
❌ State management bugs
❌ Memory leaks

Performance Issues:
❌ Slow loading times
❌ Choppy animations
❌ Battery drain
❌ High memory usage
❌ Network request failures
```

---

## 📊 **Testing Report Template**

### **Test Results Summary**
```
Tested By: [Name]
Test Date: [Date]  
Device: [Model & Android Version]
App Version: 1.0.0

✅ PASSED: [Count] tests
❌ FAILED: [Count] tests
⚠️ WARNINGS: [Count] issues

Overall Status: [PASS/FAIL]
```

### **Detailed Results**
```
Authentication: ✅ PASS
Dashboard: ✅ PASS  
Invoices: ✅ PASS
Connection: ✅ PASS
Notifications: ✅ PASS
Profile: ✅ PASS
Performance: ✅ PASS
Security: ✅ PASS
```

---

## 🚀 **Go Live Checklist**

### **Pre-Production**
```
✅ All test scenarios passed
✅ Performance benchmarks met
✅ Security review completed
✅ Device compatibility confirmed
✅ User acceptance testing done
```

### **Production Ready**
```
✅ APK signed for release
✅ API endpoints configured
✅ Database optimized
✅ Monitoring setup
✅ Support documentation ready
```

---

**🎉 Customer Dashboard App siap untuk testing comprehensive! Semua scenario telah didokumentasikan untuk quality assurance maksimal.** 📱✨ 