litellm/scripts/boot.py
Devin AI 9a5e53d032 docs: autorouter form consistency verification evidence for 68abe95
Co-Authored-By: bot_apk <apk@cognition.ai>
2026-10-12 23:44:07 +00:00

17 lines
1 KiB
Python

import json, re
from playwright.sync_api import sync_playwright
pw = sync_playwright().start()
br = pw.chromium.connect_over_cdp("http://localhost:29229")
ctx = br.contexts[0]; page = ctx.pages[0] if ctx.pages else ctx.new_page()
page.set_viewport_size({"width":1440,"height":1000})
REQS = []
page.on("request", lambda r: REQS.append((r.method, r.url, r.post_data)) if r.method in ("POST","PATCH","PUT") and ":4000" in r.url else None)
KEY = re.search(r"master_key: (\S+)", open("/home/ubuntu/qa_ar/config.yaml").read()).group(1)
def shot(n): page.screenshot(path=f"/home/ubuntu/qa_ar/shots_base/{n}.png", full_page=False)
def login():
page.goto("http://localhost:3000/login"); page.wait_for_timeout(3000)
u = page.locator("input[name=username], input#username, input[type=text]").first
p = page.locator("input[type=password]").first
if p.count():
u.fill("admin"); p.fill(KEY); page.get_by_role("button", name=re.compile("log ?in|sign in", re.I)).first.click(); page.wait_for_timeout(4000)
print("url after login", page.url)