import { test, expect } from '@playwright/test'; test('检查联系卡片详细结构', async ({ page }) => { await page.goto('/contact'); await page.waitForLoadState('networkidle'); const contactCard = page.locator('[data-slot="card"]').filter({ hasText: '联系方式' }).first(); const contactCardChildren = await contactCard.locator('div').all(); console.log('联系卡片子元素数量:', contactCardChildren.length); for (let i = 0; i < contactCardChildren.length; i++) { const child = contactCardChildren[i]; const className = await child.evaluate(el => el.className); const text = await child.textContent(); console.log(`子元素 ${i}: ${className.substring(0, 80)} - ${text?.substring(0, 50)}`); } const allDivs = await contactCard.locator('div').all(); console.log('所有div数量:', allDivs.length); });