const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();
  
  try {
    console.log('Step 1: Loading page');
    await page.goto('http://localhost:3000', { waitUntil: 'load', timeout: 60000 });
    console.log('Step 2: Page loaded');
    
    await page.waitForTimeout(5000);
    
    const title = await page.title();
    console.log('Title: ' + title);
    
    const hasContent = await page.locator('body').evaluate(el => el.textContent.length > 100);
    console.log('Has content: ' + hasContent);
    
    await page.screenshot({ path: 'debug1.png' });
    console.log('Screenshot 1 saved');
    
  } catch (err) {
    console.error('Error: ' + err.message);
  } finally {
    await browser.close();
  }
})();
