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 inCard = await p.locator('[data-testid="card-products"] a[href="/products"]').count(); console.log('card-products 内 /products 链接数:', inCard); if (inCard) console.log(' 文本:', (await p.locator('[data-testid="card-products"] a[href="/products"]').first().innerText()).trim()); console.log('home-cta-button 数:', await p.locator('[data-testid="home-cta-button"]').count(), 'href:', await p.locator('[data-testid="home-cta-button"]').first().getAttribute('href')); console.log('l3 heading:', await p.locator('#l3-signals-heading').count()); console.log('方法论 link:', await p.locator('a[href="/methodology"]').count()); console.log('team link:', await p.locator('a[href="/team"]').count()); await b.close();