Skip to content

illiashkirko/CS-130-Project

Repository files navigation

Uplifted

Repository link:

https://github.com/illiashkirko/CS-130-Project/

Overview

UpLifted is a social workout sharing app made with Swift and Firebase designed to combat workout demotivation.

Running the project

In XCode, clone this repository with "git clone [Repository link]"

Add NSCameraUsageDescription key to the Info.plist (within Xcode) with value, "UpLifted needs access to your camera. Don't worry, we pixelate the image!"

If GoogleService-Info.plist file is not present in the root directory, download the file from https://drive.google.com/file/d/1YEzWuldkY3tqudldVPl3_u0JTaJ32w1u/view?usp=sharing and place it within the root directory of the project.

Build with Cmd + B and run with Cmd + R.

To run tests, please, run test suites individually within the XCode Testing environment UI.

Directory Structure

CS-130-Project/  
|-- UpLifted.xcodeproj/          // Xcode project file  
|   |-- project.pbxproj          // Xcode   
|-- UpLifted/                    // Source Code  
|   |-- Controllers/             // Firebase usage functions
|   |-- Models/                  // Exercise/workout models
|   |-- Views/                   // All User Views
|   |   |-- Authentication/      // Sign up/login views  
|   |   |-- Camera/              // Connection to phone camera
|   |   |-- NavTabViews/         // Navigation views
|   |   |   |-- WorkoutsView/    // Workout views  
|-- UpLiftedTests/               // Unit tests  
|-- UpLiftedUITests/             // UI unit tests  

Test Cases and Behavior

https://github.com/illiashkirko/CS-130-Project/tree/main/UpLiftedTests

https://github.com/illiashkirko/CS-130-Project/tree/main/UpLiftedUITests

Test Scenarios Workouts

1. Workout Template Creation

Tests the creation and validation of workout templates with multiple exercises.

  • Input: Template with multiple exercises, each containing multiple sets
  • Expected Outcome:
    • Template name matches input
    • Correct number of exercises stored
    • Exercise names and set counts are preserved
  • Test Method: testWorkoutTemplateCreation()

2. Workout Template Controller Management

Tests the controller responsible for creating and managing workout templates.

  • Input: Various controller operations (adding/removing exercises, setting template name)
  • Expected Outcome:
    • Form validation works correctly
    • Exercise addition/removal updates state properly
    • Initial state is invalid until required fields are filled
  • Test Method: testCreateWorkoutTemplateController()

3. Exercise and Set Management

Tests the creation and validation of individual exercises and their sets.

  • Input: Exercise (Deadlift) with multiple sets and varying weights
  • Expected Outcome:
    • Exercise properties are correctly stored
    • Set details (reps, weights) are accurate
    • Time-based sets are handled properly
  • Test Method: testExerciseAndSetManagement()

4. Live Workout Controller Tests

Tests various functions that are responsible for starting and running a live workout.

  • Input Controller operations (Adding workouts, adding excercises, adding sets, removing excercises)
  • Expected Outcome
    • New workouts are successfully created and deleted
    • New excercises are added and removed
    • New sets are added and removed
  • Test Methods testStartNewWorkout() testAddExercise() testRemoveExercise() testAddSet() testRemoveSet()

Test Scenarios SearchBar

1. Follow/Unfollow Functionality

Tests the ability to follow and unfollow users.

  • Input: A follow test user and Current test user
  • Expected Outcome:
    • Follow: isFriend(userID:) should return true after a user has been followed
    • Unfollow: isFriend(userID:) shoulf return false after the user has been unfollowed
  • Test Methods: testFollowUnfollowUser()

2. Search Bar User Filtering

Tests the search functionality to ensure users are filtered correctly.

  • Input: Empty search query ("")
  • Expected Outcome:
    • All users from Firestore are displayed since the query string is empty.
  • Test Method: testFilterAllUsers()

UI Test Scenarios Authentication

1. App Launch - Show Login Screen if No User is Logged In

Tests whether the login and sign-up buttons are displayed when no user is logged in.

  • Input:
    • Launch app
    • Ensures the user is logged out
  • Expected Outcome:
    • The login and signup buttons will be shown to the screen.

2. Login Screen - Show Error Message for Empty Fields

Tests whether an error message appears when attempting to log in with empty fields.

  • Input:
    • Navigate to the sign up page
    • Leave email and password empty
    • Attempt to sign in
  • Expected Outcome:
    • Error Message should say the fields can't be empty

3. Login Process - Successful Login should Hide Login Screen

Tests whether a successful login removes the login screen.

  • Input:
    • Go to the login screen
    • Enter valid credentials
    • Try signing in again
  • Expected Outcome:
    • The login screen disappears confirming a successful login

4. Navigation to Sign-Up Screen - Ensure All Fields Exist

Tests whether all necessary fields are present on the sign-up screen.

  • Input:
    • Go to the sign-up screen
  • Expected Outcome:
    • Should be these fields:
      • Email
      • Password
      • Full Name
      • Username
      • Bio
      • Height
      • Weight
      • Birthday picker

5. Sign-Up Process - Error On Missing Fields

Tests whether an error message appears when attempting to sign up with empty fields.

  • Input:
    • Go to the sign-up screen
    • Try to sign up without entering anything
  • Expected Outcome:
    • An error message is shown saying that the required fields are not filled in

UI Test Scenarios SearchBar

1. UI Search Functionality

Tests the search bar in the app’s UI to ensure correct filtering of users.

  • Input:
    • Go to search bar
    • Type "a" in the search field
  • Expected Outcome:
    • Search text field exists on the screen
    • Search results contain only users whose names start with "a"
    • Each displayed username correctly follows the expected format
  • Test Method: testSearchFriendsStartingWithA()

UI Test Scenarios Profile

1. UI Follower Correctness

Tests the followers count in the app’s profile UI to ensure correct numbering is diplayed.

  • Input:
    • Go to own profile
    • Click on follower count
  • Expected Outcome:
    • Profile displays the follower count
    • Follower count is clickable to reach followers list
    • Number of followers in the followers list matches the count displayed in the profile
  • Test Method: testFollowersCountMatchesListEntries()

2. UI Following Count Correctness

Tests the following count in the app’s profile UI to ensure correct numbering is diplayed.

  • Input:
    • Go to own profile
    • Click on following count
  • Expected Outcome:
    • Profile displays the following count
    • Following count is clickable to reach followers list
    • Number of following in the following list matches the count displayed in the profile
  • Test Method: testFollowingCountMatchesListEntries()

UI Test Scenarios Feed

1. UI Reaction Functionality

Tests the reaction functionality in the feed screen UI to make sure the reaction counts are updated correctly.

  • Input:
    • Pick first post in the feed
    • Leave a reaction and check the count
    • Remove a reaction and check the count
  • Expected Outcome:
    • Feed displays posts correctly
    • Reaction count increments by one upon clicking
    • Reaction count decrements by one upon double clicking
  • Test Method: testReactionButtonUpdatesCount()

2. UI Feed Order Correctness

Tests the timestamps in the app’s feed UI to ensure correct orderding of the posts.

  • Input:
    • Select all available posts from feed
    • Extract all timestamps
    • Check whether timetamps appear in chronological order
  • Expected Outcome:
    • Feed displays posts correctly
    • Timestamps are displayed on descending order in time
  • Test Method: testFeedIsInChronologicalOrder()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages