#!/usr/bin/env bash
set -euo pipefail
# Run after loading history on the fixed app while the replay is still streaming.
session=$1
capture_dir=$2
agent-device record start "$capture_dir/return-to-end.mp4" --hide-touches --session "$session"
agent-device press 'label="Scroll to end"' --session "$session" --settle
agent-device wait text "Updates complete" 90000 --session "$session"
agent-device record stop --session "$session"
agent-device snapshot -i --session "$session"
