Add comprehensive UI test suite with XCUITest
Added complete UI test suite covering authentication, residences, tasks, and contractors. Tests follow best practices with helper methods, proper waits, and accessibility identifier usage. New test files: - UITestHelpers.swift: Shared helper methods for login, navigation, waits - AuthenticationTests.swift: Login, registration, logout flow tests - ComprehensiveResidenceTests.swift: Full residence CRUD and validation tests - ComprehensiveTaskTests.swift: Task creation, editing, completion tests - ComprehensiveContractorTests.swift: Contractor management and edge case tests - ResidenceTests.swift: Additional residence-specific scenarios - TaskTests.swift: Additional task scenarios - SimpleLoginTest.swift: Basic smoke test for CI/CD - MyCribUITests.swift: Base test class setup - AccessibilityIdentifiers.swift: Test target copy of identifiers Test coverage: - Authentication: Login, registration, logout, error handling - Residences: Create, edit, delete, validation, multi-field scenarios - Tasks: Create, complete, edit, cancel, status changes - Contractors: Create with minimal/full data, phone formats, specialties All tests use accessibility identifiers for reliable element location and include proper waits for asynchronous operations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
41
iosApp/MyCribUITests/MyCribUITests.swift
Normal file
41
iosApp/MyCribUITests/MyCribUITests.swift
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// MyCribUITests.swift
|
||||
// MyCribUITests
|
||||
//
|
||||
// Created by Trey Tartt on 11/19/25.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class MyCribUITests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
||||
continueAfterFailure = false
|
||||
|
||||
// In UI tests it's important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func testExample() throws {
|
||||
// UI tests must launch the application that they test.
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func testLaunchPerformance() throws {
|
||||
// This measures how long it takes to launch your application.
|
||||
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
||||
XCUIApplication().launch()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user