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
4.9 KiB
4.9 KiB
ROA2WEB Test Runner Guide
Ghid pentru rularea testelor Playwright folosind scripturile disponibile.
🚀 Scripturi Disponibile
1. Script Bash (Linux/macOS/WSL)
./run_tests.sh [test_type] [browser] [mode]
2. Script Windows Batch
run_tests.bat [test_type] [browser] [mode]
3. Script Python (Cross-platform)
python run_tests.py [options]
📋 Opțiuni Disponibile
Tipuri de Teste
all- Toate testele (implicit)auth- Doar testele de autentificaredashboard- Doar testele dashboardinvoices- Doar testele facturipayments- Doar testele încasăriresponsive- Doar testele responsivesmoke- Testele critice (login + dashboard basic)
Browsere
chromium- Doar pe Chromiumfirefox- Doar pe Firefoxwebkit- Doar pe WebKit (Safari)mobile- Doar pe browsere mobile
Moduri de rulare
--headed- Cu interfață browser vizibilă--debug- Mod debug (pas cu pas)--ui- Cu Playwright UI--report- Afișează raportul
🛠️ Exemple de Utilizare
Bash/Linux/macOS
# Toate testele
./run_tests.sh
# Doar testele de autentificare
./run_tests.sh auth
# Testele dashboard pe Firefox cu UI
./run_tests.sh dashboard firefox --headed
# Teste smoke în mod debug
./run_tests.sh smoke --debug
# Afișează help
./run_tests.sh --help
Windows
REM Toate testele
run_tests.bat
REM Doar testele facturi
run_tests.bat invoices
REM Testele responsive pe Chromium
run_tests.bat responsive chromium
REM Teste cu Playwright UI
run_tests.bat all --ui
Python (Cross-platform)
# Toate testele
python run_tests.py
# Testele payments cu opțiuni avansate
python run_tests.py payments --workers 2 --retries 1
# Lista toate testele disponibile
python run_tests.py --list
# Testele care conțin "login" în nume
python run_tests.py --grep "login"
# Afișează help complet
python run_tests.py --help
🔧 Opțiuni Avansate (Python)
Scriptul Python oferă opțiuni suplimentare:
# Numărul de worker-i paraleli
python run_tests.py all --workers 4
# Numărul de reîncercări pentru testele failed
python run_tests.py auth --retries 2
# Timeout personalizat (în milisecunde)
python run_tests.py invoices --timeout 60000
# Filtrare cu regex
python run_tests.py --grep "should.*correctly"
# Combinații complexe
python run_tests.py responsive webkit --headed --workers 1
📊 Monitorizare și Raportare
Afișarea Raportului
# Bash
./run_tests.sh --report
# Windows
run_tests.bat --report
# Python
python run_tests.py --report
Listarea Testelor
# Doar cu Python
python run_tests.py --list
🎯 Workflow Recomandat
1. Dezvoltare Rapidă
# Teste smoke pentru verificare rapidă
./run_tests.sh smoke
# Testele unei funcționalități specifice
./run_tests.sh auth --headed
2. Testing Complet
# Toate testele pe toate browserele
./run_tests.sh all
# Testele responsive pe mobile
./run_tests.sh responsive mobile
3. Debugging
# Debug interactiv
./run_tests.sh auth --debug
# Cu UI pentru investigare
./run_tests.sh invoices --ui
4. CI/CD
# Pentru integrare continuă
python run_tests.py all --workers 2 --retries 1
🔧 Setup Inițial
1. Asigură-te că dependențele sunt instalate
cd roa2web/reports-app/frontend
npm install
2. (Opțional) Pornește serverul frontend
npm run dev
Nota: Testele funcționează și cu API-uri mock-uite
3. Rulează testele
./run_tests.sh
🚨 Troubleshooting
Problema: "command not found"
# Bash - fă scriptul executabil
chmod +x run_tests.sh
# Python - verifică că Python 3 este instalat
python3 --version
Problema: "Frontend server not detected"
# Pornește serverul în alt terminal
npm run dev
# Sau rulează testele cu mock-uri (implicit)
./run_tests.sh auth
Problema: "Playwright not installed"
npm install
npx playwright install
Problema: Teste failed
# Verifică cu debug mode
./run_tests.sh [test_type] --debug
# Sau cu UI pentru investigare
./run_tests.sh [test_type] --ui
# Afișează raportul detaliat
./run_tests.sh --report
📈 Performance Tips
- Rulare Paralelă: Folosește
--workers Npentru teste mai rapide - Browser Specific: Rulează pe un singur browser pentru dezvoltare
- Teste Smoke: Folosește
smokepentru verificări rapide - Mock APIs: Testele sunt optimizate să ruleze fără server backend
🎭 Informații Despre Teste
- Total teste: 262 (peste 5 browsere)
- Coverage: Login, Dashboard, Facturi, Încasări, Responsive
- Pattern: Page Object Model pentru mentenabilitate
- Mock: API responses pentru consistență
- Screenshots: Automat la failure
- Videos: Pentru testele failed
Pentru documentație completă despre teste, vezi tests/README.md