- 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>
125 lines
3.9 KiB
Python
125 lines
3.9 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Test Debug - Registry VWB
|
|
|
|
Auteur : Dom, Alice, Kiro - 10 janvier 2026
|
|
|
|
Test de debug pour le registre des actions VWB.
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Ajouter le répertoire racine au PYTHONPATH
|
|
project_root = Path(__file__).parent
|
|
sys.path.insert(0, str(project_root))
|
|
|
|
def test_registry_basic():
|
|
"""Test de base du registre."""
|
|
print("🔧 Test de base du registre...")
|
|
|
|
try:
|
|
from visual_workflow_builder.backend.actions.registry import VWBActionRegistry
|
|
|
|
# Créer une instance du registre
|
|
registry = VWBActionRegistry()
|
|
|
|
# Tenter la découverte automatique
|
|
print("🔍 Tentative de découverte automatique...")
|
|
discovered = registry.auto_discover_actions()
|
|
print(f"Actions découvertes : {discovered}")
|
|
|
|
# Lister les actions
|
|
actions = registry.list_actions()
|
|
print(f"Actions disponibles : {actions}")
|
|
|
|
# Lister les catégories
|
|
categories = registry.list_categories()
|
|
print(f"Catégories disponibles : {categories}")
|
|
|
|
# Statistiques
|
|
stats = registry.get_registry_stats()
|
|
print(f"Statistiques : {stats}")
|
|
|
|
return len(actions) > 0
|
|
|
|
except Exception as e:
|
|
print(f"❌ Erreur test registre: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
return False
|
|
|
|
def test_manual_registration():
|
|
"""Test d'enregistrement manuel."""
|
|
print("\n🔧 Test d'enregistrement manuel...")
|
|
|
|
try:
|
|
from visual_workflow_builder.backend.actions.registry import VWBActionRegistry
|
|
from visual_workflow_builder.backend.actions.vision_ui.focus_anchor import VWBFocusAnchorAction
|
|
from visual_workflow_builder.backend.actions.vision_ui.type_secret import VWBTypeSecretAction
|
|
|
|
# Créer une instance du registre
|
|
registry = VWBActionRegistry()
|
|
|
|
# Enregistrer manuellement quelques actions
|
|
success_count = 0
|
|
|
|
if registry.register_action(VWBFocusAnchorAction, "focus_anchor", "vision_ui"):
|
|
success_count += 1
|
|
|
|
if registry.register_action(VWBTypeSecretAction, "type_secret", "vision_ui"):
|
|
success_count += 1
|
|
|
|
print(f"Actions enregistrées manuellement : {success_count}")
|
|
|
|
# Lister les actions
|
|
actions = registry.list_actions()
|
|
print(f"Actions disponibles après enregistrement : {actions}")
|
|
|
|
# Tester la création d'une action
|
|
if "focus_anchor" in actions:
|
|
action = registry.create_action(
|
|
action_id="focus_anchor",
|
|
parameters={"visual_anchor": None, "focus_method": "hover"},
|
|
screen_capturer=None
|
|
)
|
|
if action:
|
|
print("✅ Création d'action réussie")
|
|
return True
|
|
else:
|
|
print("❌ Création d'action échouée")
|
|
|
|
return success_count > 0
|
|
|
|
except Exception as e:
|
|
print(f"❌ Erreur test enregistrement: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
return False
|
|
|
|
def main():
|
|
"""Fonction principale."""
|
|
print("🔍 TEST DEBUG - REGISTRY VWB")
|
|
print("=" * 40)
|
|
|
|
# Test de base
|
|
basic_success = test_registry_basic()
|
|
|
|
# Test d'enregistrement manuel
|
|
manual_success = test_manual_registration()
|
|
|
|
print(f"\n📊 RÉSUMÉ")
|
|
print("=" * 20)
|
|
print(f"Test de base: {'✅' if basic_success else '❌'}")
|
|
print(f"Test manuel: {'✅' if manual_success else '❌'}")
|
|
|
|
if basic_success or manual_success:
|
|
print("🎉 REGISTRE FONCTIONNEL!")
|
|
return True
|
|
else:
|
|
print("❌ PROBLÈMES AVEC LE REGISTRE")
|
|
return False
|
|
|
|
if __name__ == "__main__":
|
|
success = main()
|
|
sys.exit(0 if success else 1) |