const pw = require('playwright-core');
(async () => {
    const browser = await pw.chromium.launch({ headless: true });
    const page = await browser.newPage();
    const failed = [];
    page.on('requestfailed', req => failed.push(req.url().substring(0,100)));
    
    await page.goto('/', {timeout:30000});
    await page.waitForTimeout(15000);
    
    console.log('editor:', await page.evaluate(() => typeof window.editor));
    console.log('grapesjs:', await page.evaluate(() => typeof grapesjs));
    if (failed.length) console.log('Failed requests:', JSON.stringify(failed));
    
    await browser.close();
    process.exit(0);
})().catch(e => { console.error(e.message); process.exit(1); });
