- /api/wired-pending/intent-opus4-chrome_cdp_autoheal_w309.php - Cron */5min installe sur /etc/cron.d/wevia-chrome-autoheal - Load guard 45 threshold + circuit breaker +5 - 8/8 CDP stable verified - Doctrine 309
45 lines
2.4 KiB
JavaScript
45 lines
2.4 KiB
JavaScript
const { chromium } = require('playwright');
|
|
const fs = require('fs');
|
|
const { execSync } = require('child_process');
|
|
const TS = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
const OUT = `/var/www/html/proofs/wevia-ux-final-${TS}`;
|
|
fs.mkdirSync(`${OUT}/zooms`, { recursive: true });
|
|
|
|
// Top 10 most critical enriched pages
|
|
const PAGES = ['paperclip-dashboard','deerflow-hub','ai-hub','wevia-master','all-ia-hub','wevia-orchestrator','brain-council','agents-hub','wevia-meeting-rooms','wevia-cortex'];
|
|
|
|
(async () => {
|
|
const browser = await chromium.launch({ headless: true, args: ['--no-sandbox','--disable-gpu','--disable-dev-shm-usage'] });
|
|
const results = [];
|
|
for (const name of PAGES) {
|
|
let context;
|
|
try {
|
|
context = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
|
const pg = await context.newPage();
|
|
await pg.goto(`https://weval-consulting.com/${name}.html`, { waitUntil: 'domcontentloaded', timeout: 12000 });
|
|
await pg.waitForTimeout(1500);
|
|
await pg.screenshot({ path: `${OUT}/zooms/${name}-tr.png`, clip: { x: 1040, y: 0, width: 400, height: 400 } });
|
|
await pg.screenshot({ path: `${OUT}/zooms/${name}-br.png`, clip: { x: 1040, y: 500, width: 400, height: 400 } });
|
|
const overlaps = await pg.evaluate(() => {
|
|
const fn = (x1,y1,x2,y2) => {
|
|
const all = document.querySelectorAll('button,.btn,.toggle,[class*="toggle"],[class*="btn"],.chip,.badge,.fab,[style*="position:fixed"]');
|
|
let n = 0;
|
|
for (const el of all) { const r=el.getBoundingClientRect(); if(r.width<2||r.height<2)continue; const cx=r.x+r.width/2,cy=r.y+r.height/2; if(cx>=x1&&cx<=x2&&cy>=y1&&cy<=y2)n++; }
|
|
return n;
|
|
};
|
|
return { tr: fn(1040,0,1440,400), br: fn(1040,500,1440,900) };
|
|
});
|
|
results.push({ hub: name, tr: overlaps.tr, br: overlaps.br, ok: true });
|
|
await pg.close();
|
|
await context.close();
|
|
} catch (e) {
|
|
results.push({ hub: name, error: e.message.slice(0,100) });
|
|
try { await context.close(); } catch {}
|
|
}
|
|
}
|
|
await browser.close();
|
|
const summary = { doctrine: '171', ts: new Date().toISOString(), pages: PAGES.length, results };
|
|
fs.writeFileSync(`${OUT}/summary.json`, JSON.stringify(summary, null, 2));
|
|
console.log(JSON.stringify({ ok: true, outdir: OUT.replace('/var/www/html',''), pages: PAGES.length, results }));
|
|
})();
|