import { chromium } from 'playwright'; const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 1440, height: 900 } }); await p.goto('http://localhost:3210/', { waitUntil: 'domcontentloaded' }); await p.waitForTimeout(3000); const ids = await p.evaluate(() => [...document.querySelectorAll('[data-testid]')].map(e => e.getAttribute('data-testid'))); console.log('TESTIDS:', JSON.stringify([...new Set(ids)])); const cta = await p.locator('[data-testid="hero-primary-cta"]').count(); console.log('hero-primary-cta count:', cta); const bodyText = await p.locator('body').innerText(); for (const k of ['共创', '数据来源', '口径', '暂无案例数据', '成为首批共创客户', '首批客户共创']) { console.log(` 「${k}」出现 ${bodyText.split(k).length - 1} 次`); } await b.close();