70 lines
2.9 KiB
Python
70 lines
2.9 KiB
Python
#!/usr/bin/env python3
|
|
"""V141 E2E - Agents tooltip shows dedup breakdown"""
|
|
import asyncio, json, os
|
|
from playwright.async_api import async_playwright
|
|
|
|
OUT = "/var/www/html/api/blade-tasks/v141-agents-tooltip-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=v141", wait_until='load', timeout=30000)
|
|
await page.wait_for_timeout(3500)
|
|
|
|
state = await page.evaluate("""() => {
|
|
const ag = document.getElementById('v139-agents');
|
|
return {
|
|
agents_text: ag?.textContent,
|
|
agents_title: ag?.title,
|
|
agents_cursor: ag ? getComputedStyle(ag).cursor : null,
|
|
// Verify everything else intact
|
|
nr_text: document.getElementById('v140-nonreg')?.textContent,
|
|
aut_text: document.getElementById('v140-autonomy')?.textContent,
|
|
dashboards: document.getElementById('v139-dashboards')?.textContent
|
|
};
|
|
}""")
|
|
print("V141 state:", json.dumps(state, indent=2))
|
|
|
|
has_overlaps = 'overlaps' in (state['agents_title'] or '')
|
|
has_sources = 'paperclip_db' in (state['agents_title'] or '')
|
|
explains_discrepancy = '906' in (state['agents_title'] or '') and 'pages' in (state['agents_title'] or '')
|
|
|
|
await ctx.close()
|
|
await browser.close()
|
|
|
|
verdict = 'OK' if (
|
|
'906' in (state['agents_text'] or '') and
|
|
has_overlaps and
|
|
has_sources and
|
|
explains_discrepancy and
|
|
state['agents_cursor'] == 'help' and
|
|
state['nr_text'] and '200/201' in state['nr_text'] and
|
|
state['aut_text'] and 'GODMODE' in state['aut_text'] and
|
|
not errs
|
|
) else 'PARTIAL'
|
|
|
|
report = {
|
|
'v141': 'agents-dedup-tooltip',
|
|
'agents_shows_906': '906' in (state['agents_text'] or ''),
|
|
'title_has_overlaps_info': has_overlaps,
|
|
'title_lists_sources': has_sources,
|
|
'title_explains_discrepancy': explains_discrepancy,
|
|
'cursor_is_help': state['agents_cursor'] == 'help',
|
|
'title_preview': state['agents_title'],
|
|
'nr_live_still_200_201': '200/201' in (state['nr_text'] or ''),
|
|
'autonomy_intact': 'GODMODE' in (state['aut_text'] or ''),
|
|
'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())
|