EPIC 5: Exercise Library and Management

E05-F01: Advanced Exercise Search and Filtering

User Story: As a user, I want to search and filter exercises by various criteria, so that I can quickly find what I need for my workouts without having to scroll through the entire exercise library.

Scenarios

Scenario: E05-F01-S01 - Searching for exercises by name
  Given I am on the "Exercise Library" screen
  When I tap on the search bar
  And I enter "deadlift"
  Then I should see all exercises containing "deadlift" in their names
  And the search results should appear in alphabetical order
  And I should see the number of results displayed
Scenario: E05-F01-S02 - Filtering exercises by muscle group
  Given I am on the "Exercise Library" screen
  When I tap on "Filter"
  And I select "Muscle Group" as the filter type
  And I choose "Back" as the muscle group
  Then I should only see exercises that target the back muscles
  And each exercise should display an icon indicating it targets the back
  And I should be able to add another muscle group filter
Scenario: E05-F01-S03 - Combining multiple filter criteria
  Given I am on the "Exercise Library" screen
  When I filter by "Muscle Group: Chest"
  And I filter by "Equipment: Dumbbells"
  And I filter by "Difficulty: Intermediate"
  Then I should only see chest exercises using dumbbells with intermediate difficulty
  And I should see a summary of active filters at the top of the screen
  And I should be able to remove any individual filter by tapping its "X" icon
Scenario: E05-F01-S04 - Sorting search results
  Given I am on the "Exercise Library" screen
  And I have filtered for "Muscle Group: Legs"
  When I tap on "Sort"
  And I select "Difficulty (easiest first)"
  Then the exercises should be reordered with beginner exercises first
  And advanced exercises should appear at the end of the list

Acceptance Tests

# Test d'acceptation
Scenario: E05-F01-TA01 - Handling no search results
  Given I am on the "Exercise Library" screen
  When I search for "xyzzyx"
  And no exercises match this term
  Then I should see a message "No exercises match your search"
  And I should see suggestions for alternative search terms
  And I should have the option to "Browse All Exercises"

E05-F02: Creating Custom Exercises

User Story: As a user, I want to add custom exercises that aren’t in the default library, so that I can track all my training activities even when using unconventional exercises.

Scenarios

Scenario: E05-F02-S01 - Adding a new custom exercise
  Given I am on the "Exercise Library" screen
  When I tap the "+" button
  And I enter "Single-arm Kettlebell Complex" as the name
  And I select "Shoulders, Core, Legs" as the targeted muscles
  And I choose "Kettlebell" as the required equipment
  And I set "Advanced" as the difficulty level
  And I upload a demonstration video from my gallery
  And I tap "Save Exercise"
  Then the exercise should be saved to my custom exercises
  And it should appear in search results with a "Custom" indicator
Scenario: E05-F02-S02 - Editing a custom exercise
  Given I am on the "Exercise Library" screen
  And I have a custom exercise named "Single-arm Kettlebell Complex"
  When I select the exercise
  And I tap "Edit"
  And I change the name to "Advanced Kettlebell Flow"
  And I tap "Save Changes"
  Then the exercise should be updated with the new name
  And it should maintain all other properties I previously set
Scenario: E05-F02-S03 - Adding personal notes to an exercise
  Given I am viewing the details of "Barbell Squat"
  When I tap on "Add Personal Notes"
  And I enter "Keep feet slightly wider than shoulders"
  And I tap "Save Notes"
  Then my notes should be visible when viewing this exercise
  And my notes should appear when I perform this exercise in a workout

Acceptance Tests

# Test d'acceptation
Scenario: E05-F02-TA01 - Validating required fields for custom exercise
  Given I am creating a new custom exercise
  When I leave the name field empty
  And I tap "Save Exercise"
  Then I should see an error message
  And the exercise should not be saved until I provide a name

E05-F03: Exercise Information and Tutorials

User Story: As a user, I want to access detailed information and tutorial videos for exercises, so that I can ensure proper form and technique to maximize benefits and prevent injuries.

Scenarios

Scenario: E05-F03-S01 - Viewing detailed exercise information
  Given I am browsing the exercise library
  When I select the exercise "Barbell Squat"
  Then I should see a detailed description of the exercise
  And I should see which muscles are primary targets
  And I should see which muscles are secondary targets
  And I should see the required equipment
Scenario: E05-F03-S02 - Watching tutorial videos for an exercise
  Given I am viewing the details of "Barbell Squat"
  When I tap on the "Tutorials" tab
  Then I should see a list of tutorial videos
  When I select the first tutorial video
  Then the video should begin playing
  And I should see playback controls
  And I should be able to toggle subtitles
Scenario: E05-F03-S03 - Reading form cues for an exercise
  Given I am viewing the details of "Barbell Squat"
  When I tap on the "Form Cues" tab
  Then I should see step-by-step instructions
  And I should see common mistakes to avoid
  And I should see safety considerations
  And I should be able to add these cues to my workout instructions

Acceptance Tests

