Spaces:
Running
Running
| from playwright.sync_api import sync_playwright | |
| import os | |
| def run(): | |
| with sync_playwright() as p: | |
| browser = p.chromium.launch(headless=True) | |
| page = browser.new_page() | |
| url = "https://auxteam-usersyncinterface.hf.space" | |
| print(f"Navigating to {url}...") | |
| page.goto(url) | |
| # Wait for app to load | |
| page.wait_for_selector('text=Branding Content Testing', timeout=60000) | |
| print("Page loaded successfully.") | |
| # Check for info box | |
| page.wait_for_selector('text=Configuration Required', timeout=10000) | |
| print("Info box found.") | |
| # Check for Job Title default | |
| view_mode = page.locator('select').nth(1).input_value() | |
| print(f"Default view mode: {view_mode}") | |
| # Check for Right Output Panel | |
| page.wait_for_selector('text=Output', timeout=10000) | |
| print("Output panel found.") | |
| # Open Chat | |
| page.click('text=Open Global Chat') | |
| page.wait_for_selector('text=New Simulation', timeout=10000) | |
| print("Chat page opened.") | |
| # Check for Send and Simulate buttons | |
| page.wait_for_selector('text=Send', timeout=10000) | |
| page.wait_for_selector('text=Simulate', timeout=10000) | |
| print("Send and Simulate buttons found.") | |
| # Check for Help Me Craft | |
| page.wait_for_selector('text=Help Me Craft', timeout=10000) | |
| print("Help Me Craft button found.") | |
| # Check for Upload Images | |
| page.wait_for_selector('text=Upload Images', timeout=10000) | |
| print("Upload Images button found.") | |
| # Take screenshot | |
| os.makedirs("/home/jules/verification", exist_ok=True) | |
| page.screenshot(path="/home/jules/verification/hf_live_test.png", full_page=True) | |
| print("Screenshot saved.") | |
| browser.close() | |
| if __name__ == "__main__": | |
| run() | |