Spaces:
Running
Running
File size: 1,938 Bytes
9b48778 |
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 52 53 54 55 56 |
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()
|