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()