Skip to content

Instantly share code, notes, and snippets.

@luisrudge
Created January 12, 2026 00:04
Show Gist options
  • Select an option

  • Save luisrudge/a58a532f0b4b19d4c7cdbd9ed63b8802 to your computer and use it in GitHub Desktop.

Select an option

Save luisrudge/a58a532f0b4b19d4c7cdbd9ed63b8802 to your computer and use it in GitHub Desktop.
Autonomous Tauri App Testing on macOS

Autonomous Tauri App Testing on macOS

  1. Start the App

Run in tmux so it persists and logs are accessible

tmux new-session -d -s myapp 'bun run tauri dev'

Wait for build (~15s)

sleep 15 2. Check Logs

Read recent output

tmux capture-pane -t myapp -p | tail -30

Search for errors

tmux capture-pane -t myapp -p | grep -i error 3. Take Screenshots

Full screen

screencapture -x screenshot.png

The app window only (if visible)

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

1. Do action

osascript -e '... click something ...'

2. Wait for UI

sleep 0.5

3. Screenshot to verify

screencapture -x tmp/after_action.png

4. Check logs

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment