import { chromium } from 'playwright'; const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 390, height: 844 } }); await p.goto('http://localhost:3214/', { waitUntil: 'domcontentloaded' }); await p.waitForTimeout(3000); console.log('tab bar count:', await p.locator('[data-testid="mobile-tab-bar"]').count()); console.log('tab bar a count:', await p.locator('[data-testid="mobile-tab-bar"] a').count()); console.log('/products in tabbar:', await p.locator('[data-testid="mobile-tab-bar"] a[href="/products"]').count()); console.log('all tabbar hrefs:', await p.locator('[data-testid="mobile-tab-bar"] a').evaluateAll(as => as.map(x => x.getAttribute('href')))); // 打开抽屉后再看 await p.locator('[data-testid="mobile-menu-button"]').click(); await p.waitForTimeout(800); console.log('抽屉打开后 /products in tabbar:', await p.locator('[data-testid="mobile-tab-bar"] a[href="/products"]').count()); console.log('tabbar visible:', await p.locator('[data-testid="mobile-tab-bar"]').isVisible()); await b.close();