Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Open the test view_session page in browser for visual testing | |
| """ | |
| import webbrowser | |
| import time | |
| import requests | |
| def open_view_session_test(): | |
| """Open the view_session test page in the default browser""" | |
| print("π Opening view_session test in browser...") | |
| # Check if server is running | |
| base_url = "http://localhost:7860" | |
| test_timestamp = "20250924_090627" | |
| test_url = f"{base_url}/view_session/{test_timestamp}" | |
| try: | |
| # Quick check if server is responding | |
| response = requests.get(base_url, timeout=3) | |
| print("β Server is running!") | |
| # Open the view_session page | |
| print(f"π Opening: {test_url}") | |
| webbrowser.open(test_url) | |
| print("\nπ What you should see:") | |
| print("β A modern, responsive image gallery") | |
| print("β Session timestamp: September 24, 2025 at 09:06:27") | |
| print("β 4 test images in a grid layout") | |
| print("β Images with labels: Realistic, Artistic, Vintage, Input") | |
| print("β Clickable images that open full-size") | |
| print("β Modern styling with hover effects") | |
| print("\nπ§ͺ Also test these URLs:") | |
| print(f"π± Main app: {base_url}") | |
| print(f"π Direct file: {base_url}/files/session_{test_timestamp}/generated_realistic_{test_timestamp}.jpg") | |
| print(f"π₯ Generated folder: {base_url}/Generated/") | |
| except requests.exceptions.ConnectionError: | |
| print("β Server is not running!") | |
| print("π‘ Start the server first:") | |
| print(" cd .cache && python app.py") | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| if __name__ == "__main__": | |
| open_view_session_test() |