from pathlib import Path
import os
p = Path('scripts/node_modules/@e2e-dev/web/dist/surface.js').resolve()
s = p.read_text().replace('contextOptions: {\n', 'contextOptions: {\n                hasTouch: true,\n                isMobile: true,\n')
tmp = p.with_suffix('.tablet-tmp')
tmp.write_text(s)
os.replace(tmp, p)
p = Path('scripts/e2e.config.ts')
s = p.read_text().replace('engine: web({ viewport: { width: 1280, height: 800 } }),', 'engine: web({ viewport: { width: 1163, height: 720 }, userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel Tablet) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36" }),')
p.write_text(s)
