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

90 lines
3.7 KiB
Python

#!/usr/bin/env python3
"""V105 - E2E Playwright video proof of WEVIA Master multi-agent autonomy"""
import asyncio, json, os, urllib.request
from playwright.async_api import async_playwright
OUT = "/var/www/html/api/blade-tasks/v105-wevia-master-autonomy"
os.makedirs(OUT, exist_ok=True)
# 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 def main():
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()
# Visit WEVIA Master
await page.goto("https://weval-consulting.com/wevia-master.html", wait_until='load', timeout=30000)
await page.wait_for_timeout(3000)
await page.screenshot(path=f"{OUT}/01-master-loaded.png", full_page=True)
diag1 = await page.evaluate("""() => ({
title: document.title,
body_len: document.body.innerText.length,
has_chat_input: !!document.querySelector('textarea, input[type="text"]'),
forms_count: document.querySelectorAll('form').length
})""")
print(f"WEVIA Master page: {json.dumps(diag1)}")
# Visit WEVIA Orchestrator (V101 unified)
await page.goto("https://weval-consulting.com/wevia-orchestrator.html", wait_until='load', timeout=30000)
await page.wait_for_timeout(5000)
await page.screenshot(path=f"{OUT}/02-orchestrator-721-agents.png", full_page=True)
diag2 = await page.evaluate("""() => {
const stAgents = document.getElementById('st-agents');
const stTools = document.getElementById('st-tools');
return {
title: document.title,
st_agents_value: stAgents ? stAgents.textContent : null,
st_tools_value: stTools ? stTools.textContent : null,
search_placeholder: (document.querySelector('#agentSearch')||{}).placeholder || null
};
}""")
print(f"Orchestrator: {json.dumps(diag2)}")
# Visit WTP (point d'entrée unique)
await page.goto("https://weval-consulting.com/weval-technology-platform.html", wait_until='load', timeout=30000)
await page.wait_for_timeout(3000)
await page.screenshot(path=f"{OUT}/03-wtp-entry-point.png", full_page=True)
diag3 = await page.evaluate("""() => ({
title: document.title,
body_len: document.body.innerText.length,
link_count: document.querySelectorAll('a[href*=".html"]').length,
has_big4: !!document.querySelector('a[href*="wevia-em-big4"]'),
has_value_streaming: !!document.querySelector('a[href*="value-streaming"]')
})""")
print(f"WTP: {json.dumps(diag3)}")
await context.close()
await browser.close()
# Final report
report = {
"ts": "V105 final",
"wevia_master": diag1,
"orchestrator_v101": diag2,
"wtp_entry_point_v98": diag3
}
with open(f"{OUT}/proof.json", "w") as f:
json.dump(report, f, indent=2)
print(json.dumps(report, indent=2))
asyncio.run(main())