// // 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.waitForExistence(timeout: 5) button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap() } func selectVotingLayout(_ name: String) { let button = votingLayoutButton(named: name) if button.exists && !button.isHittable { app.swipeLeft() } _ = button.waitForExistence(timeout: 5) button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap() } func selectDayViewStyle(_ name: String) { let button = dayViewStyleButton(named: name) if button.exists && !button.isHittable { app.swipeLeft() } _ = button.waitForExistence(timeout: 5) button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap() } // 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 ) } }