import { test, expect } from '@playwright/test'; test('emulated device exposes mobile viewport and touch', async ({ page }) => { await page.setContent(` `); const device = await page.evaluate(() => ({ width: window.innerWidth, maxTouchPoints: navigator.maxTouchPoints, coarsePointer: matchMedia('(pointer: coarse)').matches, userAgent: navigator.userAgent, })); expect(device.width).toBeLessThan(500); expect(device.maxTouchPoints).toBeGreaterThan(0); expect(device.coarsePointer).toBe(true); expect(device.userAgent).toContain('Mobile'); });