import {chromium} from 'playwright'; const b = await chromium.launch({channel: 'chrome'}); const p = await b.newPage({viewport: {width: 390, height: 780}, isMobile: true, hasTouch: true}); await p.goto('http://localhost/s/stay', {waitUntil: 'domcontentloaded'}); await p.waitForTimeout(4500); await p.evaluate(() => document.querySelector('#itinerary').scrollIntoView({block: 'center'})); const pos = () => p.evaluate(() => { const t = document.querySelector('#itinerary .slider-track'); const m = /matrix.*?,\s*(-?[\d.]+),\s*-?[\d.]+\)$/.exec(getComputedStyle(t).transform); return m ? Math.round(parseFloat(m[1])) : 0; }); // 쿨타임(7초)이 지나도록 아무것도 안 만지고 기다린다 await p.waitForTimeout(9000); const base = await pos(); const log = []; for (let i = 0; i < 8; i++) { await p.waitForTimeout(1500); log.push(await pos()); } console.log('손 안 대고 9초 뒤부터 12초 관찰:', base, '→', JSON.stringify(log), '· 자동 이동', log[7] - base); await b.close();