# Test d'acceptation
Scenario: E05-F03-TA01 - Accessing exercise information offline
  Given I have previously viewed the details of "Barbell Squat"
  And the content has been cached
  When I turn off my internet connection
  And I navigate to "Barbell Squat" in my exercise library
  Then I should still see the basic exercise information
  And I should see an indicator that I'm in offline mode
  And video content should show an offline availability status

E05-F04: Exercise Progression Tracking

User Story: As a user, I want to track my progression on specific exercises over time, so that I can monitor my improvement and identify sticking points in my training.

Scenarios

Scenario: E05-F04-S01 - Viewing historical performance for an exercise
  Given I am viewing the details of "Bench Press"
  When I tap on "Performance History"
  Then I should see a chronological list of all my sets
  And each entry should show the date, weight, repetitions, and difficulty rating
  And I should see my personal record for maximum weight
Scenario: E05-F04-S02 - Analyzing exercise performance trends
  Given I am viewing the performance history of "Bench Press"
  When I tap on "Show Graph"
  Then I should see a line graph showing weight progression over time
  And I should see markers for personal records
  And I should be able to toggle between weight, volume, and difficulty views
  And I should be able to adjust the time range of the graph
Scenario: E05-F04-S03 - Setting exercise-specific goals
  Given I am viewing the performance history of "Bench Press"
  When I tap on "Set Goal"
  And I set a target weight of "225 pounds"
  And I set a target date of "3 months from now"
  Then the goal should be saved
  And I should see progress toward this goal during future workouts
  And I should receive notifications as I approach milestone percentages

Acceptance Tests

# Test d'acceptation
Scenario: E05-F04-TA01 - Receiving stagnation alerts
  Given I have been tracking "Barbell Squat" for 8 weeks
  And my weight has not increased for the last 4 sessions
  When I view my performance history for "Barbell Squat"
  Then I should see a "Plateau Detected" alert
  And I should receive suggestions for breaking through the plateau
  And I should see links to relevant training techniques for progression

E05-F05: Exercise Variants Management

User Story: As a user, I want to group exercise variants together, so that I can keep my library organized and track progress across similar movements.

Scenarios

Scenario: E05-F05-S01 - Creating an exercise variant group
  Given I am on the "Exercise Library" screen
  When I select "Bench Press"
  And I tap "Create Variant Group"
  And I name it "Pressing Movements"
  Then a new variant group should be created
  And "Bench Press" should be added to this group
Scenario: E05-F05-S02 - Adding exercises to a variant group
  Given I have created the "Pressing Movements" variant group
  When I browse to "Incline Bench Press"
  And I tap "Add to Group"
  And I select "Pressing Movements"
  Then "Incline Bench Press" should be added to the "Pressing Movements" group
  And both exercises should be accessible from the group view
Scenario: E05-F05-S03 - Viewing combined performance across variants
  Given I have added multiple exercises to "Pressing Movements"
  When I view the "Pressing Movements" group
  And I tap "Combined Performance"
  Then I should see aggregate statistics across all variants
  And I should see comparison charts between variants
  And I should see which variant has the highest progression rate

Acceptance Tests

# Test d'acceptation
Scenario: E05-F05-TA01 - Removing an exercise from a variant group
  Given I am viewing the "Pressing Movements" variant group
  When I select "Decline Bench Press" 
  And I tap "Remove from Group"
  Then I should see a confirmation dialog
  When I confirm removal
  Then "Decline Bench Press" should be removed from the group
  But it should still exist in my exercise library

E05-F06: Equipment Management

User Story: As a user, I want to specify what equipment I have access to, so that the app can recommend appropriate exercises and substitutions based on my available resources.

Scenarios

Scenario: E05-F06-S01 - Setting up my available equipment
  Given I am on the "Settings" screen
  When I tap on "My Equipment"
  And I select "Home Gym"
  And I check "Dumbbells", "Kettlebells", and "Pull-up Bar"
  And I save my equipment profile
  Then my equipment profile should be updated
  And the app should prioritize exercises using this equipment
Scenario: E05-F06-S02 - Filtering exercises by available equipment
  Given I have set up my equipment profile
  When I am browsing the exercise library
  And I enable the "Only Show Available" filter
  Then I should only see exercises that can be performed with my equipment
  And exercises requiring unavailable equipment should be hidden
Scenario: E05-F06-S03 - Getting equipment substitution suggestions
  Given I am viewing a workout program
  And the program includes "Leg Press" which requires equipment I don't have
  When I tap on "Find Alternative"
  Then I should see a list of alternative exercises using my available equipment
  And each alternative should target similar muscle groups
  And I should be able to view a comparison between the original and alternatives

Acceptance Tests

# Test d'acceptation
Scenario: E05-F06-TA01 - Managing multiple equipment profiles
  Given I am on the "My Equipment" screen
  When I tap "Add New Profile"
  And I name it "Traveling"
  And I select only "Resistance Bands" and "Body Weight" 
  Then I should have two equipment profiles: "Home Gym" and "Traveling"
  When I select the "Traveling" profile
  Then all my workouts and recommendations should adapt to this limited equipment set