8.9 KiB
8.9 KiB
📱 Panduan Testing Mobile Responsive di DevTools
🚀 Cara Test Dashboard Responsive dengan Device Emulation
Langkah 1: Buka Dashboard Admin
1. Buka browser (Chrome, Firefox, Edge)
2. Akses: http://localhost:8000/admin/dashboard
3. Login dengan: admin@gmail.com / admin123
Langkah 2: Buka DevTools
Windows/Linux: Tekan Ctrl + Shift + I
Mac: Tekan Cmd + Option + I
Atau: Klik kanan → Inspect
Langkah 3: Aktifkan Device Toolbar (Mobile Mode)
Windows/Linux: Tekan Ctrl + Shift + M
Mac: Tekan Cmd + Shift + M
Atau: DevTools → Click icon "Toggle device toolbar"
📱 Device Emulation yang Perlu Ditest
1. Mobile Phones (Portrait)
| Device | Resolution | Size |
|---|---|---|
| iPhone SE | 375×667 | Kecil |
| iPhone 12 | 390×844 | Medium |
| iPhone 13 Pro | 390×844 | Medium |
| iPhone 14 | 390×844 | Medium |
| Pixel 5 | 393×851 | Medium |
| Galaxy S21 | 360×800 | Kecil |
2. Tablet (Portrait & Landscape)
| Device | Portrait | Landscape |
|---|---|---|
| iPad Air | 768×1024 | 1024×768 |
| iPad Pro | 1024×1366 | 1366×1024 |
| Galaxy Tab | 600×960 | 960×600 |
3. Desktop
| Resolution | Size |
|---|---|
| 1366×768 | Laptop |
| 1920×1080 | Desktop Full HD |
| 2560×1440 | Desktop 2K |
✅ Checklist Testing Mobile Mode
Header/Navigation ✓
- Hamburger menu (≡) VISIBLE di mobile
- Hamburger menu HIDDEN di tablet+ (md breakpoint)
- Dark mode toggle VISIBLE di semua ukuran
- Logout button VISIBLE tapi text hidden di mobile
- Page title VISIBLE di mobile
Sidebar ✓
- Sidebar HIDDEN di mobile (default)
- Hamburger menu bisa membuka sidebar
- Sidebar bisa ditutup dengan overlay
- Sidebar link bisa ditutup otomatis saat diklik (mobile)
- Sidebar VISIBLE di tablet+ (md breakpoint)
Main Content ✓
- Grid layout 2 kolom di mobile
- Grid layout 2 kolom di tablet
- Grid layout 4 kolom di desktop
- No horizontal scroll di mobile
- Text readable di semua ukuran
- Padding/spacing optimal per device
Statistics Cards ✓
- Card height responsive
- Card padding compact di mobile
- Card padding full di desktop
- Icon size scalable (8px → 10px)
- Statistics text readable
Charts ✓
- Chart height 250px di mobile
- Chart height 320px di desktop
- Chart font size 10px di mobile
- Chart font size 12px di desktop
- Chart point radius 3px di mobile
- Chart point radius 5px di desktop
- Chart tidak terpotong (no overflow)
Tables ✓
- Table kolom hide/show sesuai breakpoint
- Mobile: Hanya Nama + Status visible
- Tablet: Nama, Email, Status visible
- Desktop: Semua kolom visible
- Thumbnail image responsive (8px → 12px)
- No horizontal scroll di mobile
Forms/Modals ✓
- Modal full width di mobile
- Modal centered + max-width di desktop
- Input fields full width di mobile
- Buttons properly spaced (44px min height)
- Form accessible dan tidak terjepit
🔄 Testing Steps Detail
Test 1: Mobile Layout (375px)
1. DevTools → Device Emulation → iPhone 12 (390×844)
2. Refresh page (Ctrl+R)
3. Verify:
✓ Sidebar hidden
✓ Hamburger menu visible
✓ 2 kolom grid
✓ Text readable
✓ No horizontal scroll
Test 2: Hamburger Menu Toggle
1. Mobile mode (375px)
2. Klik hamburger menu (≡) di header kiri
3. Verify:
✓ Sidebar slide dari kiri
✓ Overlay gelap muncul
✓ Sidebar tertutup saat klik link
✓ Sidebar tertutup saat klik overlay
Test 3: Resize from Mobile to Desktop
1. DevTools → Device Emulation → iPhone 12 (390×844)
2. Refresh page
3. Verifikasi mobile layout (sidebar hidden, hamburger visible)
4. Resize browser ke 768px (md breakpoint)
5. Verify:
✓ Sidebar auto-appear
✓ Hamburger auto-hide
✓ Layout adjust to 2 columns
Test 4: Resize from Desktop to Mobile
1. DevTools → Responsive (1920×1080)
2. Refresh page
3. Verifikasi desktop layout (sidebar visible, 4 columns)
4. Resize browser ke 374px (mobile)
5. Verify:
✓ Sidebar auto-hide
✓ Hamburger auto-show
✓ Layout adjust to 2 columns
Test 5: Tablet Landscape
1. DevTools → Device Emulation → iPad Air (Landscape 1024×768)
2. Refresh page
3. Verify:
✓ Sidebar visible (md: breakpoint)
✓ Hamburger hidden
✓ 2-4 kolom grid (bergantung desain)
✓ All content visible
Test 6: Chart Responsiveness
1. Mobile mode (375px)
2. Buka Dashboard atau System Statistics
3. Verify chart:
✓ Height 250px
✓ Font size small
✓ Point radius 3px
4. Resize ke desktop (1920px)
5. Verify chart:
✓ Height 320px
✓ Font size normal
✓ Point radius 5px
Test 7: All Pages Responsive
Testing pages:
1. Dashboard (/)
✓ Stat cards responsive
✓ Charts responsive
2. System Statistics (/system-statistics)
✓ Charts visible
✓ No overlap
3. Classification History (/classification-history)
✓ Table responsive
✓ Columns hide/show
4. Manage Admin (/manage-admin)
✓ Table responsive
✓ Modal adaptive
🐛 Troubleshooting
Problem: Sidebar tidak hilang di mobile
Solution:
1. Hard refresh: Ctrl+Shift+R (bukan Ctrl+R)
2. Clear DevTools: Tekan X di kanan atas DevTools
3. Buka file app.blade.php
4. Cek class: -translate-x-full pada sidebar-wrapper
5. Cek viewport meta tag ada: <meta name="viewport" ...>
Problem: Hamburger menu tidak berfungsi
Solution:
1. Buka DevTools Console (F12 → Console)
2. Verify tidak ada error (lihat warna merah)
3. Test manual: Ketik di console:
document.getElementById('menuToggle').click()
4. Klik hamburger di page, sidebar harus slide
Problem: Chart tidak responsive
Solution:
1. Buka file dengan chart (dashboard.blade.php)
2. Cek ada script:
const isMobile = window.innerWidth < 768;
Chart.js options dengan conditional values
3. Refresh page, cek di DevTools Console
Problem: Grid tidak berubah kolom
Solution:
1. Cek class pada grid:
grid grid-cols-2 md:grid-cols-2 lg:grid-cols-4
2. Hard refresh: Ctrl+Shift+R
3. Inspect element (F12)
4. Di DevTools, cek computed styles
5. Verifikasi breakpoint md (768px) dan lg (1024px)
Problem: Text terlalu kecil/besar
Solution:
1. Cek responsive text classes:
text-xs md:text-sm lg:text-base
2. Inspect element untuk lihat actual font-size
3. Browser zoom tidak mempengaruhi
4. Refresh page untuk reset
📊 Console Testing Commands
Paste di DevTools Console untuk cek:
// 1. Check viewport width
console.log('Viewport:', window.innerWidth, 'x', window.innerHeight);
// 2. Check breakpoints
console.log('Mobile (< 768px):', window.innerWidth < 768);
console.log('Tablet (≥ 768px):', window.innerWidth >= 768);
console.log('Desktop (≥ 1024px):', window.innerWidth >= 1024);
// 3. Check responsive elements
console.log('Sidebar visible:', !document.getElementById('sidebar-wrapper').classList.contains('-translate-x-full'));
console.log('Hamburger visible:', window.getComputedStyle(document.getElementById('menuToggle')).display !== 'none');
// 4. Manually toggle sidebar
document.getElementById('menuToggle').click();
// 5. Check all classes
console.log('Sidebar classes:', document.getElementById('sidebar-wrapper').className);
console.log('Overlay classes:', document.getElementById('sidebar-overlay').className);
✨ Expected Results
Mobile (390px)
✓ Sidebar: Hidden (-translate-x-full)
✓ Hamburger: Visible (md:hidden removed)
✓ Grid: 2 columns (grid-cols-2)
✓ Gap: Small (gap-3)
✓ Padding: Compact (p-3)
✓ Font: Small (text-xs)
✓ Charts: 250px height
✓ No horizontal scroll
Tablet (768px)
✓ Sidebar: Visible (md:translate-x-0)
✓ Hamburger: Hidden (md:hidden active)
✓ Grid: 2-4 columns adaptive
✓ Gap: Medium (gap-3/4)
✓ Padding: Medium (p-4/6)
✓ Font: Base (text-sm)
✓ Charts: 250-300px height
Desktop (1920px)
✓ Sidebar: Visible
✓ Hamburger: Hidden
✓ Grid: 4 columns (lg:grid-cols-4)
✓ Gap: Large (gap-6)
✓ Padding: Full (p-6)
✓ Font: Large (text-base)
✓ Charts: 320px height
🎯 Final Verification
Sebelum launch production:
- Semua page tested di 5+ resolusi
- Hamburger menu works di mobile
- Sidebar toggle works properly
- Charts responsive di semua ukuran
- Tables adaptive columns work
- No console errors
- No horizontal scroll mobile
- Touch targets 44px+ size
- Performance metrics OK
- Tested di Chrome, Firefox, Safari
Status: ✅ READY TO TEST
Last Updated: May 7, 2026
Version: 1.0