93 lines
4.2 KiB
Python
93 lines
4.2 KiB
Python
#!/usr/bin/env python3
|
|
"""V139 E2E - Truth strip renders, fetches registry, shows all 6 counts"""
|
|
import asyncio, json, os
|
|
from playwright.async_api import async_playwright
|
|
|
|
OUT = "/var/www/html/api/blade-tasks/v139-truth-strip-proof"
|
|
os.makedirs(OUT, exist_ok=True)
|
|
|
|
async def main():
|
|
async with async_playwright() as p:
|
|
browser = await p.chromium.launch(headless=True, args=['--no-sandbox'])
|
|
ctx = await browser.new_context(viewport={'width':1920,'height':1080})
|
|
page = await ctx.new_page()
|
|
errs = []
|
|
page.on('pageerror', lambda e: errs.append(str(e)))
|
|
|
|
await page.goto("https://weval-consulting.com/all-ia-hub.html?v=v139", wait_until='load', timeout=30000)
|
|
await page.wait_for_timeout(3000) # wait for fetch
|
|
|
|
state = await page.evaluate("""() => {
|
|
const strip = document.getElementById('v139-truth-strip');
|
|
const agents = document.getElementById('v139-agents');
|
|
const intents = document.getElementById('v139-intents');
|
|
const skills = document.getElementById('v139-skills');
|
|
const brains = document.getElementById('v139-brains');
|
|
const doctrines = document.getElementById('v139-doctrines');
|
|
const dashboards = document.getElementById('v139-dashboards');
|
|
return {
|
|
strip_exists: !!strip,
|
|
strip_href: strip?.getAttribute('href'),
|
|
strip_title: strip?.title,
|
|
agents: agents?.textContent,
|
|
intents: intents?.textContent,
|
|
skills: skills?.textContent,
|
|
brains: brains?.textContent,
|
|
doctrines: doctrines?.textContent,
|
|
dashboards: dashboards?.textContent,
|
|
strip_innerHTML_preview: strip?.innerHTML?.substring(0, 500)
|
|
};
|
|
}""")
|
|
print("Truth strip state:", json.dumps(state, indent=2))
|
|
await page.screenshot(path=f"{OUT}/01-truth-strip-top.png", clip={'x':0,'y':0,'width':1920,'height':120})
|
|
|
|
# Verify Hub still has breadcrumb above truth strip (V130 intact)
|
|
breadcrumb = await page.evaluate("""() => !!document.getElementById('v130-xnav')""")
|
|
# Verify health modal still works (V136)
|
|
await page.click('#v135-kpi-live')
|
|
await page.wait_for_timeout(1200)
|
|
modal = await page.evaluate("() => document.getElementById('v136-health-modal')?.style.display")
|
|
await page.keyboard.press('Escape')
|
|
await page.wait_for_timeout(400)
|
|
|
|
await ctx.close()
|
|
await browser.close()
|
|
|
|
verdict = 'OK' if (
|
|
state['strip_exists'] and
|
|
state['strip_href'] == '/wevia-unified-hub.html' and
|
|
state['agents'] and '906' in state['agents'] and
|
|
state['intents'] and '1' in state['intents'] and # 1 263 or 1,263
|
|
state['skills'] and '15' in state['skills'] and
|
|
state['brains'] and '25' in state['brains'] and
|
|
state['doctrines'] and '19' in state['doctrines'] and
|
|
state['dashboards'] and '96' in state['dashboards'] and
|
|
breadcrumb and
|
|
modal == 'flex' and
|
|
not errs
|
|
) else 'PARTIAL'
|
|
|
|
report = {
|
|
'v139': 'truth-registry-strip',
|
|
'strip_exists': state['strip_exists'],
|
|
'links_to_truth_hub': state['strip_href'] == '/wevia-unified-hub.html',
|
|
'all_6_counts_loaded': all(state.get(k) and any(ch.isdigit() for ch in state[k]) for k in ['agents','intents','skills','brains','doctrines','dashboards']),
|
|
'counts_preview': {
|
|
'agents': state['agents'],
|
|
'intents': state['intents'],
|
|
'skills': state['skills'],
|
|
'brains': state['brains'],
|
|
'doctrines': state['doctrines'],
|
|
'dashboards': state['dashboards'],
|
|
},
|
|
'breadcrumb_V130_intact': breadcrumb,
|
|
'modal_V136_intact': modal == 'flex',
|
|
'js_errors': errs,
|
|
'VERDICT': verdict
|
|
}
|
|
with open(f"{OUT}/proof.json",'w') as f: json.dump(report, f, indent=2)
|
|
print("=== VERDICT:", verdict)
|
|
print(json.dumps(report, indent=2))
|
|
|
|
asyncio.run(main())
|