# Explore Tab Freemium Test
# Tests lock badges on non-free workouts, free workout access,
# and paywall gating for locked workouts.
# Prerequisite: User must have completed onboarding (free user, not premium)

appId: com.millianlmx.tabatafit
name: Explore Freemium

---
# Navigate to Explore tab
- tapOn:
    text: "Explore"
    optional: true
- tapOn:
    id: "explore-tab"
    optional: true

# Verify Explore screen loaded
- assertVisible:
    id: "explore-screen"
    timeout: 5000

# Verify collections section is visible
- assertVisible:
    id: "collections-section"
    timeout: 3000
    optional: true

# Verify featured section is visible
- assertVisible:
    id: "featured-section"
    timeout: 3000
    optional: true

# Verify filters section is visible
- assertVisible:
    id: "filters-section"
    timeout: 3000

# Scroll down to see workout cards
- scroll:
    direction: DOWN
    duration: 500

# Tap a free workout (ID 1 — Full Body Ignite) — should go to detail, not paywall
- tapOn:
    id: "workout-card-1"
    optional: true

# On workout detail: verify start button (not unlock)
- assertVisible:
    id: "workout-start-button"
    timeout: 5000
    optional: true

# Verify video preview is rendered
- assertVisible:
    id: "workout-video-preview"
    timeout: 3000
    optional: true

# Go back to explore
- pressKey: back
  optional: true
- tapOn:
    text: "Explore"
    optional: true

# Scroll to find a locked workout
- scroll:
    direction: DOWN
    duration: 800

# Tap a locked workout (ID 2 — not in free tier)
- tapOn:
    id: "workout-card-2"
    optional: true

# On workout detail: verify unlock/locked button
- assertVisible:
    id: "workout-unlock-button"
    timeout: 5000
    optional: true

# Tap unlock button — should navigate to paywall
- tapOn:
    id: "workout-unlock-button"
    optional: true

# Verify paywall screen appeared
- assertVisible:
    text: ".*Premium.*"
    timeout: 5000
    optional: true

# Go back from paywall
- pressKey: back
  optional: true

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