Skip to content

Commit ff717e1

Browse files
shamit05Calvin-Xu
andauthored
Fixes some testing issues (#59)
# *Fixes some testing issues* ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Calvin Xu <calvinxu806@gmail.com>
1 parent d735fda commit ff717e1

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

Feedbridge/Views/Dashboard/DehydrationCharts.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ struct DehydrationSummaryView: View {
104104
summaryCard()
105105
}
106106
.buttonStyle(PlainButtonStyle())
107+
.accessibilityIdentifier("dehydrationSummaryView")
107108
}
108109

109110
private func summaryCard() -> some View {

FeedbridgeUITests/AddBabyTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class AddBabyTests: XCTestCase {
5454
let dropdown = app.buttons["Baby icon, Select Baby, Menu dropdown"]
5555
dropdown.tap()
5656
let addNew = app.buttons["Add New Baby"]
57-
XCTAssertTrue(addNew.waitForExistence(timeout: 5), "Should be an option to add a baby")
57+
XCTAssertTrue(addNew.waitForExistence(timeout: 10), "Should be an option to add a baby")
5858
addNew.tap()
5959

6060
// Ensure that the Save button is initially disabled
@@ -80,13 +80,13 @@ class AddBabyTests: XCTestCase {
8080

8181
// Save the baby data
8282
// Make sure the Save button is visible and hittable
83-
// if !saveButton.isHittable {
84-
// app.swipeUp() // Try scrolling if button isn't visible
85-
// XCTAssertTrue(saveButton.waitForExistence(timeout: 2), "Save button should be visible after scrolling")
86-
// }
83+
if !saveButton.isHittable {
84+
app.swipeUp() // Try scrolling if button isn't visible
85+
XCTAssertTrue(saveButton.waitForExistence(timeout: 2), "Save button should be visible after scrolling")
86+
}
8787

88-
// // Save the baby data with a single tap
89-
// XCTAssertTrue(saveButton.isHittable, "Save button should be hittable")
88+
// Save the baby data with a single tap
89+
XCTAssertTrue(saveButton.isHittable, "Save button should be hittable")
9090
saveButton.tap()
9191

9292
// Verify that the new baby is correctly added and displayed in the UI

FeedbridgeUITests/AddEntryTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ final class AddEntryTests: XCTestCase {
450450

451451
// The formCheck would return error for 0 => "Invalid feed time (minutes)."
452452
let confirmButton = app.buttons["Confirm"]
453-
XCTAssertTrue(!confirmButton.isEnabled, "Button should not be enabled")
454453

455454
confirmButton.tap()
456455

FeedbridgeUITests/DehydrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DehydrationTests: XCTestCase {
3535
XCTAssertTrue(nav.exists, "Dehydration symptoms navigation should exist")
3636

3737
// Tap on the first dehydration entry
38-
let button = app.buttons["Heart icon, Dehydration Symptoms, Next page, 3/9/25, 3/10/25, 3/11/25, 3/12/25, 3/13/25"]
38+
let button = app.buttons["dehydrationSummaryView"]
3939
button.tap()
4040

4141
// Check if "Dehydration Symptoms" title and sample dehydration alert exist

0 commit comments

Comments
 (0)