testing:like all fail

This commit is contained in:
Michael Freno
2026-01-08 23:14:19 -05:00
parent a14b7e7b99
commit 4ebaece754
9 changed files with 800 additions and 3 deletions

View File

@@ -0,0 +1,83 @@
//
// SettingsUITests.swift
// GazeUITests
//
// Created by Mike Freno on 1/8/26.
//
import XCTest
@MainActor
final class SettingsUITests: XCTestCase {
var app: XCUIApplication!
override func setUpWithError() throws {
continueAfterFailure = false
app = XCUIApplication()
app.launchArguments.append("--skip-onboarding")
app.launch()
}
override func tearDownWithError() throws {
app = nil
}
func testOpenSettingsWindow() throws {
let menuBar = app.menuBarItems.firstMatch
if menuBar.exists {
menuBar.click()
let settingsButton = app.menuItems["Settings"]
if settingsButton.waitForExistence(timeout: 2) {
settingsButton.click()
let settingsWindow = app.windows["Settings"]
XCTAssertTrue(settingsWindow.waitForExistence(timeout: 3))
}
}
}
func testSettingsWindowHasTimerControls() throws {
let menuBar = app.menuBarItems.firstMatch
if menuBar.exists {
menuBar.click()
let settingsButton = app.menuItems["Settings"]
if settingsButton.waitForExistence(timeout: 2) {
settingsButton.click()
sleep(1)
let hasSliders = app.sliders.count > 0
let hasTextFields = app.textFields.count > 0
let hasSwitches = app.switches.count > 0
let hasControls = hasSliders || hasTextFields || hasSwitches
XCTAssertTrue(hasControls, "Settings should have timer controls")
}
}
}
func testSettingsWindowCanBeClosed() throws {
let menuBar = app.menuBarItems.firstMatch
if menuBar.exists {
menuBar.click()
let settingsButton = app.menuItems["Settings"]
if settingsButton.waitForExistence(timeout: 2) {
settingsButton.click()
let settingsWindow = app.windows["Settings"]
if settingsWindow.waitForExistence(timeout: 3) {
let closeButton = settingsWindow.buttons[XCUIIdentifierCloseWindow]
if closeButton.exists {
closeButton.click()
XCTAssertFalse(settingsWindow.exists)
}
}
}
}
}
}