Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
5002cfc
Added initial data models
Calvin-Xu Jan 31, 2025
d5fe389
tweaks to models
Calvin-Xu Feb 4, 2025
aed3978
Delete Feedbridge/.swift-version
shamit05 Feb 5, 2025
45bd8a6
added periphery ignore to files to pass checks
shamit05 Feb 5, 2025
8bfc2f1
added periphery ignore to files to pass checks
shamit05 Feb 5, 2025
bb78230
Merge branch 'calvin/set-up-data-models' of https://github.com/CS342/…
shamit05 Feb 5, 2025
8d984b8
Merge branch 'calvin/set-up-data-models' of https://github.com/CS342/…
shamit05 Feb 5, 2025
838073b
Merge branch 'calvin/set-up-data-models' of https://github.com/CS342/…
shamit05 Feb 5, 2025
e5a146f
Shamit/createadddataviews (#14)
shamit05 Feb 12, 2025
69e8ac9
Shamit/createadddataviews (#16)
shamit05 Feb 12, 2025
d8e8afc
Calvin/firebase starter+add baby view (#17)
Calvin-Xu Feb 12, 2025
057dc13
Calvin/full add data view data firebase refactor (#18)
Calvin-Xu Feb 12, 2025
3aa1069
Calvin/full add data view data firebase refactor (#19)
Calvin-Xu Feb 12, 2025
59f67d2
Misc UI updates, validations, project structure tweaks
Calvin-Xu Feb 12, 2025
3889260
Fix formatting
Calvin-Xu Feb 12, 2025
3a9cc04
Add Dehydration and Feed Sheets and Firebase Integration (#20)
shreyadsouza Feb 13, 2025
dd1d1b4
Calvin/refactor model housekeeping (#21)
Calvin-Xu Feb 13, 2025
e7b9855
Merge visualizations into main dev branch (#26)
shreyadsouza Mar 7, 2025
5b91616
Fix many SwiftLint warnings (#29)
Calvin-Xu Mar 7, 2025
9e4f66b
Calvin/add firebase delete (#27)
Calvin-Xu Mar 7, 2025
e341c23
Calvin/add final data entry views (#22)
Calvin-Xu Mar 7, 2025
b736f7a
fix missing file issue
shreyadsouza Mar 7, 2025
688f086
fix missing file issue
shreyadsouza Mar 7, 2025
7ae2520
made view conform with rest of pages and fixed bug with add weight an…
shamit05 Mar 7, 2025
0aec53d
Merge visualization changes with base dev branch (#31)
shreyadsouza Mar 7, 2025
451124d
Update formatting of form (#32)
shreyadsouza Mar 7, 2025
60cbb6a
Revamped settings to include baby picker and option to delete baby. A…
shamit05 Mar 9, 2025
0abc5e0
Added weights to be consistent with userdefaults
shamit05 Mar 9, 2025
d52d76e
Merge refactoring into UI updates branch (#34)
shreyadsouza Mar 9, 2025
913ae73
remove lint errors
shreyadsouza Mar 9, 2025
e279032
Revamped Settings (#33)
shamit05 Mar 9, 2025
9cbdac0
new changes
shamit05 Mar 9, 2025
b50a2c6
Merge branch 'shamit/vis_and_modify-data-entries' into calvin/set-up-…
shamit05 Mar 9, 2025
a765dab
merged changes
shamit05 Mar 9, 2025
c6cf635
Shamit/delete entries (#36)
shamit05 Mar 10, 2025
84c9e25
Add Unit Tests for Data Models (#37)
Calvin-Xu Mar 10, 2025
8d13e9b
SwiftLint style fixes (#38)
Calvin-Xu Mar 10, 2025
eaf33a3
Add Test Coverage for FeedbridgeStandard (#39)
Calvin-Xu Mar 10, 2025
26127e5
remove duplicate references
shreyadsouza Mar 10, 2025
95be369
Merge initial alerting setup into dev branch (#40)
shreyadsouza Mar 10, 2025
b804f3f
Finished entry deletion options (#41)
shamit05 Mar 11, 2025
b3db049
Shamit/finished entry delete options (#42)
shamit05 Mar 11, 2025
998dc91
Added dynamic UI updates via Observable model
Calvin-Xu Mar 11, 2025
75d5776
Fixed formating with swiftlint
Calvin-Xu Mar 11, 2025
e783770
Merge remote-tracking branch 'origin/calvin/set-up-data-models' into …
Calvin-Xu Mar 11, 2025
ab02a89
Fixed Firebase sync, AddEntryView
Calvin-Xu Mar 11, 2025
3d21915
update references
shreyadsouza Mar 11, 2025
a477959
Merge visualization updates with firebase changes (#47)
shreyadsouza Mar 11, 2025
dc0590c
changed bundle identifier for testing/release
shamit05 Mar 11, 2025
95c84b2
Fixed Periphery issues - ready to merge to main (#48)
shamit05 Mar 12, 2025
05ddc5f
Temporarily disable TestFeedbridgeStandard to see if the CI finishes
Calvin-Xu Mar 12, 2025
e4a51a3
Disable more UITests to see if CI passes
Calvin-Xu Mar 12, 2025
c1370e2
Update dehydration visualization to support empty data and fix entry …
shreyadsouza Mar 12, 2025
f20d3d4
Disable SchedulerTests
Calvin-Xu Mar 12, 2025
2f79f8b
Update alerting to use dashboard view model (#50)
shreyadsouza Mar 12, 2025
33da534
working tests for AddBabyView
shreyadsouza Mar 13, 2025
148c43f
working tests for AddBabyView
shreyadsouza Mar 13, 2025
fc6b8bb
minor changes
shreyadsouza Mar 13, 2025
cfad43f
comments
shreyadsouza Mar 13, 2025
778d865
Merge branch 'main' into shryea/ui-tests
shreyadsouza Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Feedbridge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */; };
2FF53D8D2A8729D600042B76 /* FeedbridgeStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF53D8C2A8729D600042B76 /* FeedbridgeStandard.swift */; };
35B62D5D2D80C20C0096904E /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35B62D5C2D80C20C0096904E /* SettingsView.swift */; };
35B62F7A2D8257EC0096904E /* AddBabyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35B62F792D8257E80096904E /* AddBabyTests.swift */; };
53F30C282D7FBB670077FD21 /* AddDataViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53F30C272D7FBB670077FD21 /* AddDataViewTests.swift */; };
5680DD3E2AB8CD84004E6D4A /* ContributionsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5680DD3D2AB8CD84004E6D4A /* ContributionsTest.swift */; };
56E708352BB06B7100B08F0A /* SpeziLicense in Frameworks */ = {isa = PBXBuildFile; productRef = 56E708342BB06B7100B08F0A /* SpeziLicense */; };
Expand Down Expand Up @@ -113,6 +114,7 @@
2FF53D8C2A8729D600042B76 /* FeedbridgeStandard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedbridgeStandard.swift; sourceTree = "<group>"; };
358F60B12D73FEE000721B85 /* DashboardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardView.swift; sourceTree = "<group>"; };
35B62D5C2D80C20C0096904E /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
35B62F792D8257E80096904E /* AddBabyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddBabyTests.swift; sourceTree = "<group>"; };
35E52D2B2D794472005A6BB7 /* WeightCharts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeightCharts.swift; sourceTree = "<group>"; };
35E52D302D79475E005A6BB7 /* StoolCharts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoolCharts.swift; sourceTree = "<group>"; };
35E52D332D7947D3005A6BB7 /* StoolsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoolsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -338,6 +340,7 @@
653A256A28338800005D4D48 /* FeedbridgeUITests */ = {
isa = PBXGroup;
children = (
35B62F792D8257E80096904E /* AddBabyTests.swift */,
53F30C272D7FBB670077FD21 /* AddDataViewTests.swift */,
2F4E237D2989A2FE0013F3D9 /* OnboardingTests.swift */,
653A256B28338800005D4D48 /* SchedulerTests.swift */,
Expand Down Expand Up @@ -612,6 +615,7 @@
53F30C282D7FBB670077FD21 /* AddDataViewTests.swift in Sources */,
2F4E237E2989A2FE0013F3D9 /* OnboardingTests.swift in Sources */,
653A256C28338800005D4D48 /* SchedulerTests.swift in Sources */,
35B62F7A2D8257EC0096904E /* AddBabyTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
90 changes: 90 additions & 0 deletions FeedbridgeUITests/AddBabyTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
//
// AddBabyTests.swift
// Feedbridge
//
// Created by Shreya D'Souza on 3/11/25.
//
// SPDX-FileCopyrightText: 2025 Stanford University
//
// SPDX-License-Identifier: MIT
//

import XCTest
import XCTestExtensions

@MainActor
class AddBabyTests: XCTestCase {
/// Sets up the test environment before each test case.
/// Ensures that there are no existing babies and launches the app with test configurations.
override func setUp() async throws {
continueAfterFailure = false

let app = XCUIApplication()
app.launchArguments = ["--setupTestAccount", "--skipOnboarding"]
app.deleteAndLaunch(withSpringboardAppName: "Feedbridge")

// Clear existing babies before each test
deleteAllBabies(app)
}

/// Deletes all babies using the UI delete button, ensuring a clean state before each test.
/// - Parameter app: The XCUIApplication instance.
private func deleteAllBabies(_ app: XCUIApplication) {
app.buttons["Settings"].tap()

let deleteButton = app.buttons["Delete Baby, Delete Baby"]

// If the delete button exists, repeatedly tap it to remove all babies
while deleteButton.waitForExistence(timeout: 2) {
deleteButton.tap()
app.buttons["Delete"].tap()
}
}

/// Tests the process of adding a new baby and verifying that the baby is correctly displayed in the UI.
func testAddBaby() {
let app = XCUIApplication()
app.buttons["Settings"].tap()

// Verify initial state: No baby should be selected
XCTAssertTrue(app.staticTexts["Select Baby"].exists, "Select baby dropdown should be visible")
XCTAssertTrue(app.staticTexts["No baby selected"].exists, "No babies should exist")

// Open the dropdown menu and select "Add New Baby"
let dropdown = app.buttons["Baby icon, Select Baby, Menu dropdown"]
dropdown.tap()
let addNew = app.buttons["Add New Baby"]
XCTAssertTrue(addNew.exists, "Should be an option to add a baby")
addNew.tap()

// Ensure that the Save button is initially disabled
let saveButton = app.buttons["Save"]
XCTAssertFalse(saveButton.isEnabled, "Save button should be disabled initially")

// Enter baby's name
let nameField = app.textFields["Baby's Name"]
nameField.tap()
nameField.typeText("Benjamin")

// Verify that a duplicate name warning is not displayed
XCTAssertFalse(app.staticTexts["This name is already taken"].exists, "Duplicate name warning should not appear")

// Date Picker: Select March 2025 (valid past date)
let datePickersQuery = app.datePickers.firstMatch
datePickersQuery.tap()
app.staticTexts["1"].tap()
app.buttons["PopoverDismissRegion"].tap() // Close the date picker

// Ensure the Save button is enabled now that valid data is entered
XCTAssertTrue(saveButton.isEnabled, "Save button should be enabled when valid data is entered")

// Save the baby data
saveButton.tap()

// Verify that the new baby is correctly added and displayed in the UI
XCTAssertTrue(app.staticTexts["Benjamin"].exists, "Baby's name should be displayed")
XCTAssertTrue(app.buttons["Baby icon, Benjamin, Menu dropdown"].exists, "Baby dropdown should show new baby")
XCTAssertTrue(app.buttons["Delete Baby, Delete Baby"].exists, "Delete button should be displayed for the new baby")
XCTAssertTrue(app.staticTexts["Use Kilograms"].exists, "The 'Use Kilograms' text should be displayed")
}
}