appId: com.cosmonautical.jellify
---
# Wait for app to be ready, then navigate to Settings tab
- assertVisible: 
    id: "settings-tab-button"

# Navigate to Settings tab using text
- tapOn:
    id: "settings-tab-button"

# Verify we're on the settings page
- assertVisible:
    text: "App"

# Take screenshot of App settings
- takeScreenshot: screenshots/19_settings_app

# Test App (Preferences) Tab - should already be selected
- assertVisible:
    text: "Theme"
- assertVisible:
    text: "Match Device"
- assertVisible:
    text: "Light"
- assertVisible:
    text: "Dark"
- assertVisible:
    text: "Track Swipe Actions"

# Test Player (Playback) Tab  
- tapOn:
    text: "Player"
- assertVisible:
    text: "Streaming Quality"

# Take screenshot of Player settings
- takeScreenshot: screenshots/20_settings_player

# Test Usage Tab
- tapOn:
    text: "Usage" 
- assertVisible:
    text: "Downloaded Tracks"
- assertVisible:
    text: "Auto-Download Tracks"
- assertVisible:
    text: "Download Quality"

# Take screenshot of Usage settings
- takeScreenshot: screenshots/21_settings_usage

# Test User (Account) Tab
- tapOn:
    text: "User"
- assertVisible:
    text: "Username"
- assertVisible:
    text: "Selected Library"

# Take screenshot of User settings
- takeScreenshot: screenshots/22_settings_user

# Test library selection navigation (but go back)
- tapOn:
    text: "Selected Library"
- assertVisible:
    text: "Select Music Library"

# Take screenshot of library selection modal
- takeScreenshot: screenshots/23_library_selection_modal

- tapOn:
    text: "Cancel"

# Test About (Info) Tab
- tapOn:
    text: "About"
- assertVisible:
    text: "View Source"
- assertVisible:
    text: "Join Discord"

# Take screenshot of About settings
- takeScreenshot: screenshots/24_settings_about

# Test sign out button (but cancel it)
- tapOn:
    text: "User"
- assertVisible:
    text: "Sign Out"
- tapOn:
    text: "Sign Out"
- assertVisible:
    text: "Sign out of Jellify?"
    optional: true

# Take screenshot of sign out confirmation
- takeScreenshot: screenshots/25_signout_confirm

# Try to cancel the dialog (button might have different text or not appear)
- tapOn:
    text: "Cancel"
    optional: true
- tapOn:
    text: "CANCEL"
    optional: true
# Fallback: press back to dismiss any dialog
- pressKey: back

# Sign out flow (make optional since dialog state may vary)
- tapOn:
    text: "Sign Out"
    optional: true
- tapOn:
    id: "sign-out-button"
    optional: true

# Verify we're on the login page (optional since we may not have signed out)
- assertVisible:
    id: "server_address_screen"
    optional: true

# Take screenshot of final state
- takeScreenshot: screenshots/26_logged_out
