Add XCUITest suite with 27 test files covering unmapped P1 test cases
- Add 8 new test files: HeaderMoodLogging (TC-002), DayViewGrouping (TC-019), AllDayViewStyles (TC-021), MonthViewInteraction (TC-030), PaywallGate (TC-032/039/048), AppTheme (TC-070), IconPack (TC-072), PremiumCustomization (TC-075) - Add accessibility IDs for paywall overlays, icon packs, app theme cards, and day view section headers - Add --expire-trial launch argument to UITestMode for paywall gate testing - Update QA test plan spreadsheet with XCUITest names for 14 test cases - Include existing test infrastructure: screen objects, helpers, base class, and 19 previously written test files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
53
Tests iOS/EntryDeleteTests.swift
Normal file
53
Tests iOS/EntryDeleteTests.swift
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// EntryDeleteTests.swift
|
||||
// Tests iOS
|
||||
//
|
||||
// Entry deletion tests.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class EntryDeleteTests: BaseUITestCase {
|
||||
override var seedFixture: String? { "single_mood" }
|
||||
|
||||
/// TC-025: Delete a mood entry from the detail sheet.
|
||||
func testDeleteEntry_FromDetail() {
|
||||
// Wait for entry to appear
|
||||
let firstEntry = app.descendants(matching: .any)
|
||||
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_"))
|
||||
.firstMatch
|
||||
|
||||
guard firstEntry.waitForExistence(timeout: 8) else {
|
||||
XCTFail("No entry row found from seeded data")
|
||||
return
|
||||
}
|
||||
|
||||
firstEntry.tap()
|
||||
|
||||
let detailScreen = EntryDetailScreen(app: app)
|
||||
detailScreen.assertVisible()
|
||||
|
||||
captureScreenshot(name: "entry_detail_before_delete")
|
||||
|
||||
// Delete the entry
|
||||
detailScreen.deleteEntry()
|
||||
|
||||
// Detail should dismiss after delete
|
||||
detailScreen.assertDismissed()
|
||||
|
||||
// The entry should no longer be visible (or empty state should show)
|
||||
// Give UI time to update
|
||||
let moodHeader = app.otherElements["mood_header"]
|
||||
let noDataText = app.staticTexts["empty_state_no_data"]
|
||||
|
||||
let headerReappeared = moodHeader.waitForExistence(timeout: 5)
|
||||
let noDataAppeared = noDataText.waitForExistence(timeout: 2)
|
||||
|
||||
XCTAssertTrue(
|
||||
headerReappeared || noDataAppeared,
|
||||
"After deleting the only entry, mood header or empty state should appear"
|
||||
)
|
||||
|
||||
captureScreenshot(name: "entry_deleted")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user