Files
weval-l99/v101_e2e_orch.py
2026-04-24 04:38:58 +02:00

54 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""V101 - E2E Playwright proof: orchestrator displays 721 unified agents"""
import asyncio, json, urllib.request, os
from playwright.async_api import async_playwright
OUT = "/var/www/html/api/blade-tasks/v101-orchestrator-proof"
os.makedirs(OUT, exist_ok=True)
async def main():
# Get auth session
req = urllib.request.Request(
"http://127.0.0.1/api/opus-test-session-v94.php?k=WEVADS2026",
headers={"Host": "weval-consulting.com"}
)
sid = json.loads(urllib.request.urlopen(req, timeout=5).read().decode()).get("session_id")
print(f"Session: {sid}")
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True, args=['--no-sandbox'])
context = await browser.new_context(
viewport={'width': 1920, 'height': 1080},
record_video_dir=OUT
)
await context.add_cookies([{
"name": "PHPSESSID", "value": sid,
"domain": ".weval-consulting.com", "path": "/",
"secure": True, "httpOnly": True, "sameSite": "Lax"
}])
page = await context.new_page()
await page.goto("https://weval-consulting.com/wevia-orchestrator.html", wait_until='load', timeout=30000)
await page.wait_for_timeout(8000)
diag = await page.evaluate("""() => {
const el = document.getElementById('st-agents');
const subtitle_match = document.body.innerText.match(/(\\d+)\\s+agents/);
return {
title: document.title,
st_agents: el ? el.textContent : null,
body_len: document.body.innerText.length,
subtitle_count: subtitle_match ? subtitle_match[1] : null,
search_placeholder: (document.querySelector('#agentSearch')||{}).placeholder || null
};
}""")
await page.screenshot(path=f"{OUT}/orchestrator-unified-721.png", full_page=True)
await context.close()
await browser.close()
print(json.dumps(diag, indent=2))
with open(f"{OUT}/proof.json", "w") as f:
json.dump(diag, f, indent=2)
asyncio.run(main())