- Frontend v4 accessible sur réseau local (192.168.1.40) - Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard) - Ollama GPU fonctionnel - Self-healing interactif - Dashboard confiance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
139 lines
4.6 KiB
Python
139 lines
4.6 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Test de Validation Complète de la Palette VWB
|
|
|
|
Auteur : Dom, Alice, Kiro - 10 janvier 2026
|
|
|
|
Test pour valider que la palette VWB affiche maintenant toutes les 9 actions
|
|
du catalogue VisionOnly après la correction du backend.
|
|
"""
|
|
|
|
import requests
|
|
import json
|
|
from datetime import datetime
|
|
|
|
def test_api_actions():
|
|
"""Test de l'API pour vérifier le nombre d'actions."""
|
|
print("🔍 Test de l'API catalogue...")
|
|
|
|
try:
|
|
response = requests.get('http://localhost:5004/api/vwb/catalog/actions', timeout=5)
|
|
|
|
if response.status_code == 200:
|
|
data = response.json()
|
|
actions = data.get('actions', [])
|
|
total = data.get('total', 0)
|
|
|
|
print(f"✅ API accessible - {total} actions trouvées")
|
|
|
|
# Actions attendues
|
|
expected_actions = [
|
|
"click_anchor",
|
|
"type_text",
|
|
"wait_for_anchor",
|
|
"focus_anchor",
|
|
"type_secret",
|
|
"scroll_to_anchor",
|
|
"extract_text_from_anchor",
|
|
"validate_anchor_presence",
|
|
"hotkey"
|
|
]
|
|
|
|
print(f"🎯 Actions attendues: {len(expected_actions)}")
|
|
|
|
# Vérifier chaque action
|
|
found_actions = []
|
|
missing_actions = []
|
|
|
|
for expected in expected_actions:
|
|
found = any(action['id'] == expected for action in actions)
|
|
if found:
|
|
found_actions.append(expected)
|
|
print(f"✅ {expected}: Trouvée")
|
|
else:
|
|
missing_actions.append(expected)
|
|
print(f"❌ {expected}: Manquante")
|
|
|
|
# Résumé
|
|
success_rate = (len(found_actions) / len(expected_actions)) * 100
|
|
print(f"\n📊 RÉSULTATS:")
|
|
print(f" Actions trouvées: {len(found_actions)}/{len(expected_actions)} ({success_rate:.1f}%)")
|
|
|
|
if missing_actions:
|
|
print(f" Actions manquantes: {', '.join(missing_actions)}")
|
|
|
|
# Vérifier les catégories
|
|
categories = set(action['category'] for action in actions)
|
|
print(f" Catégories: {len(categories)} ({', '.join(sorted(categories))})")
|
|
|
|
return len(missing_actions) == 0
|
|
|
|
else:
|
|
print(f"❌ Erreur API: {response.status_code}")
|
|
return False
|
|
|
|
except Exception as e:
|
|
print(f"❌ Erreur de connexion: {e}")
|
|
return False
|
|
|
|
def test_health():
|
|
"""Test de santé du service."""
|
|
print("\n❤️ Test de santé du service...")
|
|
|
|
try:
|
|
response = requests.get('http://localhost:5004/api/vwb/catalog/health', timeout=5)
|
|
|
|
if response.status_code == 200:
|
|
data = response.json()
|
|
status = data.get('status', 'unknown')
|
|
services = data.get('services', {})
|
|
|
|
print(f"✅ Service: {status}")
|
|
print(f" Actions: {services.get('actions', 0)}")
|
|
print(f" Catégories: {services.get('categories', 0)}")
|
|
print(f" Mode: {data.get('mode', 'unknown')}")
|
|
|
|
return status == 'healthy'
|
|
else:
|
|
print(f"❌ Erreur santé: {response.status_code}")
|
|
return False
|
|
|
|
except Exception as e:
|
|
print(f"❌ Erreur santé: {e}")
|
|
return False
|
|
|
|
def main():
|
|
"""Fonction principale."""
|
|
print("🎯 TEST VALIDATION PALETTE COMPLÈTE VWB")
|
|
print("=" * 50)
|
|
print(f"Timestamp: {datetime.now().isoformat()}")
|
|
print("")
|
|
|
|
# Tests
|
|
health_ok = test_health()
|
|
api_ok = test_api_actions()
|
|
|
|
# Résumé final
|
|
print("\n" + "=" * 50)
|
|
print("📈 RÉSUMÉ FINAL")
|
|
|
|
if health_ok and api_ok:
|
|
print("🎉 SUCCÈS - La palette VWB devrait maintenant afficher toutes les actions!")
|
|
print("✨ 9 actions VisionOnly disponibles dans le catalogue")
|
|
print("")
|
|
print("🔄 Prochaines étapes:")
|
|
print(" 1. Actualisez votre navigateur sur le VWB")
|
|
print(" 2. Vérifiez que la palette affiche les 9 actions")
|
|
print(" 3. Testez le drag & drop des nouvelles actions")
|
|
return True
|
|
else:
|
|
print("❌ PROBLÈME DÉTECTÉ")
|
|
if not health_ok:
|
|
print(" - Service de santé non accessible")
|
|
if not api_ok:
|
|
print(" - API catalogue incomplète")
|
|
return False
|
|
|
|
if __name__ == "__main__":
|
|
success = main()
|
|
exit(0 if success else 1) |