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

(async () => {
    const browser = await chromium.launch();
    const page = await browser.newPage();
    
    await page.goto('file://' + process.cwd() + '/index.html');
    await page.waitForSelector('#gjs', { timeout: 10000 });
    await page.waitForTimeout(3000);
    
    // Click Media category
    const mediaCategory = page.locator('.gjs-block-category').filter({ hasText: 'MEDIA' });
    await mediaCategory.click();
    await page.waitForTimeout(1000);
    
    // Take screenshot
    await page.screenshot({ path: 'media-category.png', fullPage: true });
    
    // Log what blocks we found
    const blocks = await mediaCategory.locator('.gjs-block .gjs-block-label').allTextContents();
    console.log('Blocks in Media category:', blocks);
    
    await browser.close();
})();
