import { chromium } from 'playwright'; const b = await chromium.launch({ executablePath: 'C:/Program Files/Google/Chrome/Application/chrome.exe' }); const p = await (await b.newContext({ viewport: { width: 1280, height: 1000 } })).newPage(); const clear = () => p.evaluate(() => document.querySelectorAll('vite-error-overlay').forEach(e=>e.remove())); await p.goto('http://localhost:4200/login', { waitUntil:'networkidle' }); await clear(); await p.waitForTimeout(700); const ins = await p.locator('ui-input input').all(); await ins[0].fill('13800138000'); await ins[1].fill('123456'); await p.getByText('登 录', { exact:false }).first().click(); await p.waitForTimeout(2800); await p.goto('http://localhost:4200/desktop/contacts', { waitUntil:'networkidle' }); await clear(); await p.waitForTimeout(1800); const info = await p.evaluate(() => { const out = []; // 找所有高度异常(>60px)且内容为空的元素 document.querySelectorAll('.page *').forEach(el => { const r = el.getBoundingClientRect(); const txt = (el.textContent||'').trim(); if (r.height > 50 && txt.length === 0) { out.push({ tag: el.tagName, cls: String(el.className).slice(0,60), h: Math.round(r.height), w: Math.round(r.width), y: Math.round(r.y) }); } }); return out.slice(0, 12); }); console.log('高度>50px 且无文字的元素:'); info.forEach(x => console.log(` ${x.tag.padEnd(10)} .${x.cls.padEnd(42)} ${x.w}x${x.h} @y=${x.y}`)); await p.screenshot({ path: '../../.shots/dbg-contacts.png' }); await b.close();