// 验证 home 本地 CTASection 实际渲染(含 BrandStamp 的是 src/components/sections/cta-section.tsx) import { chromium } from 'playwright'; const browser = await chromium.launch(); const page = await browser.newPage({ viewport: { width: 1280, height: 800 } }); await page.goto('http://127.0.0.1:3000/', { waitUntil: 'networkidle' }); await page.waitForTimeout(2000); await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)); await page.waitForTimeout(2000); const dump = await page.evaluate(() => { // home 本地简化版的特征 className const homeCta = document.querySelector('section.relative.py-24.sm\\:py-32'); // 公开 cta-section 的特征 id const srcCta = document.querySelector('section#cta'); // BrandStamp 容器特征(inline-block px-3 py-1.5 border-2 border-[var(--color-brand)] rounded-sm) const stamp = document.querySelector('.inline-block.px-3.py-1\\.5.border-2'); return { homeCtaPresent: !!homeCta, homeCtaText: homeCta ? (homeCta.textContent || '').slice(0, 60) : null, srcCtaPresent: !!srcCta, brandStampPresent: !!stamp, }; }); await browser.close(); console.log(JSON.stringify(dump, null, 2));