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:
51
Tests iOS/DayViewGroupingTests.swift
Normal file
51
Tests iOS/DayViewGroupingTests.swift
Normal file
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// DayViewGroupingTests.swift
|
||||
// Tests iOS
|
||||
//
|
||||
// Day view section header grouping tests.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class DayViewGroupingTests: BaseUITestCase {
|
||||
override var seedFixture: String? { "week_of_moods" }
|
||||
|
||||
/// TC-019: Entries are grouped by year/month section headers.
|
||||
func testEntries_GroupedBySectionHeaders() {
|
||||
// 1. Wait for entry list to load with seeded data
|
||||
let firstEntry = app.descendants(matching: .any)
|
||||
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_"))
|
||||
.firstMatch
|
||||
XCTAssertTrue(
|
||||
firstEntry.waitForExistence(timeout: 5),
|
||||
"Entry rows should exist with week_of_moods fixture"
|
||||
)
|
||||
|
||||
// 2. Verify at least one section header exists
|
||||
let anySectionHeader = app.descendants(matching: .any)
|
||||
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "day_section_"))
|
||||
.firstMatch
|
||||
XCTAssertTrue(
|
||||
anySectionHeader.waitForExistence(timeout: 5),
|
||||
"At least one day_section_ header should exist"
|
||||
)
|
||||
|
||||
// 3. The week_of_moods fixture contains entries in the current month.
|
||||
// Verify the section header for the current month/year exists.
|
||||
let now = Date()
|
||||
let calendar = Calendar.current
|
||||
let month = calendar.component(.month, from: now)
|
||||
let year = calendar.component(.year, from: now)
|
||||
|
||||
let expectedHeaderID = "day_section_\(month)_\(year)"
|
||||
let currentMonthHeader = app.descendants(matching: .any)
|
||||
.matching(identifier: expectedHeaderID)
|
||||
.firstMatch
|
||||
XCTAssertTrue(
|
||||
currentMonthHeader.waitForExistence(timeout: 5),
|
||||
"Section header '\(expectedHeaderID)' should exist for current month"
|
||||
)
|
||||
|
||||
captureScreenshot(name: "day_view_section_headers")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user