#!/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.")