Files
Reflect/Tests iOS/Screens/CustomizeScreen.swift
Trey t 10581cc8fb Add Tests iOS/Screens/ page objects and fix gitignore
The screens/ gitignore rule was matching Tests iOS/Screens/ on
case-insensitive macOS. Anchored to /screens/ (repo root only) so
the 7 UI test page object files are no longer ignored.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 13:15:21 -06:00

66 lines
1.7 KiB
Swift

//
// CustomizeScreen.swift
// Tests iOS
//
// Screen object for the Customize sub-tab theme, voting layout, and day view style pickers.
//
import XCTest
struct CustomizeScreen {
let app: XCUIApplication
// MARK: - Theme Mode Buttons
func themeButton(named name: String) -> XCUIElement {
app.buttons["customize_theme_\(name.lowercased())"]
}
// MARK: - Voting Layout Buttons
func votingLayoutButton(named name: String) -> XCUIElement {
app.buttons["customize_voting_\(name.lowercased())"]
}
// MARK: - Day View Style Buttons
func dayViewStyleButton(named name: String) -> XCUIElement {
app.buttons["customize_daystyle_\(name.lowercased())"]
}
// MARK: - Actions
func selectTheme(_ name: String) {
let button = themeButton(named: name)
button.tapWhenReady()
}
func selectVotingLayout(_ name: String) {
let button = votingLayoutButton(named: name)
// May need to scroll horizontally to find it
if !button.isHittable {
app.swipeLeft()
}
button.tapWhenReady()
}
func selectDayViewStyle(_ name: String) {
let button = dayViewStyleButton(named: name)
// May need to scroll horizontally to find it
if !button.isHittable {
app.swipeLeft()
}
button.tapWhenReady()
}
// MARK: - Assertions
func assertThemeButtonExists(_ name: String, file: StaticString = #file, line: UInt = #line) {
XCTAssertTrue(
themeButton(named: name).waitForExistence(timeout: 5),
"Theme button '\(name)' should exist",
file: file, line: line
)
}
}