Requirements moved. Test plan draft created. Playwright setup failed.
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
# Specs
|
||||
|
||||
This is a directory for test plans.
|
||||
905
specs/gymflow-test-plan.md
Normal file
905
specs/gymflow-test-plan.md
Normal file
@@ -0,0 +1,905 @@
|
||||
# GymFlow Application Test Plan
|
||||
|
||||
## Application Overview
|
||||
|
||||
Comprehensive test plan for the GymFlow web application, covering authentication, workout management, tracking, data visualization, user/admin management, and adaptive GUI responsiveness. This plan is based on the provided requirements.md.
|
||||
|
||||
## Test Scenarios
|
||||
|
||||
### 1. I. Core & Authentication
|
||||
|
||||
**Seed:** `tests/core-auth.spec.ts`
|
||||
|
||||
#### 1.1. A. Login - Successful Authentication
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Navigate to the login page (http://192.168.50.234:3000/).
|
||||
2. Enter a valid email in the email field.
|
||||
3. Enter a valid password in the password field.
|
||||
4. Click the 'Login' button.
|
||||
|
||||
**Expected Results:**
|
||||
- User is redirected to the main application dashboard (e.g., Tracker view).
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 1.2. A. Login - Invalid Credentials
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Navigate to the login page.
|
||||
2. Enter an invalid email or password.
|
||||
3. Click the 'Login' button.
|
||||
|
||||
**Expected Results:**
|
||||
- An error message 'Invalid credentials' or similar is displayed.
|
||||
- User remains on the login page.
|
||||
|
||||
#### 1.3. A. Login - First-Time Password Change
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Navigate to the login page.
|
||||
2. Log in with a first-time user's temporary credentials.
|
||||
3. Enter a new password (at least 4 characters).
|
||||
4. Click 'Save' or 'Change Password' button.
|
||||
|
||||
**Expected Results:**
|
||||
- User is prompted to change password on first login.
|
||||
- New password is set successfully.
|
||||
- User is logged into the application.
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 1.4. A. Login - First-Time Password Change (Password too short)
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Navigate to the login page.
|
||||
2. Log in with a first-time user's temporary credentials.
|
||||
3. Enter a new password less than 4 characters.
|
||||
4. Click 'Save' or 'Change Password' button.
|
||||
|
||||
**Expected Results:**
|
||||
- An error message 'Password too short' is displayed.
|
||||
- User remains on the password change screen.
|
||||
|
||||
#### 1.5. A. Login - Language Selection (English)
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Navigate to the login page.
|
||||
2. Select 'English' from the language dropdown.
|
||||
|
||||
**Expected Results:**
|
||||
- All UI text elements on the login page are displayed in English.
|
||||
|
||||
#### 1.6. A. Login - Language Selection (Russian)
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Navigate to the login page.
|
||||
2. Select 'Русский' from the language dropdown.
|
||||
|
||||
**Expected Results:**
|
||||
- All UI text elements on the login page are displayed in Russian.
|
||||
|
||||
#### 1.7. B. Navigation - Desktop Navigation Rail
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Ensure the browser window is wide enough to trigger desktop layout (e.g., >768px width).
|
||||
3. Verify the vertical navigation rail is present on the left side.
|
||||
4. Click on each navigation item (Tracker, Plans, History, Stats, AI Coach, Profile).
|
||||
|
||||
**Expected Results:**
|
||||
- The corresponding section of the application is displayed for each click.
|
||||
- The navigation rail remains visible and functional.
|
||||
|
||||
#### 1.8. B. Navigation - Mobile Bottom Navigation Bar
|
||||
|
||||
**File:** `tests/core-auth.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Ensure the browser window is narrow enough to trigger mobile layout (e.g., <768px width).
|
||||
3. Verify the bottom navigation bar is present.
|
||||
4. Click on each navigation item (Tracker, Plans, History, Stats, AI Coach, Profile).
|
||||
|
||||
**Expected Results:**
|
||||
- The corresponding section of the application is displayed for each click.
|
||||
- The bottom navigation bar remains visible and functional.
|
||||
|
||||
### 2. II. Workout Management
|
||||
|
||||
**Seed:** `tests/workout-management.spec.ts`
|
||||
|
||||
#### 2.1. A. Workout Plans - Create New Plan
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Plans' section.
|
||||
3. Click the 'Add New Plan' or '+' FAB button.
|
||||
4. Enter a 'Plan Name' (e.g., 'My New Strength Plan').
|
||||
5. Enter a 'Description' (e.g., 'Focus on compound lifts').
|
||||
6. Add an exercise to the plan.
|
||||
7. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- A new plan with the specified name and description appears in the plans list.
|
||||
- The plan contains the added exercise.
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 2.2. A. Workout Plans - Edit Existing Plan
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Plans' section.
|
||||
3. Create a new plan (if none exist).
|
||||
4. Click the 'Edit' icon for an existing plan.
|
||||
5. Modify the 'Plan Name' and 'Description'.
|
||||
6. Add/remove exercises, or reorder them.
|
||||
7. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- The plan is updated with the new name, description, and exercise list.
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 2.3. A. Workout Plans - Delete Plan
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Plans' section.
|
||||
3. Create a new plan (if none exist).
|
||||
4. Click the 'Delete' icon for an existing plan.
|
||||
5. Confirm deletion when prompted.
|
||||
|
||||
**Expected Results:**
|
||||
- The plan is removed from the list.
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 2.4. A. Workout Plans - Reorder Exercises within a Plan
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Plans' section.
|
||||
3. Create a plan with at least two exercises.
|
||||
4. Enter the plan editor.
|
||||
5. Drag an exercise to a new position.
|
||||
6. Verify the order changes.
|
||||
7. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- Exercises are reordered correctly within the plan editor.
|
||||
- The reordered plan is saved and reflected in the view.
|
||||
|
||||
#### 2.5. A. Workout Plans - Start Session from Plan
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Plans' section.
|
||||
3. Create a plan with at least one exercise.
|
||||
4. Click 'Start' button for the created plan.
|
||||
5. If a plan description is present, confirm the plan start.
|
||||
|
||||
**Expected Results:**
|
||||
- The application transitions to the 'Active Session' view.
|
||||
- The session starts with the selected plan's exercises.
|
||||
- The timer starts running.
|
||||
|
||||
#### 2.6. B. Exercise Library - Create Custom Exercise (Strength)
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Exercise Manager'.
|
||||
4. Click 'Create Exercise'.
|
||||
5. Enter an exercise name (e.g., 'Custom Bicep Curl').
|
||||
6. Select 'Strength' as the type.
|
||||
7. Click 'Create'.
|
||||
|
||||
**Expected Results:**
|
||||
- The new exercise appears in the exercise list.
|
||||
- The exercise type is correctly displayed as Strength.
|
||||
- No error messages.
|
||||
|
||||
#### 2.7. B. Exercise Library - Create Custom Exercise (Bodyweight with %)
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Exercise Manager'.
|
||||
4. Click 'Create Exercise'.
|
||||
5. Enter an exercise name (e.g., 'Advanced Push-up').
|
||||
6. Select 'Bodyweight' as the type.
|
||||
7. Enter '50' for 'Body Weight Percentage'.
|
||||
8. Click 'Create'.
|
||||
|
||||
**Expected Results:**
|
||||
- The new exercise appears in the exercise list.
|
||||
- The exercise type is correctly displayed as Bodyweight with 50% body weight percentage.
|
||||
- No error messages.
|
||||
|
||||
#### 2.8. B. Exercise Library - Edit Exercise Name
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Exercise Manager'.
|
||||
4. Click the 'Edit' icon for an existing exercise.
|
||||
5. Change the exercise name.
|
||||
6. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- The exercise name is updated in the list.
|
||||
- No error messages.
|
||||
|
||||
#### 2.9. B. Exercise Library - Archive/Unarchive Exercise
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Exercise Manager'.
|
||||
4. Click the 'Archive' icon for an existing exercise.
|
||||
5. Verify the exercise is marked as archived (or disappears if filtered).
|
||||
6. Toggle 'Show Archived' checkbox.
|
||||
7. Click the 'Unarchive' icon for the same exercise.
|
||||
|
||||
**Expected Results:**
|
||||
- Exercise is archived and unarchived successfully.
|
||||
- Visibility changes correctly based on 'Show Archived' filter.
|
||||
|
||||
#### 2.10. B. Exercise Library - Filter Exercises by Name
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Exercise Manager'.
|
||||
4. Enter a partial exercise name into the filter field.
|
||||
5. Verify only matching exercises are displayed.
|
||||
|
||||
**Expected Results:**
|
||||
- The exercise list is dynamically filtered to show only exercises whose names contain the typed text.
|
||||
|
||||
#### 2.11. B. Exercise Library - New Exercise Name field capitalization (mobile)
|
||||
|
||||
**File:** `tests/workout-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Plans' section.
|
||||
3. Click the 'Add New Plan' or '+' FAB button.
|
||||
4. Click 'Add Exercise', then 'Create Exercise'.
|
||||
5. Verify the virtual keyboard for the 'Exercise Name' field suggests capitalizing each word (e.g., `text-transform: capitalize` or `inputmode="text" autocapitalize="words"`).
|
||||
|
||||
**Expected Results:**
|
||||
- The 'Name' input field for new exercises correctly prompts for capitalization on mobile keyboards, enhancing user experience.
|
||||
|
||||
### 3. III. Workout Tracking
|
||||
|
||||
**Seed:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
#### 3.1. B. Idle State - Start Free Workout
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Ensure the tracker is in the idle state.
|
||||
3. Enter a body weight in the input field (e.g., '75.5').
|
||||
4. Click 'Free Workout' button.
|
||||
|
||||
**Expected Results:**
|
||||
- The application transitions to 'Active Session' view.
|
||||
- The timer starts.
|
||||
- The entered body weight is displayed in the active session header.
|
||||
|
||||
#### 3.2. B. Idle State - Start Quick Log
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Ensure the tracker is in the idle state.
|
||||
3. Click 'Quick Log' button.
|
||||
|
||||
**Expected Results:**
|
||||
- The application transitions to 'Sporadic Logging' view.
|
||||
|
||||
#### 3.3. B. Idle State - Body Weight Defaults from Profile
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user with a weight set in their profile.
|
||||
2. Navigate to the 'Tracker' section (Idle View).
|
||||
|
||||
**Expected Results:**
|
||||
- The 'My Weight' field in the Idle View defaults to the weight specified in the user's profile.
|
||||
|
||||
#### 3.4. C. Active Session - Log Strength Set
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a 'Free Workout' session (ensure body weight is set).
|
||||
2. Select a Strength exercise (e.g., 'Bench Press').
|
||||
3. Enter 'Weight' (e.g., '80') and 'Reps' (e.g., '5').
|
||||
4. Click 'Log Set'.
|
||||
|
||||
**Expected Results:**
|
||||
- The set is added to the session history.
|
||||
- Input fields are cleared.
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 3.5. C. Active Session - Log Bodyweight Set
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a 'Free Workout' session.
|
||||
2. Select a Bodyweight exercise (e.g., 'Pull-up').
|
||||
3. Enter 'Weight' (e.g., '10') and 'Reps' (e.g., '8').
|
||||
4. Verify 'Body Weight Percentage' defaults to '100'.
|
||||
5. Click 'Log Set'.
|
||||
|
||||
**Expected Results:**
|
||||
- The set is added to the session history.
|
||||
- Input fields are cleared.
|
||||
- Body weight percentage is used in calculations.
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 3.6. C. Active Session - Log Cardio Set
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a 'Free Workout' session.
|
||||
2. Select a Cardio exercise (e.g., 'Running').
|
||||
3. Enter 'Time (sec)' (e.g., '300') and 'Distance (m)' (e.g., '1000').
|
||||
4. Click 'Log Set'.
|
||||
|
||||
**Expected Results:**
|
||||
- The set is added to the session history.
|
||||
- Input fields are cleared.
|
||||
- No error messages are displayed.
|
||||
|
||||
#### 3.7. C. Active Session - Edit Logged Set
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a 'Free Workout' session.
|
||||
2. Log at least one set.
|
||||
3. Click the 'Edit' icon for a logged set.
|
||||
4. Modify 'Weight' or 'Reps'.
|
||||
5. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- The set's details are updated in the session history.
|
||||
- No error messages.
|
||||
|
||||
#### 3.8. C. Active Session - Delete Logged Set
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a 'Free Workout' session.
|
||||
2. Log at least one set.
|
||||
3. Click the 'Delete' icon for a logged set.
|
||||
4. Confirm deletion.
|
||||
|
||||
**Expected Results:**
|
||||
- The set is removed from the session history.
|
||||
- No error messages.
|
||||
|
||||
#### 3.9. C. Active Session - Finish Session
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a 'Free Workout' session.
|
||||
2. Log at least one set.
|
||||
3. Click 'Finish' button.
|
||||
4. Confirm finishing the session.
|
||||
|
||||
**Expected Results:**
|
||||
- Session data is saved.
|
||||
- User is returned to the 'Idle State' of the Tracker.
|
||||
- No error messages.
|
||||
|
||||
#### 3.10. C. Active Session - Quit Session Without Saving
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a 'Free Workout' session.
|
||||
2. Log at least one set.
|
||||
3. Click 'More' (three dots) menu.
|
||||
4. Select 'Quit Without Saving'.
|
||||
5. Confirm quitting.
|
||||
|
||||
**Expected Results:**
|
||||
- Session data is discarded.
|
||||
- User is returned to the 'Idle State' of the Tracker.
|
||||
- No error messages.
|
||||
|
||||
#### 3.11. C. Active Session - Plan Progression and Jump to Step
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Start a session from a workout plan with multiple steps.
|
||||
2. Log sets for the first exercise in the plan until it's considered complete.
|
||||
3. Observe the plan progression to the next step.
|
||||
4. Click on the plan progression bar to expand the plan list.
|
||||
5. Click on a different (e.g., third) step in the expanded plan list.
|
||||
|
||||
**Expected Results:**
|
||||
- The current exercise automatically advances to the next planned exercise.
|
||||
- Clicking a step in the plan list navigates the active session to that exercise.
|
||||
|
||||
#### 3.12. D. Sporadic Logging - Log Strength Sporadic Set
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to 'Quick Log' mode.
|
||||
3. Select a Strength exercise.
|
||||
4. Enter 'Weight' and 'Reps'.
|
||||
5. Click 'Log Set'.
|
||||
|
||||
**Expected Results:**
|
||||
- The sporadic set is added to today's history in the Sporadic Logging view.
|
||||
- Input fields are cleared.
|
||||
- A success message is briefly displayed.
|
||||
|
||||
#### 3.13. D. Sporadic Logging - Exercise Search and Clear
|
||||
|
||||
**File:** `tests/workout-tracking.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to 'Quick Log' mode.
|
||||
3. Type a partial exercise name into the 'Select Exercise' field (e.g., 'ben').
|
||||
4. Verify the list of exercises is filtered.
|
||||
5. Click on the 'Select Exercise' field again (or focus it).
|
||||
|
||||
**Expected Results:**
|
||||
- The exercise list filters dynamically as the user types.
|
||||
- The search field content is cleared on focus.
|
||||
|
||||
### 4. IV. Data & Progress
|
||||
|
||||
**Seed:** `tests/data-progress.spec.ts`
|
||||
|
||||
#### 4.1. A. Session History - View Past Sessions
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Complete at least one workout session and log at least one sporadic set.
|
||||
3. Navigate to the 'History' section.
|
||||
|
||||
**Expected Results:**
|
||||
- All past workout sessions and sporadic sets are displayed, grouped by date.
|
||||
- Each entry shows key summary information (date, duration, plan name, total work, exercise count).
|
||||
|
||||
#### 4.2. A. Session History - View Detailed Session
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Complete at least one workout session.
|
||||
3. Navigate to the 'History' section.
|
||||
4. Click on a workout session entry.
|
||||
|
||||
**Expected Results:**
|
||||
- A detailed view of the session opens, showing all individual sets with their metrics.
|
||||
- Session start/end times and body weight are displayed.
|
||||
|
||||
#### 4.3. A. Session History - Edit Past Session Details
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Complete a workout session.
|
||||
3. Navigate to the 'History' section.
|
||||
4. Open the detailed view of a session.
|
||||
5. Modify the 'Start Time', 'End Time', or 'Body Weight'.
|
||||
6. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- Session details are updated successfully.
|
||||
- The changes are reflected in the history view.
|
||||
|
||||
#### 4.4. A. Session History - Edit Individual Set in Past Session
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Complete a workout session with multiple sets.
|
||||
3. Navigate to the 'History' section.
|
||||
4. Open the detailed view of a session.
|
||||
5. Click the 'Edit' icon for an individual set.
|
||||
6. Modify a metric (e.g., weight, reps).
|
||||
7. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- The individual set's metrics are updated.
|
||||
- The changes are reflected in the detailed session view.
|
||||
|
||||
#### 4.5. A. Session History - Delete Past Session
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Complete a workout session.
|
||||
3. Navigate to the 'History' section.
|
||||
4. Click the 'Delete' icon for a session.
|
||||
5. Confirm deletion.
|
||||
|
||||
**Expected Results:**
|
||||
- The session is permanently removed from the history.
|
||||
- No error messages.
|
||||
|
||||
#### 4.6. A. Session History - Edit Sporadic Set
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Log at least one sporadic set.
|
||||
3. Navigate to the 'History' section.
|
||||
4. Locate and click the 'Edit' icon for a sporadic set.
|
||||
5. Modify a metric (e.g., weight, reps, duration).
|
||||
6. Click 'Save'.
|
||||
|
||||
**Expected Results:**
|
||||
- The sporadic set's metrics are updated.
|
||||
- The changes are reflected in the history view.
|
||||
|
||||
#### 4.7. A. Session History - Delete Sporadic Set
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Log at least one sporadic set.
|
||||
3. Navigate to the 'History' section.
|
||||
4. Locate and click the 'Delete' icon for a sporadic set.
|
||||
5. Confirm deletion.
|
||||
|
||||
**Expected Results:**
|
||||
- The sporadic set is permanently removed from the history.
|
||||
- No error messages.
|
||||
|
||||
#### 4.8. B. Performance Statistics - View Volume Chart
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Complete at least two workout sessions with logged sets.
|
||||
3. Navigate to the 'Stats' section.
|
||||
|
||||
**Expected Results:**
|
||||
- The 'Total Volume' line chart is displayed.
|
||||
- The chart accurately reflects the total weight lifted per session over time.
|
||||
|
||||
#### 4.9. B. Performance Statistics - View Set Count Chart
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Complete at least two workout sessions with logged sets.
|
||||
3. Navigate to the 'Stats' section.
|
||||
|
||||
**Expected Results:**
|
||||
- The 'Set Count' bar chart is displayed.
|
||||
- The chart accurately reflects the number of sets performed per session over time.
|
||||
|
||||
#### 4.10. B. Performance Statistics - View Body Weight Chart
|
||||
|
||||
**File:** `tests/data-progress.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Log body weight at least twice (e.g., via profile or session start).
|
||||
3. Navigate to the 'Stats' section.
|
||||
|
||||
**Expected Results:**
|
||||
- The 'Body Weight' line chart is displayed.
|
||||
- The chart accurately reflects the user's body weight changes over time.
|
||||
|
||||
### 5. V. User & System Management
|
||||
|
||||
**Seed:** `tests/user-system-management.spec.ts`
|
||||
|
||||
#### 5.1. A. User Profile - Update Personal Information
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Modify 'Weight', 'Height', 'Birth Date', and 'Gender'.
|
||||
4. Click 'Save Profile'.
|
||||
|
||||
**Expected Results:**
|
||||
- Profile information is updated successfully.
|
||||
- A success snackbar message is displayed.
|
||||
- The updated information is reflected upon refreshing the profile or re-logging in.
|
||||
|
||||
#### 5.2. A. User Profile - Change Password
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Enter a new password (min 4 characters) in the 'Change Password' field.
|
||||
4. Click 'OK'.
|
||||
|
||||
**Expected Results:**
|
||||
- Password change is successful.
|
||||
- A success message is displayed.
|
||||
- The user can log in with the new password.
|
||||
|
||||
#### 5.3. A. User Profile - Change Password (Too Short)
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Enter a password less than 4 characters in the 'Change Password' field.
|
||||
4. Click 'OK'.
|
||||
|
||||
**Expected Results:**
|
||||
- An error message 'Password too short' is displayed.
|
||||
- Password is not changed.
|
||||
|
||||
#### 5.4. A. User Profile - Dedicated Daily Weight Logging
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Weight Tracker'.
|
||||
4. Enter today's weight (e.g., '72.3').
|
||||
5. Click 'Log' button.
|
||||
|
||||
**Expected Results:**
|
||||
- The weight is logged for the current day.
|
||||
- The new record appears in the weight history list.
|
||||
- A success snackbar message is displayed.
|
||||
|
||||
#### 5.5. A. User Profile - Language Preference Change
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Select a different language (e.g., 'Русский') from the language dropdown.
|
||||
4. Click 'Save Profile'.
|
||||
|
||||
**Expected Results:**
|
||||
- The UI language immediately switches to the selected language.
|
||||
- The preference persists across sessions.
|
||||
|
||||
#### 5.6. A. User Profile - Delete Own Account
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user (not admin).
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Locate 'Delete Account' section.
|
||||
4. Click 'Delete' button.
|
||||
5. Confirm deletion when prompted.
|
||||
|
||||
**Expected Results:**
|
||||
- User account is deleted.
|
||||
- User is logged out and redirected to the login page.
|
||||
|
||||
#### 5.7. B. AI Coach - Send a Message
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'AI Coach' section.
|
||||
3. Type a message into the input field (e.g., 'What's a good workout for chest?').
|
||||
4. Click 'Send' button.
|
||||
|
||||
**Expected Results:**
|
||||
- User's message appears in the chat.
|
||||
- AI Coach responds with relevant advice.
|
||||
- No error messages.
|
||||
|
||||
#### 5.8. C. Admin Panel - Create New User
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as an 'ADMIN' user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Admin Area'.
|
||||
4. Enter a new 'Email' and 'Password' for a new user.
|
||||
5. Click 'Create User'.
|
||||
|
||||
**Expected Results:**
|
||||
- A new user is created and appears in the user list.
|
||||
- A success message is displayed.
|
||||
- The new user can log in with the created credentials.
|
||||
|
||||
#### 5.9. C. Admin Panel - View User List
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as an 'ADMIN' user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Admin Area'.
|
||||
4. Click to expand 'Users List'.
|
||||
|
||||
**Expected Results:**
|
||||
- A list of all users (excluding the current admin) is displayed, showing their email, role, and blocked status.
|
||||
|
||||
#### 5.10. C. Admin Panel - Block/Unblock User
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as an 'ADMIN' user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Admin Area' and 'Users List'.
|
||||
4. Locate a non-admin user.
|
||||
5. Click the 'Block' icon for that user.
|
||||
6. Verify the user's status changes to 'Blocked'.
|
||||
7. Click the 'Unblock' icon for the same user.
|
||||
|
||||
**Expected Results:**
|
||||
- User is blocked and unblocked successfully.
|
||||
- Status updates are reflected in the user list.
|
||||
|
||||
#### 5.11. C. Admin Panel - Reset User Password
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as an 'ADMIN' user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Admin Area' and 'Users List'.
|
||||
4. Locate a non-admin user.
|
||||
5. Enter a new password (min 4 characters) in the 'Reset Password' field for that user.
|
||||
6. Click 'Reset Pass' button.
|
||||
|
||||
**Expected Results:**
|
||||
- User's password is reset.
|
||||
- A success alert is displayed.
|
||||
- The user can log in with the new password.
|
||||
|
||||
#### 5.12. C. Admin Panel - Delete User
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as an 'ADMIN' user.
|
||||
2. Navigate to the 'Profile' section.
|
||||
3. Expand 'Admin Area' and 'Users List'.
|
||||
4. Locate a non-admin user.
|
||||
5. Click the 'Delete' icon for that user.
|
||||
6. Confirm deletion.
|
||||
|
||||
**Expected Results:**
|
||||
- The user is permanently removed from the system.
|
||||
- The user no longer appears in the user list.
|
||||
|
||||
#### 5.13. B. Exercise Library - New Exercise Name field capitalization (mobile)
|
||||
|
||||
**File:** `tests/user-system-management.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Plans' section.
|
||||
3. Click the 'Add New Plan' or '+' FAB button.
|
||||
4. Click 'Add Exercise', then 'Create Exercise'.
|
||||
5. Verify the virtual keyboard for the 'Exercise Name' field suggests capitalizing each word (e.g., `text-transform: capitalize` or `inputmode="text" autocapitalize="words"`).
|
||||
|
||||
**Expected Results:**
|
||||
- The 'Name' input field for new exercises correctly prompts for capitalization on mobile keyboards, enhancing user experience.
|
||||
|
||||
### 6. VI. User Interface & Experience
|
||||
|
||||
**Seed:** `tests/ui-ux.spec.ts`
|
||||
|
||||
#### 6.1. A. Adaptive GUI - Mobile Navigation (Width < 768px)
|
||||
|
||||
**File:** `tests/ui-ux.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Resize the browser window to a mobile width (e.g., 375px).
|
||||
3. Verify the bottom navigation bar is visible and functional.
|
||||
4. Verify the desktop navigation rail is hidden.
|
||||
|
||||
**Expected Results:**
|
||||
- Bottom navigation bar is present with correct icons and labels.
|
||||
- Desktop navigation rail is not visible.
|
||||
|
||||
#### 6.2. A. Adaptive GUI - Desktop Navigation (Width >= 768px)
|
||||
|
||||
**File:** `tests/ui-ux.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Resize the browser window to a desktop width (e.g., 1280px).
|
||||
3. Verify the vertical navigation rail is visible and functional.
|
||||
4. Verify the mobile bottom navigation bar is hidden.
|
||||
|
||||
**Expected Results:**
|
||||
- Vertical navigation rail is present with correct icons and labels.
|
||||
- Mobile bottom navigation bar is not visible.
|
||||
|
||||
#### 6.3. A. Adaptive GUI - Fluid Layout Responsiveness
|
||||
|
||||
**File:** `tests/ui-ux.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate through various sections (e.g., Plans, Profile, History).
|
||||
3. Gradually resize the browser window from desktop to mobile widths and vice-versa.
|
||||
|
||||
**Expected Results:**
|
||||
- Content layouts adapt smoothly to different screen sizes without horizontal scrolling or overlapping elements.
|
||||
- All interactive elements remain accessible and usable.
|
||||
|
||||
#### 6.4. A. Adaptive GUI - Responsive Charts in Stats
|
||||
|
||||
**File:** `tests/ui-ux.spec.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Log in as a regular user.
|
||||
2. Navigate to the 'Stats' section.
|
||||
3. Gradually resize the browser window from desktop to mobile widths and vice-versa.
|
||||
|
||||
**Expected Results:**
|
||||
- The volume, set count, and body weight charts resize and re-render correctly, maintaining readability and data integrity across different screen sizes.
|
||||
143
specs/requirements.md
Normal file
143
specs/requirements.md
Normal file
@@ -0,0 +1,143 @@
|
||||
# Application Requirements
|
||||
|
||||
This document outlines the functional requirements of the GymFlow application, derived from an analysis of its React components and backend services.
|
||||
|
||||
## I. Core & Authentication
|
||||
|
||||
### A. Login (`Login.tsx`)
|
||||
- **User Authentication:** Users must be able to log in using their email and password.
|
||||
- **First-Time Password Change:** On their initial login, users are required to change their temporary password.
|
||||
- **Language Selection:** The interface language can be toggled between English and Russian directly on the login screen.
|
||||
|
||||
### B. Navigation (`Navbar.tsx`)
|
||||
- **Primary Navigation:** A persistent navigation bar (bottom on mobile, side rail on desktop) allows access to the main sections of the application:
|
||||
- Tracker
|
||||
- Plans
|
||||
- History
|
||||
- Stats
|
||||
- AI Coach
|
||||
- Profile
|
||||
|
||||
## II. Workout Management
|
||||
|
||||
### A. Workout Plans (`Plans.tsx`)
|
||||
- **CRUD Operations:** Users can create, view, update, and delete their workout plans.
|
||||
- **Plan Composition:** A plan consists of a name, a descriptive text (for preparation/instructions), and an ordered list of exercises.
|
||||
- **Exercises List Reordering:** Exercises within a plan can be reordered via a drag-and-drop interface.
|
||||
- **Starting a Session:** Users can initiate a workout session from a selected plan in the list.
|
||||
|
||||
### B. Exercise Library (`Plans.tsx`, `Profile.tsx`)
|
||||
- **Custom Exercise Creation:** Users can define new exercises, specifying:
|
||||
- Name: The input field should suggest capitalizing each word for mobile users.
|
||||
- Type (e.g., Strength, Bodyweight, Cardio)
|
||||
- For bodyweight exercises, a percentage of body weight to be used in calculations.
|
||||
- **Exercise Management:** From the profile section, users can view all their created exercises, edit their names, and archive or unarchive them.
|
||||
|
||||
## III. Workout Tracking
|
||||
|
||||
### A. Tracker Hub (`Tracker/index.tsx`)
|
||||
- **Central Control:** This component orchestrates the tracking experience, displaying the appropriate view based on the current state (idle, in-session, or sporadic logging).
|
||||
|
||||
### B. Idle State (`Tracker/IdleView.tsx`)
|
||||
- **Session Initiation:** From the idle screen, users can:
|
||||
- Start a "Free Workout" without a predefined plan.
|
||||
- Begin a "Quick Log" session for sporadic, one-off sets.
|
||||
- Select and start a workout from their list of saved plans.
|
||||
- **Session Body Weight Entry:** Users can input their current body weight before starting a session; the default value comes from user profile; this weight is associated with the active session for accurate calculations.
|
||||
- **Plan Preview:** If a plan includes a description, it is displayed to the user for review before the session begins.
|
||||
|
||||
### C. Active Session (`Tracker/ActiveSessionView.tsx`)
|
||||
- **Real-Time Timer:** A running timer displays the elapsed time for the current workout.
|
||||
- **Exercise Selection:** Users can search for and select the exercise they are performing. The search field filters available exercises as the user types and clears its content automatically when focused. New exercises can be created on-the-fly.
|
||||
- **Set Logging:** Users can log completed sets, with input fields dynamically adjusting based on the selected exercise's type (e.g., weight/reps for strength, duration/distance for cardio).
|
||||
- **Session Body Weight:** The body weight entered before the session is displayed and used for calculations within the active session.
|
||||
- **Session History:** A chronological list of sets logged during the current session is displayed.
|
||||
- **Set Management:** Logged sets can be edited to correct data or deleted entirely.
|
||||
- **Plan Progression:** When following a plan, the interface highlights the current exercise. Users can view the full plan and jump to different steps if needed.
|
||||
- **Session Control:** Users can finish the session (saving the data) or quit without saving.
|
||||
|
||||
### D. Sporadic Logging (`Tracker/SporadicView.tsx`)
|
||||
- **Ad-Hoc Tracking:** Enables logging of individual sets outside of a structured workout session.
|
||||
- **Quick Access:** Optimized for quickly selecting an exercise, entering metrics, and logging the set. The exercise selection field filters available exercises as the user types and clears its content automatically when focused.
|
||||
- **Daily History:** Displays a list of all sporadic sets logged on the current day.
|
||||
|
||||
## IV. Data & Progress
|
||||
|
||||
### A. Session History (`History.tsx`)
|
||||
- **Workout Review:** Provides a comprehensive list of all past workout sessions and sporadic sets, grouped by day.
|
||||
- **Detailed View:** Users can inspect the details of each session, including all sets performed.
|
||||
- **Data Correction:** Past sessions and their individual sets can be edited or deleted.
|
||||
|
||||
### B. Performance Statistics (`Stats.tsx`)
|
||||
- **Visualizations:** The application generates and displays charts to track progress over time, including:
|
||||
- **Total Volume:** The total weight lifted in each session.
|
||||
- **Set Count:** The number of sets performed per session.
|
||||
- **Body Weight:** A line graph of the user's body weight over time.
|
||||
|
||||
## V. User & System Management
|
||||
|
||||
### A. User Profile (`Profile.tsx`)
|
||||
- **Personal Information:** Users can view and update their personal data, including weight, height, birth date, and gender.
|
||||
- **Dedicated Daily Weight Logging:** Users can log their body weight daily, and view a history of these records.
|
||||
- **Account Management:** Users can change their password and (if not an admin) delete their own account.
|
||||
- **Language Preference:** The application language can be changed.
|
||||
|
||||
### B. AI Coach (`AICoach.tsx`)
|
||||
- **Conversational AI:** Provides an interactive chat interface with an AI fitness expert.
|
||||
- **Contextual Awareness:** The AI is primed with the user's workout history, plans, and profile data to provide personalized advice and analysis.
|
||||
|
||||
### C. Admin Panel (within `Profile.tsx`)
|
||||
- **User Administration:** Admin-level users have access to a special panel to manage the user base.
|
||||
- **User CRUD:** Admins can create new users, view a list of all users, block/unblock, and delete users.
|
||||
- **Password Resets:** Admins can reset the passwords for non-admin users.
|
||||
|
||||
## VI. User Interface & Experience
|
||||
|
||||
### A. Adaptive GUI
|
||||
- **Responsive Navigation:**
|
||||
- On mobile devices, the application displays a bottom navigation bar.
|
||||
- On desktop devices, a vertical navigation rail is displayed on the left side.
|
||||
- **Fluid Layout:** The application's content layout adapts to different screen sizes, ensuring usability across a wide range of devices.
|
||||
- **Responsive Charts:** Data visualizations in the statistics section are responsive and scale to fit the available screen space.
|
||||
|
||||
## VII. Backend API Endpoints
|
||||
|
||||
The frontend components interact with a backend service through the following conceptual endpoints:
|
||||
|
||||
- **Authentication:**
|
||||
- `POST /auth/login`
|
||||
- `POST /auth/change-password`
|
||||
- `GET /auth/me`
|
||||
- **Users (Admin):**
|
||||
- `GET /users`
|
||||
- `POST /users/create`
|
||||
- `DELETE /users/:id`
|
||||
- `PUT /users/toggle-block/:id`
|
||||
- `POST /users/admin-reset-password`
|
||||
- **User Profile:**
|
||||
- `PUT /users/profile/:id`
|
||||
- **Workout Plans:**
|
||||
- `GET /plans`
|
||||
- `POST /plans`
|
||||
- `DELETE /plans/:id`
|
||||
- **Exercises:**
|
||||
- `GET /exercises`
|
||||
- `POST /exercises`
|
||||
- **Workout Sessions:**
|
||||
- `GET /sessions`
|
||||
- `POST /sessions/start`
|
||||
- `POST /sessions/end`
|
||||
- `POST /sessions/quit`
|
||||
- `POST /sessions/active/log-set`
|
||||
- `PUT /sessions/:id`
|
||||
- `DELETE /sessions/:id`
|
||||
- **Sporadic Sets:**
|
||||
- `GET /sporadic-sets`
|
||||
- `POST /sporadic-sets`
|
||||
- `PUT /sporadic-sets/:id`
|
||||
- `DELETE /sporadic-sets/:id`
|
||||
- **Weight Logging:**
|
||||
- `GET /weight`
|
||||
- `POST /weight`
|
||||
- **AI Service:**
|
||||
- `POST /ai/chat`
|
||||
Reference in New Issue
Block a user