import XCTest /// The unlocked foreground half only. Real APNs, Face ID and hidden previews /// remain a physical-device gate before enabling production capability. final class NotificationActionUITests: XCTestCase { @MainActor func testBoundQuestionShowsItsOptions() { let app = XCUIApplication() app.launchEnvironment["EQUIPO_NOTIFICATION_FIXTURE"] = "question" app.launch() defer { app.terminate() } XCTAssertTrue(app.staticTexts["Should the badge clear when you switch teams too?"].waitForExistence(timeout: 10)) XCTAssertTrue(app.buttons["Clear it when switching teams"].exists) XCTAssertTrue(app.buttons["Keep each team’s count"].exists) capture("iphone-notification-question") } @MainActor func testMergeShowsFreshEvidenceBeforeFinalTap() { let app = XCUIApplication() app.launchEnvironment["EQUIPO_NOTIFICATION_FIXTURE"] = "merge" app.launch() defer { app.terminate() } XCTAssertTrue(app.buttons["task-confirm"].waitForExistence(timeout: 10)) XCTAssertTrue(app.staticTexts["Approved"].firstMatch.exists) XCTAssertTrue(app.staticTexts.matching(NSPredicate(format: "label BEGINSWITH %@", "The badge now resets when the person signs out.")).firstMatch.exists) XCTAssertTrue(app.staticTexts["equipo/needs-badge-sign-out"].exists) XCTAssertTrue(app.staticTexts["3f9c2a167de8"].exists) capture("iphone-notification-merge") app.buttons["task-confirm"].tap() XCTAssertTrue(app.buttons["task-confirm"].waitForNonExistence(timeout: 5)) } @MainActor private func capture(_ name: String) { let attachment = XCTAttachment(screenshot: XCUIScreen.main.screenshot()) attachment.name = name; attachment.lifetime = .keepAlways; add(attachment) } }