Files
weval-l99/qa-hub.py
2026-04-15 01:38:46 +02:00

51 lines
1.9 KiB
Python
Executable File

#!/usr/bin/env python3
"""WEVIA QA Hub v1 — Selenium E2E"""
import json,sys
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opts = Options()
opts.add_argument("--headless")
opts.add_argument("--no-sandbox")
opts.add_argument("--disable-dev-shm-usage")
opts.binary_location = "/usr/bin/chromium-browser"
PAGES = [
("homepage","https://weval-consulting.com/"),
("wevia-master","https://weval-consulting.com/wevia-master.html"),
("growth-engine","https://weval-consulting.com/growth-engine-v2.html"),
("blade-ai","https://weval-consulting.com/blade-ai.html"),
("arena","https://weval-consulting.com/weval-arena.html"),
("director","https://weval-consulting.com/director-center.html"),
("ops-center","https://weval-consulting.com/ops-center.html"),
("wevcode","https://weval-consulting.com/wevcode.html"),
("agents-archi","https://weval-consulting.com/agents-archi.html"),
("l99-brain","https://weval-consulting.com/l99-brain.html"),
]
results = []
try:
driver = webdriver.Chrome(options=opts)
driver.set_page_load_timeout(15)
for name, url in PAGES:
try:
driver.get(url)
title = driver.title[:40]
ok = "500" not in title and "error" not in title.lower() and "404" not in title
results.append({"page":name,"title":title,"ok":ok})
except Exception as e:
results.append({"page":name,"ok":False,"err":str(e)[:40]})
driver.quit()
except Exception as e:
results.append({"err":str(e)[:80]})
p = sum(1 for r in results if r.get("ok"))
t = len([r for r in results if "page" in r])
report = {"ts":datetime.now().isoformat(),"pass":p,"total":t,"pct":round(p/t*100) if t else 0,"results":results}
print(json.dumps(report))
with open("/var/www/html/api/qa-latest.json","w") as f:
json.dump(report, f, indent=2)