Files
computer/tests/debug-console.spec.ts
zeekay d0736c16fd feat: zoo.computer — decentralized AI supercomputing landing page
Forked from hanzo.computer, fully rebranded for Zoo Labs Foundation.
Vite + React + Tailwind. Deploys to GitHub Pages.
2026-03-31 13:25:51 -07:00

57 lines
1.6 KiB
TypeScript

import { test } from '@playwright/test';
test('check console errors', async ({ page }) => {
// Collect all console messages
const consoleMessages: string[] = [];
page.on('console', msg => {
const type = msg.type();
const text = msg.text();
consoleMessages.push(`[${type}] ${text}`);
console.log(`Console [${type}]: ${text}`);
});
page.on('pageerror', error => {
console.log('Page error:', error.message);
consoleMessages.push(`[ERROR] ${error.message}`);
});
// Navigate to the page
console.log('Navigating to http://localhost:3690/signin');
const response = await page.goto('http://localhost:3690/signin', {
waitUntil: 'domcontentloaded'
});
console.log('Response status:', response?.status());
// Wait a bit for any async errors
await page.waitForTimeout(2000);
// Check if React root exists
const hasRoot = await page.evaluate(() => {
return document.getElementById('root') !== null;
});
console.log('Has root element:', hasRoot);
// Check if React is loaded
const hasReact = await page.evaluate(() => {
return typeof (window as any).React !== 'undefined';
});
console.log('React loaded:', hasReact);
// Get the HTML content
const html = await page.content();
console.log('HTML length:', html.length);
// Check for any script errors in the page
const errors = await page.evaluate(() => {
return (window as any).__errors || [];
});
if (errors.length > 0) {
console.log('Script errors:', errors);
}
console.log('\n=== All Console Messages ===');
consoleMessages.forEach(msg => console.log(msg));
});