import {chromium} from 'playwright'; const b = await chromium.launch({channel: 'chrome'}); for (const [tag, vp] of [['mobile', {width: 390, height: 780}], ['desktop', {width: 1280, height: 900}]]) { const p = await b.newPage({viewport: vp, isMobile: tag === 'mobile', hasTouch: tag === 'mobile', deviceScaleFactor: 2}); await p.goto('http://localhost/s/stay', {waitUntil: 'domcontentloaded'}); await p.waitForTimeout(5000); await p.screenshot({path: `/tmp/h-${tag}.png`, clip: {x: 0, y: 0, width: vp.width, height: 70}}); const info = await p.evaluate(() => { const tel = document.querySelector('#root header a[href^="tel:"]'); const nav = [...document.querySelectorAll('#root nav')].find((n) => getComputedStyle(n).position === 'fixed'); return {telShown: tel ? getComputedStyle(tel).display : '-', tabbarHasTel: nav ? /전화/.test(nav.textContent) : false, headerOverflow: document.querySelector('#root header .shell').scrollWidth > window.innerWidth}; }); console.log(tag, JSON.stringify(info)); await p.close(); } await b.close();