diff --git a/Feedbridge/Views/Dashboard/DehydrationCharts.swift b/Feedbridge/Views/Dashboard/DehydrationCharts.swift index d7f9308..69b689b 100644 --- a/Feedbridge/Views/Dashboard/DehydrationCharts.swift +++ b/Feedbridge/Views/Dashboard/DehydrationCharts.swift @@ -104,6 +104,7 @@ struct DehydrationSummaryView: View { summaryCard() } .buttonStyle(PlainButtonStyle()) + .accessibilityIdentifier("dehydrationSummaryView") } private func summaryCard() -> some View { diff --git a/FeedbridgeUITests/AddBabyTests.swift b/FeedbridgeUITests/AddBabyTests.swift index c24da8b..4dd9986 100644 --- a/FeedbridgeUITests/AddBabyTests.swift +++ b/FeedbridgeUITests/AddBabyTests.swift @@ -54,7 +54,7 @@ class AddBabyTests: XCTestCase { let dropdown = app.buttons["Baby icon, Select Baby, Menu dropdown"] dropdown.tap() let addNew = app.buttons["Add New Baby"] - XCTAssertTrue(addNew.waitForExistence(timeout: 5), "Should be an option to add a baby") + XCTAssertTrue(addNew.waitForExistence(timeout: 10), "Should be an option to add a baby") addNew.tap() // Ensure that the Save button is initially disabled @@ -80,13 +80,13 @@ class AddBabyTests: XCTestCase { // Save the baby data // Make sure the Save button is visible and hittable - // if !saveButton.isHittable { - // app.swipeUp() // Try scrolling if button isn't visible - // XCTAssertTrue(saveButton.waitForExistence(timeout: 2), "Save button should be visible after scrolling") - // } + if !saveButton.isHittable { + app.swipeUp() // Try scrolling if button isn't visible + XCTAssertTrue(saveButton.waitForExistence(timeout: 2), "Save button should be visible after scrolling") + } - // // Save the baby data with a single tap - // XCTAssertTrue(saveButton.isHittable, "Save button should be hittable") + // Save the baby data with a single tap + XCTAssertTrue(saveButton.isHittable, "Save button should be hittable") saveButton.tap() // Verify that the new baby is correctly added and displayed in the UI diff --git a/FeedbridgeUITests/AddEntryTests.swift b/FeedbridgeUITests/AddEntryTests.swift index 2d32c32..efa3168 100644 --- a/FeedbridgeUITests/AddEntryTests.swift +++ b/FeedbridgeUITests/AddEntryTests.swift @@ -450,7 +450,6 @@ final class AddEntryTests: XCTestCase { // The formCheck would return error for 0 => "Invalid feed time (minutes)." let confirmButton = app.buttons["Confirm"] - XCTAssertTrue(!confirmButton.isEnabled, "Button should not be enabled") confirmButton.tap() diff --git a/FeedbridgeUITests/DehydrationTests.swift b/FeedbridgeUITests/DehydrationTests.swift index c1283c4..b1576d7 100644 --- a/FeedbridgeUITests/DehydrationTests.swift +++ b/FeedbridgeUITests/DehydrationTests.swift @@ -35,7 +35,7 @@ class DehydrationTests: XCTestCase { XCTAssertTrue(nav.exists, "Dehydration symptoms navigation should exist") // Tap on the first dehydration entry - 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"] + let button = app.buttons["dehydrationSummaryView"] button.tap() // Check if "Dehydration Symptoms" title and sample dehydration alert exist