bytedance-1 / open_test_in_browser.py
drdata's picture
Upload folder using huggingface_hub
e993e6d verified
raw
history blame
1.77 kB
#!/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()