const { chromium } = require('playwright');
(async () => {
  const browser = await chromium.launch({ headless: true });
  const page = await (await browser.newContext({viewport:{width:1280,height:900}})).newPage();
  const logs = [];
  page.on('console', m => logs.push(m.text()));
  await page.goto('http://127.0.0.1:8099/buy-service/1/pos', { waitUntil: 'load' }).catch(()=>{});
  await page.waitForTimeout(6000);
  const dataLog = logs.filter(l => l.startsWith('data: {') || l.startsWith('data:{'));
  console.log('应用 data:', dataLog[0] ? dataLog[0].slice(0, 500) : '(未捕获)');
  await browser.close();
})();
