26 lines
1.2 KiB
JavaScript
26 lines
1.2 KiB
JavaScript
const { chromium } = require('playwright');
|
|
const TARGET = 'http://host.docker.internal:3003';
|
|
|
|
(async () => {
|
|
const browser = await chromium.launch({ headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox'] });
|
|
const page = await browser.newPage();
|
|
const errors = [];
|
|
page.on('console', msg => { if (msg.type() === 'error') errors.push(msg.text()); });
|
|
page.on('pageerror', err => { errors.push('PAGE: ' + err.message); });
|
|
page.on('requestfailed', req => { if (!req.url().includes('favicon')) errors.push('NET: ' + req.url().split('/').pop()); });
|
|
|
|
await page.goto(TARGET, { waitUntil: 'domcontentloaded', timeout: 30000 });
|
|
await page.waitForTimeout(2000);
|
|
|
|
for (const tab of ['overview','agents','history','recommendations','heatmap','impact']) {
|
|
try { await page.click(`button[onclick="switchTab('')"]`); await page.waitForTimeout(800); } catch(e) {}
|
|
}
|
|
await page.waitForTimeout(500);
|
|
await browser.close();
|
|
|
|
console.log('');
|
|
console.log('TOTAL ERRORS:', errors.length);
|
|
if (errors.length > 0) errors.forEach((e, i) => console.log(i + ':', e.slice(0, 120)));
|
|
else console.log('Zero console, page, network errors on all 6 tabs');
|
|
})();
|