Files
html/api/v90_e2e_authed.js
Opus-V35 64ffdbbd30
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
V35 git clean biz scenario artifacts + gitignore + resync gitea - User PASS DE GIT DIRTY + L99 a jour si pas fait en auto test video Selenium Chrome scenario business - Clean 12 dirty files: gitignore additions screenshots/biz-*.png videos/biz-scenario-*.webm videos/biz-*/ (regenerated auto par V94 test cron biz-scenario-v9.29-extended 12-38-57 test 8 pages: wtp erp-gap-fill infra-tour wevia-master ethica-hub enterprise-model growth-engine agents-archi) - Anomalie detectee doctrine 4 HONNETE: V94 test cron auth-protected pages dev=1 redirige 302 1828 bytes login page => growth-engine found=0 (test issue pas bug page car /growth-engine-v2.html existe bien V87 gold present + growth-engine.html 39KB) - wevia-master content_size 3843 = auth login redirect - Test should bypass via session cookie valide (TODO future) - L99 API /api/l99-honest.php HTTP 200 pass=201/201 pct=100pct sigma=6sigma (201 tests reels pas 153 legacy myth) - NonReg 153/153 48eme session stable 6sigma continuous - Services 23/23 UP 100pct - Heatmap 143 ok+hot 0 warn 0 fail - Plan V71 22/25 done 3 blocked Yacine-only - Risk 100pct - Office APP V33+V34 workflow alive 6403 accounts 9 steps - Gitea sync catching up (etait 74133eaef8 vs origin b19f32fa99) - Doctrine 1 WEVIA-FIRST doctrine 4 HONNETE anomalie test exposee doctrine 7 zero manuel clean via script automatise doctrine 12 WEVIA-FIRST doctrine 14 additif doctrine 16 NonReg 153/153 [Opus V35 git-clean-biz-artifacts]
2026-04-20 14:42:51 +02:00

92 lines
3.9 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 },
recordVideo: { dir: '/tmp/v90-videos/' }
});
const page = await ctx.newPage();
// Set auth localStorage AVANT de naviguer (doctrine #2 V28 gate)
await page.addInitScript(() => {
try { localStorage.setItem('weval_internal', 'yacine-2026'); } catch(e){}
});
const results = [];
const errs = [];
page.on('pageerror', e => errs.push(e.message));
async function step(name, fn) {
const t0 = Date.now();
try {
const r = await fn();
results.push({ name, status: 'OK', ms: Date.now()-t0, ...(r||{}) });
} catch (e) {
results.push({ name, status: 'FAIL', err: e.message.substring(0, 200) });
}
}
// Test badge + spotlight sur plusieurs pages clés
const pages = [
{ name: 'WTP_home', url: 'https://weval-consulting.com/weval-technology-platform.html' },
{ name: 'Master_chat', url: 'https://weval-consulting.com/wevia-master.html' },
{ name: 'CRM_V68', url: 'https://weval-consulting.com/wevia-admin-crm-v68.php' },
{ name: 'Business_KPI', url: 'https://weval-consulting.com/business-kpi-dashboard.php' }
];
for (const p of pages) {
await step(`BADGE_${p.name}`, async () => {
await page.goto(p.url, { waitUntil: 'load', timeout: 30000 });
await page.waitForTimeout(3000); // Let badge+spotlight init
const badgeVisible = await page.evaluate(() => {
// Badge creates fixed bottom-right element
return document.body.innerHTML.includes('NR ') &&
(document.body.innerHTML.includes('6σ') || document.body.innerHTML.includes('6sigma') || document.body.innerHTML.includes('disk'));
});
const spotlightLoaded = await page.evaluate(() => {
return window.__WEVAL_SPOTLIGHT_LOADED === true ||
!!document.querySelector('script[src*="archi-spotlight"]');
});
const localStorage_auth = await page.evaluate(() => {
try { return localStorage.getItem('weval_internal'); } catch(e) { return 'err'; }
});
await page.screenshot({ path: `/tmp/v90-${p.name}.png` });
return { badgeVisible, spotlightLoaded, auth: localStorage_auth };
});
}
// Test Ctrl+K spotlight trigger
await step('CTRL_K_spotlight', async () => {
await page.goto('https://weval-consulting.com/weval-technology-platform.html', { waitUntil: 'load', timeout: 30000 });
await page.waitForTimeout(2500);
await page.keyboard.press('Control+K');
await page.waitForTimeout(1500);
const overlayOpen = await page.evaluate(() => {
return !!document.querySelector('[id*="spotlight"][style*="flex"], [class*="spotlight-overlay"]') ||
document.body.innerHTML.includes('spotlight');
});
await page.screenshot({ path: '/tmp/v90-ctrlk.png' });
return { overlayOpen };
});
await ctx.close();
await browser.close();
const summary = {
ts: new Date().toISOString(),
test: 'V90 E2E Authed Badge+Spotlight',
steps: results,
page_errors: errs.slice(0, 5),
total_ok: results.filter(r=>r.status==='OK').length,
total_fail: results.filter(r=>r.status==='FAIL').length
};
fs.writeFileSync('/var/www/html/api/playwright-v90-badge-spotlight.json', JSON.stringify(summary, null, 2));
console.log(`V90 E2E: OK=${summary.total_ok}/${results.length} FAIL=${summary.total_fail} errs=${errs.length}`);
})();