Skip to content

autoZoom

autoZoom(fn, options?): Promise<void>

Defined in: autoZoom.ts:75

Zooms the camera in on interactions inside fn, panning to follow each click and fill. After fn resolves the camera zooms back out.

Wrap page sections or forms — not individual clicks. One autoZoom per distinct area of the UI gives the camera a natural rhythm.

Cannot be nested — calling autoZoom() inside another autoZoom() throws.

() => void | Promise<void>

The interactions to zoom in on

AutoZoomOptions

Optional zoom settings

Promise<void>

await autoZoom(
async () => {
await page.locator('#name').fill('Jane Doe')
await page.locator('#email').fill('jane@example.com')
await page.locator('button[type="submit"]').click()
},
{ duration: 400, easing: 'ease-in-out', amount: 0.4 }
)