88 lines
4.1 KiB
Python
88 lines
4.1 KiB
Python
#!/usr/bin/env python3
|
|
"""V142 E2E - Footer strip renders, fetches ecosystem health live"""
|
|
import asyncio, json, os
|
|
from playwright.async_api import async_playwright
|
|
|
|
OUT = "/var/www/html/api/blade-tasks/v142-footer-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=v142", wait_until='load', timeout=30000)
|
|
await page.wait_for_timeout(3500)
|
|
|
|
state = await page.evaluate("""() => {
|
|
const f = document.getElementById('v142-footer');
|
|
return {
|
|
footer_exists: !!f,
|
|
footer_display: f ? getComputedStyle(f).display : null,
|
|
footer_position: f ? getComputedStyle(f).position : null,
|
|
score: document.getElementById('v142-score')?.textContent,
|
|
l99: document.getElementById('v142-l99')?.textContent,
|
|
tools: document.getElementById('v142-tools')?.textContent,
|
|
docker: document.getElementById('v142-docker')?.textContent,
|
|
providers: document.getElementById('v142-providers')?.textContent,
|
|
qdrant: document.getElementById('v142-qdrant')?.textContent,
|
|
ollama: document.getElementById('v142-ollama')?.textContent,
|
|
footer_title: f?.title
|
|
};
|
|
}""")
|
|
print("V142 state:", json.dumps(state, indent=2))
|
|
await page.screenshot(path=f"{OUT}/01-footer-bottom.png", clip={'x':0,'y':1020,'width':1920,'height':60})
|
|
|
|
# Verify other features still work (regression)
|
|
await page.click('[data-view="dashboards"]')
|
|
await page.wait_for_timeout(3000)
|
|
dash_tiles = await page.evaluate("() => document.querySelectorAll('#dash-grid a').length")
|
|
truth_strip = await page.evaluate("() => !!document.getElementById('v139-truth-strip')")
|
|
kpi_banner = await page.evaluate("() => !!document.getElementById('v135-kpi-live')")
|
|
|
|
await ctx.close()
|
|
await browser.close()
|
|
|
|
verdict = 'OK' if (
|
|
state['footer_exists'] and
|
|
state['footer_position'] == 'fixed' and
|
|
state['score'] and '%' in state['score'] and
|
|
state['l99'] and 'L99' in state['l99'] and
|
|
state['tools'] and 'Tools' in state['tools'] and
|
|
state['docker'] and 'Docker' in state['docker'] and
|
|
state['providers'] and 'Providers' in state['providers'] and
|
|
dash_tiles >= 80 and
|
|
truth_strip and kpi_banner and
|
|
not errs
|
|
) else 'PARTIAL'
|
|
|
|
report = {
|
|
'v142': 'footer-strip-ecosystem',
|
|
'footer_exists': state['footer_exists'],
|
|
'footer_fixed_position': state['footer_position'] == 'fixed',
|
|
'score_rendered': bool(state['score'] and '%' in state['score']),
|
|
'l99_rendered': bool(state['l99'] and '/' in state['l99']),
|
|
'tools_rendered': bool(state['tools']),
|
|
'docker_rendered': bool(state['docker']),
|
|
'providers_rendered': bool(state['providers']),
|
|
'qdrant_rendered': bool(state['qdrant']),
|
|
'ollama_rendered': bool(state['ollama']),
|
|
'title_has_source': 'ecosystem-health.php' in (state['footer_title'] or ''),
|
|
'score_preview': state['score'],
|
|
'l99_preview': state['l99'],
|
|
'tools_preview': state['tools'],
|
|
'v139_truth_strip_intact': truth_strip,
|
|
'v135_kpi_banner_intact': kpi_banner,
|
|
'dashboards_tab_still_84': dash_tiles >= 80,
|
|
'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())
|