# Profile & Settings Flow Test
# Tests the profile screen, settings toggles, and navigation
# Prerequisite: User must have completed onboarding

appId: com.millianlmx.tabatafit
name: Profile Settings

---
# Start from home screen
- assertVisible: "program-card-upper-body"

# Navigate to Profile tab
- tapOn:
    text: "Profile"
    optional: true
- tapOn:
    id: "profile-tab"
    optional: true

# Verify profile screen loaded
- assertVisible:
    text: ".*Profile.*"
    timeout: 5000

# Check user avatar/name is displayed
- assertVisible:
    text: ".*Test User.*"
    timeout: 3000
    optional: true

# Check stats section — real activity store data (may show 0 if no workouts done)
- assertVisible:
    text: ".*workout.*"
    timeout: 3000
    optional: true
- assertVisible:
    text: ".*min.*"
    timeout: 3000
    optional: true
- assertVisible:
    text: ".*cal.*"
    timeout: 3000
    optional: true

# Scroll to settings section
- scroll:
    direction: DOWN
    duration: 500

# Check for Haptic Feedback toggle
- assertVisible:
    text: ".*aptic.*"
    timeout: 3000
    optional: true

# Check for Sound Effects toggle
- assertVisible:
    text: ".*ound.*"
    timeout: 3000
    optional: true

# Check for Voice Coaching toggle
- assertVisible:
    text: ".*oice.*"
    timeout: 3000
    optional: true

# Scroll down to notifications section
- scroll:
    direction: DOWN
    duration: 500

# Check for Reminders toggle
- assertVisible:
    text: ".*eminder.*"
    timeout: 3000
    optional: true

# Scroll down to support section
- scroll:
    direction: DOWN
    duration: 500

# Check for Rate App option
- assertVisible:
    text: ".*Rate.*"
    timeout: 3000
    optional: true

# Check for Contact Us option
- assertVisible:
    text: ".*Contact.*"
    timeout: 3000
    optional: true

# Check for app version
- assertVisible:
    text: ".*1\\..*"
    timeout: 3000
    optional: true

# Scroll back to top
- scroll:
    direction: UP
    duration: 1500

# Navigate back to Home
- tapOn:
    text: "Home"
    optional: true
- tapOn:
    id: "home-tab"
    optional: true

# Verify home screen
- assertVisible:
    id: "program-card-upper-body"
    timeout: 5000
    optional: true
