Files
Reflect/Tests iOS/IconPackTests.swift
Trey t 277e277750 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>
2026-02-17 09:37:54 -06:00

88 lines
2.6 KiB
Swift

//
// IconPackTests.swift
// Tests iOS
//
// Icon pack tests: select each of the 7 icon packs and verify no crash.
// TC-072
//
import XCTest
final class IconPackTests: BaseUITestCase {
override var seedFixture: String? { "single_mood" }
override var bypassSubscription: Bool { true }
/// All 7 icon pack accessibility identifiers (lowercased enum case names).
private let allIconPacks = [
"fontawesome",
"emoji",
"handemjoi",
"weather",
"garden",
"hearts",
"cosmic"
]
/// TC-072: Select each of 7 icon packs without crashing.
func testIconPacks_AllSelectable() {
let tabBar = TabBarScreen(app: app)
let settingsScreen = tabBar.tapSettings()
settingsScreen.assertVisible()
// Should already be on Customize sub-tab
// Scroll down to find the icon pack section
app.swipeUp()
for pack in allIconPacks {
let button = app.buttons["customize_iconpack_\(pack)"]
if !button.exists {
// Scroll more to reveal buttons off-screen
app.swipeUp()
}
if button.waitForExistence(timeout: 3) {
button.tapWhenReady()
} else {
XCTFail("Icon pack button '\(pack)' should exist in the customize view")
}
}
captureScreenshot(name: "icon_packs_cycled")
// Navigate to Day tab and verify no crash entry row should still exist
tabBar.tapDay()
let entryRow = app.descendants(matching: .any)
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_"))
.firstMatch
XCTAssertTrue(
entryRow.waitForExistence(timeout: 5),
"Entry row should still be visible after cycling icon packs (no crash)"
)
captureScreenshot(name: "day_view_after_icon_pack_change")
}
/// TC-072: Verify each icon pack button exists in the customize view.
func testIconPacks_AllButtonsExist() {
let tabBar = TabBarScreen(app: app)
let settingsScreen = tabBar.tapSettings()
settingsScreen.assertVisible()
// Scroll down to the icon pack section
app.swipeUp()
for pack in allIconPacks {
let button = app.buttons["customize_iconpack_\(pack)"]
if !button.exists {
app.swipeUp()
}
XCTAssertTrue(
button.waitForExistence(timeout: 3),
"Icon pack button '\(pack)' should exist"
)
}
captureScreenshot(name: "icon_packs_all_buttons")
}
}