46 lines
1.9 KiB
JavaScript
46 lines
1.9 KiB
JavaScript
const { chromium } = require('playwright');
|
|
const fs = require('fs');
|
|
|
|
(async () => {
|
|
const browser = await chromium.launch({ headless: true });
|
|
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
|
const page = await ctx.newPage();
|
|
|
|
await page.addInitScript(() => {
|
|
try { localStorage.setItem('weval_internal', 'yacine-2026'); } catch(e){}
|
|
});
|
|
|
|
const results = [];
|
|
const pages_to_test = [
|
|
{ name: 'wevia-admin', url: 'https://weval-consulting.com/wevia-admin.html' },
|
|
{ name: 'wevia-admin-index', url: 'https://weval-consulting.com/wevia-admin/index.html' },
|
|
{ name: 'business-kpi', url: 'https://weval-consulting.com/business-kpi-dashboard.php' },
|
|
{ name: 'crm-html', url: 'https://weval-consulting.com/crm.html' },
|
|
{ name: 'wevia-unified-hub', url: 'https://weval-consulting.com/wevia-unified-hub.html' }
|
|
];
|
|
|
|
for (const p of pages_to_test) {
|
|
try {
|
|
await page.goto(p.url, { waitUntil: 'load', timeout: 20000 });
|
|
await page.waitForTimeout(2500);
|
|
const diag = await page.evaluate(() => {
|
|
return {
|
|
href: location.href,
|
|
title: document.title,
|
|
badgeScript: !!document.querySelector('script[src*="archi-meta-badge"]'),
|
|
badgeLoaded: window.__WEVAL_META_BADGE_LOADED === true,
|
|
spotlightScript: !!document.querySelector('script[src*="archi-spotlight"]'),
|
|
bodyLen: document.body.innerText.length,
|
|
};
|
|
});
|
|
results.push({ input: p.name, ...diag });
|
|
} catch(e) {
|
|
results.push({ input: p.name, err: e.message.substring(0, 100) });
|
|
}
|
|
}
|
|
|
|
await browser.close();
|
|
fs.writeFileSync('/tmp/v90c-diag.json', JSON.stringify(results, null, 2));
|
|
for (const r of results) console.log(JSON.stringify(r));
|
|
})();
|