Autonomous Tauri App Testing on macOS
- Start the App
tmux new-session -d -s myapp 'bun run tauri dev'
sleep 15 2. Check Logs
tmux capture-pane -t myapp -p | tail -30
tmux capture-pane -t myapp -p | grep -i error 3. Take Screenshots
screencapture -x screenshot.png
osascript -e 'tell application "MyApp" to activate' sleep 0.5 screencapture -x screenshot.png 4. Discover UI Elements osascript -e ' tell application "System Events" tell process "MyApp" return entire contents of window 1 end tell end tell ' 2>&1 | tr ',' '\n' This outputs all clickable elements with their full paths. 5. Click Buttons osascript -e ' tell application "System Events" tell process "MyApp" set frontmost to true delay 0.3 click button "Button Name" of group 1 of window 1 end tell end tell ' Adjust the path based on what you find in step 4. 6. Basic Test Loop
osascript -e '... click something ...'
sleep 0.5
screencapture -x tmp/after_action.png
tmux capture-pane -t myapp -p | tail -10 Key Tips
- Always delay 0.3 inside AppleScript before clicking
- Use set frontmost to true to ensure window is active
- Wrap in try/end try for optional elements
- UI paths change when the app updates - rediscover with entire contents