#!/usr/bin/env bash
# Run from the checkout being tested, after installing, loading Metro and pairing a fresh app.
# PROOF_HOME and PROOF_SERVER_PORT select that checkout's isolated, freshly migrated server.
set -euo pipefail
session="$1"
out="$2"
side="$3"
capture_script="$4"
ad() { agent-device "$@" --session "$session"; }
shot() { python3 "$capture_script" "$session" "$out/mobile-$side-$1.png"; }
node scripts/scenarios/usage-mobile-seed.ts
ad record start "$out/mobile-$side.mp4" --fps 10 --hide-touches
ad open com.t3tools.t3code.dev 't3code-dev://settings/language'
ad press 'label=Français'
ad open com.t3tools.t3code.dev 't3code-dev://settings/usage?tab=usage'
ad press 'role=button label=Tokens'
ad scroll down 550
shot providers
ad scroll down 500
shot model-tokens
ad scroll top
ad press 'role=button label=Coût'
ad scroll bottom
shot model-cost
ad record stop
node scripts/scenarios/usage-mobile-seed.ts --boundary
ad scroll top
ad gesture pan 200 380 0 350 1000
ad press 'role=button label=Tokens'
ad scroll down 550
shot boundaries-unpriced
