Files
roa2web-service-auto/reports-app/frontend/scripts/README_ANDROID.md
Marius Mutu 6b13ffa183 Initial commit: ROA2WEB - FastAPI + Vue.js + Telegram Bot
Modern ERP Reports Application with microservices architecture

Tech Stack:
- Backend: FastAPI + python-oracledb (Oracle DB integration)
- Frontend: Vue.js 3 + PrimeVue + Vite
- Telegram Bot: python-telegram-bot + SQLite
- Infrastructure: Shared database pool, JWT authentication, SSH tunnel

Features:
- FastAPI backend with async Oracle connection pool
- Vue.js 3 responsive frontend with PrimeVue components
- Telegram bot alternative interface
- Microservices architecture with shared components
- Complete deployment support (Linux Docker + Windows IIS)
- Comprehensive testing (Playwright E2E + pytest)

Repository Structure:
- reports-app/ - Main application (backend, frontend, telegram-bot)
- shared/ - Shared components (database pool, auth, utils)
- deployment/ - Deployment scripts (Linux & Windows)
- docs/ - Project documentation
- security/ - Security scanning and git hooks
2025-10-25 14:55:08 +03:00

237 lines
6.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 📱 Android Testing Scripts
Scripturi pentru testarea aplicației ROA2WEB pe telefoane Android reale.
## 🎯 Scripturi Disponibile
| Script | Platform | Status | Descriere |
|--------|----------|---------|-----------|
| **android-test-setup.ps1** | Windows PowerShell | [OK] Functional | Setup complet Android testing |
| **android-disconnect.sh** | Bash/WSL | [OK] Functional | Cleanup port forwarding |
---
## Quick Start (Windows)
**In Windows PowerShell:**
```powershell
cd E:\proiecte\roa2web\roa2web\reports-app\frontend\scripts
# Setup complet (prima data)
.\android-test-setup.ps1
```
**Pentru cleanup:**
```bash
# In WSL (dupa testare)
cd /mnt/e/proiecte/roa2web/roa2web/reports-app/frontend
./scripts/android-disconnect.sh
```
**Screenshot-uri (Claude Code):**
Nu mai este nevoie de script pentru salvare screenshot-uri! Claude Code poate face screenshot-uri direct prin MCP (chrome-devtools-android) si le primeste inline pentru analiza.
---
## 📜 Documentație Detaliată
### 1⃣ `android-test-setup.ps1` (Windows PowerShell)
**Scop:** Configurare completă conexiune Android pentru testare
**Ce face:**
- ✅ Verifică ADB este instalat
- ✅ Verifică telefon conectat (WiFi sau USB)
- ✅ Configurează port forwarding pentru Chrome DevTools (9222)
- ✅ Configurează reverse port forwarding pentru acces aplicație (3000, 8001)
- ✅ Testează conexiunea la Chrome pe telefon
- ✅ Afișează informații rețea și configurare MCP
- ✅ Comenzi utile pentru debugging
**Utilizare:**
```powershell
cd E:\proiecte\roa2web\roa2web\reports-app\frontend\scripts
.\android-test-setup.ps1
```
**Când să rulezi:**
- Prima dată când conectezi telefonul
- După restart calculator/telefon
- Când port forwarding nu mai funcționează
- Pentru verificare setup
**Output exemplu:**
```
================================
🚀 ROA2WEB - Android Testing Setup
================================
✓ ADB este instalat
Android Debug Bridge version 1.0.41
✓ Telefon Android conectat: 1 dispozitiv(e)
10.0.20.114:38261 device
✓ Port forwarding configurat: localhost:9222 -> Chrome pe telefon
10.0.20.114:38261 tcp:9222 localabstract:chrome_devtools_remote
✓ Reverse port forwarding configurat
Frontend: http://localhost:3000
Backend: http://localhost:8001/api
IP-ul calculatorului: 10.0.20.144
```
---
### 2 `android-disconnect.sh` (Bash/WSL)
**Scop:** Cleanup port forwarding când termini testarea
**Ce face:**
- ✅ Șterge toate port forwarding-urile (9222, 3000, 8001)
- ✅ Șterge reverse port forwarding
- ✅ Cleanup complet pentru deconectare sigură
**Utilizare:**
```bash
cd /mnt/e/proiecte/roa2web/roa2web/reports-app/frontend
./scripts/android-disconnect.sh
```
**Când să rulezi:**
- După finalizarea sesiunii de testare
- Înainte de a deconecta telefonul
- Pentru cleanup general
**Output exemplu:**
```
🔌 Deconectare telefon Android și cleanup...
✓ Port forwarding șters
✓ Reverse port forwarding șters
✅ Deconectare completă!
```
---
## 🔧 Workflow Complet de Testare
### Setup Inițial (o dată):
**1. Instalează ADB pe Windows:**
```powershell
winget install Google.PlatformTools
```
**2. Configurează telefonul Android:**
```
Setări → Despre telefon → Apasă 7x "Build number"
Setări → Developer options → Activează "USB debugging"
Setări → Developer options → Activează "Wireless debugging"
```
**3. Conectează telefonul:**
- **WiFi:** `adb pair IP:PORT` apoi `adb connect IP:PORT`
- **USB:** Conectează cablu, acceptă "Allow USB debugging"
### Workflow Zilnic:
```powershell
# Windows PowerShell
# 1. Setup conexiune
cd E:\proiecte\roa2web\roa2web\reports-app\frontend\scripts
.\android-test-setup.ps1
# 2. Pornește aplicația (în WSL)
cd /mnt/e/proiecte/roa2web/roa2web
./start-dev.sh
# 3. Pe telefon Chrome: http://localhost:3000
# 4. In Claude Code: "fa screenshot de pe telefon" (MCP inline)
# 5. La final, cleanup (WSL)
./scripts/android-disconnect.sh
```
---
## 🐛 Troubleshooting
### "ADB not found"
```powershell
winget install Google.PlatformTools
# Sau download manual: https://developer.android.com/tools/releases/platform-tools
```
### "No Android device connected"
**WiFi:**
```powershell
adb pair 10.0.20.114:PORT # Portul din "Pair device"
adb connect 10.0.20.114:PORT # Portul wireless debugging
adb devices # Verifică
```
**USB:**
- Verifică cablul (unele sunt doar pentru încărcare)
- Deblochează telefonul
- Acceptă "Allow USB debugging"
### "Port forwarding nu funcționează"
```powershell
# Re-setup complet
.\android-test-setup.ps1
```
---
## ⚠️ Note Importante
### De ce `android-test-setup.sh` nu funcționează în WSL?
ADB în WSL2 **nu poate vedea** dispozitivele USB conectate la Windows. Chiar și cu ADB wireless, există probleme de networking între WSL2 și Android device.
**Soluție:** Folosește scripturile **PowerShell** care rulează ADB direct în Windows!
### Chrome DevTools MCP
Pentru ca Chrome DevTools MCP să funcționeze din WSL (Claude Code), trebuie:
1. Port forwarding activ: `adb forward tcp:9222 ...`
2. Windows port proxy: `netsh interface portproxy add v4tov4 ...`
3. Configurare MCP cu IP-ul fizic Windows: `http://10.0.20.144:9222`
Vezi `tests/ANDROID_TESTING_GUIDE.md` pentru setup complet.
---
## 📚 Documentație Suplimentară
- **ANDROID_QUICK_START.md** - Ghid rapid 5 minute
- **tests/ANDROID_TESTING_GUIDE.md** - Ghid complet cu troubleshooting
- **frontend/README.md** - Secțiunea "Testing on Real Android Devices"
---
## Summary
**Scripturi functionale:**
- [OK] `android-test-setup.ps1` (Windows PowerShell) - Setup complet
- [OK] `android-disconnect.sh` (WSL) - Cleanup
**Screenshot-uri:**
- Nu mai este nevoie de script dedicat
- Claude Code face screenshot-uri prin MCP (chrome-devtools-android) inline
**Testare optima:**
- Ruleaza android-test-setup.ps1 din Windows PowerShell
- Claude Code controleaza Chrome pe telefon prin MCP
---
**Autor:** ROA2WEB Development Team
**Data:** 2025-10-20
**Versiune:** 3.0 (Final cleanup - doar scripturi esentiale)