37 lines
1.3 KiB
Bash
Executable File
37 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# UX Agent Cron — checks all pages for visual issues
|
|
PAGES="admin oss-discovery enterprise-model l99-brain wevia-cortex ai-benchmark wevia-vs-opus director sovereign-claude wevia-master"
|
|
PASS=0; FAIL=0; ISSUES=""
|
|
for P in $PAGES; do
|
|
R=$(timeout 12 python3 -c "
|
|
from playwright.sync_api import sync_playwright
|
|
import time
|
|
p=sync_playwright().start()
|
|
b=p.chromium.launch(headless=True)
|
|
pg=b.new_page()
|
|
pg.set_viewport_size({'width':1440,'height':900})
|
|
errs=[]
|
|
pg.on('pageerror',lambda e:errs.append(str(e)[:40]))
|
|
pg.goto('https://weval-consulting.com/${P}.html',wait_until='domcontentloaded',timeout=8000)
|
|
time.sleep(2)
|
|
txt=pg.evaluate('()=>document.body.innerText')
|
|
iss=[]
|
|
if 'undefined' in txt: iss.append('undefined')
|
|
if 'NaN' in txt: iss.append('NaN')
|
|
badges=[b.text_content() for b in pg.locator('.badge').all()]
|
|
empty=[b for b in badges if b.strip() in ['0','?','undefined','null','']]
|
|
if empty: iss.append(f'badges:{len(empty)}')
|
|
print(f'{len(errs)}|{"|".join(iss)}')
|
|
b.close();p.stop()
|
|
" 2>&1)
|
|
JS=$(echo "$R" | cut -d'|' -f1)
|
|
ISS=$(echo "$R" | cut -d'|' -f2-)
|
|
if [ "$JS" = "0" ] && [ -z "$ISS" ]; then
|
|
PASS=$((PASS+1))
|
|
else
|
|
FAIL=$((FAIL+1))
|
|
ISSUES="$ISSUES $P:$ISS"
|
|
fi
|
|
done
|
|
echo "UX-AGENT: $PASS/$((PASS+FAIL)) | Issues: $ISSUES" >> /opt/weval-l99/logs/ux-agent.log
|