Spaces:
Sleeping
Sleeping
File size: 1,773 Bytes
e993e6d |
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 |
#!/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() |