v1.0 - Version stable: multi-PC, détection UI-DETR-1, 3 modes exécution
- 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>
This commit is contained in:
134
run_real_documentation_tests.py
Normal file
134
run_real_documentation_tests.py
Normal file
@@ -0,0 +1,134 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Real Functionality Test Runner for Documentation System
|
||||
|
||||
Demonstrates how to run real functionality tests without mocks:
|
||||
- Starts real services
|
||||
- Uses real data
|
||||
- Tests actual user workflows
|
||||
- Validates real system behavior
|
||||
"""
|
||||
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
# Add current directory to path for imports
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
from test_documentation_tab_fixed import test_real_documentation_functionality
|
||||
from test_documentation_real_utils import RealServiceManager, RealDocumentationData
|
||||
|
||||
|
||||
def main():
|
||||
"""Run real functionality tests"""
|
||||
print("🚀 REAL FUNCTIONALITY TEST RUNNER")
|
||||
print("=" * 50)
|
||||
print()
|
||||
|
||||
# Check prerequisites
|
||||
print("🔍 Checking prerequisites...")
|
||||
|
||||
# Check if Chrome/Chromium is available
|
||||
try:
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
options.add_argument("--no-sandbox")
|
||||
|
||||
driver = webdriver.Chrome(options=options)
|
||||
driver.quit()
|
||||
print(" ✅ Chrome WebDriver available")
|
||||
except Exception as e:
|
||||
print(f" ❌ Chrome WebDriver not available: {e}")
|
||||
print(" Install ChromeDriver: https://chromedriver.chromium.org/")
|
||||
return False
|
||||
|
||||
# Check if project structure exists
|
||||
backend_dir = Path("visual_workflow_builder/backend")
|
||||
frontend_dir = Path("visual_workflow_builder/frontend")
|
||||
|
||||
if not backend_dir.exists():
|
||||
print(f" ❌ Backend directory not found: {backend_dir}")
|
||||
return False
|
||||
|
||||
if not frontend_dir.exists():
|
||||
print(f" ❌ Frontend directory not found: {frontend_dir}")
|
||||
return False
|
||||
|
||||
print(" ✅ Project structure OK")
|
||||
print()
|
||||
|
||||
# Run real functionality tests
|
||||
print("🧪 Running real functionality tests...")
|
||||
print()
|
||||
|
||||
try:
|
||||
success = test_real_documentation_functionality()
|
||||
|
||||
if success:
|
||||
print()
|
||||
print("🎉 ALL REAL FUNCTIONALITY TESTS PASSED!")
|
||||
print()
|
||||
print("Key achievements:")
|
||||
print("✅ Real services started and tested")
|
||||
print("✅ Real API endpoints validated")
|
||||
print("✅ Real data flow verified")
|
||||
print("✅ Real user interactions tested")
|
||||
print("✅ Real content validation passed")
|
||||
return True
|
||||
else:
|
||||
print()
|
||||
print("❌ REAL FUNCTIONALITY TESTS FAILED")
|
||||
print()
|
||||
print("This indicates issues with:")
|
||||
print("• Real service integration")
|
||||
print("• Actual data flow")
|
||||
print("• User interaction patterns")
|
||||
print("• Content loading mechanisms")
|
||||
return False
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\n⏹️ Tests interrupted by user")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"\n❌ Test runner error: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def demo_real_vs_mock_testing():
|
||||
"""Demonstrate the difference between real and mock testing"""
|
||||
print("\n📚 REAL vs MOCK TESTING COMPARISON")
|
||||
print("=" * 40)
|
||||
print()
|
||||
|
||||
print("🎭 MOCK TESTING (Traditional):")
|
||||
print("• Uses fake/simulated components")
|
||||
print("• Tests isolated units")
|
||||
print("• Fast but may miss integration issues")
|
||||
print("• Example: Mock API responses, fake DOM elements")
|
||||
print()
|
||||
|
||||
print("🎯 REAL FUNCTIONALITY TESTING (This approach):")
|
||||
print("• Uses actual running services")
|
||||
print("• Tests complete user workflows")
|
||||
print("• Slower but catches real-world issues")
|
||||
print("• Example: Real API calls, actual browser interaction")
|
||||
print()
|
||||
|
||||
print("🔄 HYBRID APPROACH (Recommended):")
|
||||
print("• Unit tests with mocks for speed")
|
||||
print("• Integration tests with real functionality")
|
||||
print("• End-to-end tests with real user scenarios")
|
||||
print()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
success = main()
|
||||
|
||||
if "--demo" in sys.argv:
|
||||
demo_real_vs_mock_testing()
|
||||
|
||||
sys.exit(0 if success else 1)
|
||||
Reference in New Issue
Block a user