File size: 3,048 Bytes
8024c76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python3
"""
Test script to verify the app is displaying advanced features
"""

import requests
import json
import time

def test_app_features():
    """Test if the app is displaying advanced features"""
    print("πŸ” Testing app features...")
    
    # Test 1: Check if app is running
    try:
        response = requests.get("http://localhost:8501/_stcore/health", timeout=5)
        if response.status_code == 200:
            print("βœ… App is running and healthy")
        else:
            print(f"❌ App health check failed: {response.status_code}")
            return False
    except Exception as e:
        print(f"❌ App not accessible: {e}")
        return False
    
    # Test 2: Check if analytics are loading
    try:
        # Import the app module to check analytics status
        import sys
        import os
        sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
        
        import frontend.app as app
        
        # Check analytics availability
        if hasattr(app, 'ANALYTICS_AVAILABLE') and app.ANALYTICS_AVAILABLE:
            print("βœ… Advanced analytics are available")
        else:
            print("❌ Advanced analytics are not available")
            return False
            
    except Exception as e:
        print(f"❌ Analytics check failed: {e}")
        return False
    
    # Test 3: Check if nonfarm payroll indicator is included
    try:
        from config.settings import DEFAULT_SERIES_LIST
        if 'PAYEMS' in DEFAULT_SERIES_LIST:
            print("βœ… Nonfarm payroll indicator (PAYEMS) is included")
        else:
            print("❌ Nonfarm payroll indicator not found")
            return False
    except Exception as e:
        print(f"❌ Series list check failed: {e}")
        return False
    
    # Test 4: Check if advanced visualizations are available
    try:
        from src.analysis.comprehensive_analytics import ComprehensiveAnalytics
        print("βœ… Advanced analytics module is available")
    except Exception as e:
        print(f"❌ Advanced analytics module not available: {e}")
        return False
    
    print("\nπŸŽ‰ All tests passed! The app should be displaying:")
    print("- Advanced analytics and visualizations")
    print("- Nonfarm payroll indicator (PAYEMS)")
    print("- Real-time economic data")
    print("- Mathematical fixes and enhanced UI")
    
    return True

if __name__ == "__main__":
    print("πŸ§ͺ Testing App Features")
    print("=" * 50)
    
    success = test_app_features()
    
    if success:
        print("\nβœ… Your app is running with all the advanced features!")
        print("🌐 Open http://localhost:8501 in your browser to see:")
        print("   - Executive Dashboard with real-time data")
        print("   - Advanced Analytics with mathematical fixes")
        print("   - Economic Indicators including nonfarm payroll")
        print("   - Enhanced visualizations and insights")
    else:
        print("\n⚠️ Some features may not be working properly.")