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>
This commit is contained in:
65
Tests iOS/Screens/CustomizeScreen.swift
Normal file
65
Tests iOS/Screens/CustomizeScreen.swift
Normal file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// 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
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user