SatFetch-ISRO-BAH2026 / test_ui.py
silverballs's picture
Deploy SatFetch Space App - track binary files with Git LFS
0db1cb9
Raw
History Blame Contribute Delete
1.03 kB
from playwright.sync_api import sync_playwright
import time
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page(viewport={"width": 1400, "height": 900})
page.goto("http://localhost:7860", timeout=15000)
page.wait_for_load_state("networkidle", timeout=15000)
time.sleep(3)
file_input = page.locator("input[type='file']")
file_input.set_input_files("data/gallery/00000_optical_AnnualCrop.png")
time.sleep(2)
page.screenshot(path="screenshots/07_upload_filepath.png", full_page=True)
print("7: Upload with filepath type")
page.locator("button:has-text('Retrieve')").click()
time.sleep(8)
page.screenshot(path="screenshots/08_retrieve_filepath.png", full_page=True)
print("8: Retrieve with filepath type")
textareas = page.locator("textarea").all()
for i, ta in enumerate(textareas):
val = ta.input_value()
if val:
print(f" textarea[{i}]: {val}")
browser.close()