import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        br = await p.chromium.launch(headless=False)
        pg = await br.new_page()
        net_fails = []
        all_errors = []
        pg.on('response', lambda r: net_fails.append({'status':r.status,'url':r.url}) if r.status>=400 else None)
        pg.on('console', lambda msg: all_errors.append(f'[{msg.type}] {msg.text[:400]}'))
        await pg.goto('http://localhost:8090/DOZIKWORKS_OS_v4_pathcreate.dc.html')
        await pg.wait_for_timeout(14000)
        print('=== 400+ 응답:')
        for n in net_fails:
            print(f"  [{n['status']}] {n['url']}")
        print('=== 콘솔 에러:')
        for e in all_errors:
            if 'error' in e.lower() or 'Error' in e:
                print(f"  {e}")
        await br.close()

asyncio.run(main())
