test: add QA coverage — access unit tests, VideoPlayer snapshots, Maestro E2E flows, testIDs

- Add testIDs to explore, workout detail, and collection detail screens
- Add testID prop to VideoPlayer component
- Create access service unit tests (isFreeWorkout, canAccessWorkout)
- Create VideoPlayer rendering snapshot tests (preview/background modes)
- Create Maestro E2E flows: explore-freemium, collection-detail
- Update tab-navigation flow with Explore screen assertions
- Update profile-settings flow with real activity stat assertions
- Update all-tests suite to include new flows
This commit is contained in:
Millian Lamiaux
2026-03-24 12:40:02 +01:00
parent a042c348c1
commit 4fa8be600c
12 changed files with 742 additions and 13 deletions

View File

@@ -17,6 +17,12 @@ env:
# Run tab navigation
- runFlow: ./tab-navigation.yaml
# Run explore freemium (lock badges, paywall gating)
- runFlow: ./explore-freemium.yaml
# Run collection detail
- runFlow: ./collection-detail.yaml
# Run workout player
- runFlow: ./workout-player.yaml

View File

@@ -0,0 +1,93 @@
# Collection Detail Test
# Tests navigating to a collection and viewing its workouts
# Prerequisite: User must have completed onboarding
appId: com.millianlmx.tabatafit
name: Collection Detail
---
# 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
- assertVisible:
id: "collections-section"
timeout: 3000
optional: true
# Tap the first collection card
- tapOn:
text: ".*collection.*"
optional: true
# If collection-card testIDs are visible, tap by testID instead
- tapOn:
id: "collection-card-.*"
optional: true
# Verify collection detail screen loaded
- assertVisible:
id: "collection-detail-screen"
timeout: 5000
optional: true
# Verify hero card is visible
- assertVisible:
id: "collection-hero"
timeout: 3000
optional: true
# Verify back button exists
- assertVisible:
id: "collection-back-button"
timeout: 3000
optional: true
# Verify workouts are listed
- assertVisible:
text: ".*Workout.*"
timeout: 3000
optional: true
# Scroll to see more workouts
- scroll:
direction: DOWN
duration: 500
# Tap a workout in the collection
- tapOn:
id: "collection-workout-.*"
optional: true
# Verify workout detail opened
- assertVisible:
id: "workout-detail-screen"
timeout: 5000
optional: true
# Go back to collection
- pressKey: back
optional: true
# Go back to explore via back button
- tapOn:
id: "collection-back-button"
optional: true
# Navigate back to Home
- tapOn:
text: "Home"
optional: true
- tapOn:
id: "home-tab"
optional: true

View File

@@ -0,0 +1,106 @@
# 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

View File

@@ -28,11 +28,19 @@ name: Profile Settings
timeout: 3000
optional: true
# Check stats are visible
# 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:

View File

@@ -17,6 +17,16 @@ name: Tab Navigation
id: "explore-tab"
optional: true
# Verify Explore screen loaded with key sections
- assertVisible:
id: "explore-screen"
timeout: 5000
optional: true
- assertVisible:
id: "filters-section"
timeout: 3000
optional: true
# Navigate to Activity tab
- tapOn:
text: "Activity"