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

@@ -90,7 +90,7 @@ export default function WorkoutDetailScreen() {
const repeatCount = Math.max(1, Math.floor(workout.rounds / workout.exercises.length))
return (
<View style={styles.container}>
<View testID="workout-detail-screen" style={styles.container}>
{/* Header with SwiftUI glass button */}
<View style={[styles.header, { paddingTop: insets.top + SPACING[3] }]}>
<RNText style={styles.headerTitle} numberOfLines={1}>
@@ -131,6 +131,7 @@ export default function WorkoutDetailScreen() {
mode="preview"
isPlaying={true}
style={styles.videoPreview}
testID="workout-video-preview"
/>
{/* Quick stats */}
<View style={styles.quickStats}>
@@ -204,6 +205,7 @@ export default function WorkoutDetailScreen() {
<View style={[styles.bottomBar, { paddingBottom: insets.bottom + SPACING[4] }]}>
<BlurView intensity={80} tint="dark" style={StyleSheet.absoluteFill} />
<Pressable
testID={isLocked ? 'workout-unlock-button' : 'workout-start-button'}
style={({ pressed }) => [
styles.startButton,
isLocked && styles.lockedButton,
@@ -214,7 +216,7 @@ export default function WorkoutDetailScreen() {
{isLocked && (
<Ionicons name="lock-closed" size={18} color="#FFFFFF" style={{ marginRight: 8 }} />
)}
<RNText style={styles.startButtonText}>
<RNText testID="workout-cta-text" style={styles.startButtonText}>
{isLocked ? t('screens:workout.unlockWithPremium') : t('screens:workout.startWorkout')}
</RNText>
</Pressable>